File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -189,13 +189,6 @@ h3.button {
189189 stroke : white;
190190}
191191
192- a .all-downloads {
193- display : block;
194- position : absolute;
195- color : var (--color-gray-30 );
196- padding-left : 1rem ;
197- }
198-
199192p .big {
200193 font-size : 115% ;
201194}
@@ -517,29 +510,33 @@ p.big {
517510 line-height : var (--doc-line-height );
518511}
519512
520- a .all-downloads {
521- position : relative!important ;
522- padding : 0 ;
523- margin : 0 ;
513+ .# all-downloads {
514+ /* This is hidden to begin with, see 07-download.js */
515+ display : none!important ;
524516}
525517
526- .hero-links {
527- display : grid;
528- grid-template-columns : auto;
529- grid-template-columns : auto;
518+ .hero-links {
519+ display : flex;
520+ flex-direction : row;
530521 justify-content : center;
522+ align-items : center;
523+ gap : 1rem ;
531524 text-align : center;
525+ padding-bottom : 2.5em ;
532526}
533527
534528.hero-links h3 .button {
535529 padding-top : 10px ;
536- margin : 0 auto;
537- margin-top : 1em ;
538- margin-bottom : 2em ;
530+ margin : 1em 0.5em ;
539531}
540532
541- .hero-links h3 .button # download {
542- margin-bottom : 5px ;
533+ .hero-links h3 .button a {
534+ white-space : nowrap;
535+ }
536+
537+ .hero-links h3 .button : hover {
538+ transform : translateY (-1px );
539+ background-color : var (--ec-icon-purple );
543540}
544541
545542.hero h2 {
Original file line number Diff line number Diff line change 11document . addEventListener ( 'DOMContentLoaded' , async ( ) => {
22 const download = document . querySelector ( '#download a' ) ;
3+ const downloadAll = document . querySelector ( '#all-downloads a' ) ;
34 if ( ! download ) {
45 return
56 }
67 try {
7- const response = await fetch ( 'https://api.github.com/repos/conforma/cli/releases/tags/snapshot ' ) ;
8+ const response = await fetch ( 'https://api.github.com/repos/conforma/cli/releases/latest ' ) ;
89 const snapshot = await response . json ( ) ;
910 const uap = new UAParser ( ) ;
1011 const os = uap . getOS ( ) . name . replace ( 'macOS' , 'darwin' ) . toLowerCase ( ) ;
1112 const arch = uap . getCPU ( ) . architecture ;
1213 const file = `ec_${ os } _${ arch } ` ;
1314 const asset = snapshot . assets . find ( a => a . name === file ) ;
1415 if ( asset ) {
15- download . parentNode . insertAdjacentHTML ( 'afterend' , `<a class="all-downloads" href= ${ download . href } >(All downloads)</a>` )
16+ // Update the download button href to the user's specific platform/arch
1617 download . href = asset . browser_download_url ;
1718 download . title = `${ uap . getOS ( ) . name } / ${ uap . getCPU ( ) . architecture } ` ;
19+ // Unhide the download all button
20+ downloadAll . style . display = 'inline-flex' ;
1821 }
19- } catch ( e ) {
22+ } catch ( e ) {
2023 // Unable to fetch the releases leave the download link as is
2124 return ;
2225 }
Original file line number Diff line number Diff line change 11---
22kind : home
33---
4+ ### [ {{< icon "arrow-down-circle" >}} Download] ( https://github.com/conforma/cli/releases/latest ) {#download .button}
45
5- ### [ {{< icon "arrow-down-circle" >}} Download ] ( https://github.com/conforma/cli/releases/tag/snapshot ) {#download .button}
6+ ### [ {{< icon "arrow-down-circle" >}} All downloads ] ( https://github.com/conforma/cli/releases/latest ) {#all-downloads .button}
67
78### [ {{< icon "book-open" >}} Getting Started] ( docs/user-guide/hitchhikers-guide.html ) {.button}
You can’t perform that action at this time.
0 commit comments