@@ -68,35 +68,38 @@ <h2 class="text-lg">{{ .title | markdownify }}</h2>
6868
6969
7070 < div class ="card-group ">
71- {{ range $index, $repo := (getJSON "https://api.github.com/orgs/Netcentric/repos") }}
71+ {{ $.Scratch.Set "$index" 0 }}
72+ {{ $repo := (getJSON "https://api.github.com/orgs/Netcentric/repos") }}
73+ {{ range sort $repo "stargazers_count" "desc"}}
74+ {{ $.Scratch.Set "$index" (add ($.Scratch.Get "$index") 1) }}
7275 < div class ="card mr-4 mb-4 repo-card ">
7376 < div class ="card-body ">
7477 < h3 class ="h4 card-title repo-title ">
75- < a href ="{{ $repo .html_url | safeURL }} " title ="{{ $repo .full_name | markdownify }} " rel ="noopener ">
76- {{ replace $repo .full_name "Netcentric/" "" | markdownify }}
78+ < a href ="{{ .html_url | safeURL }} " title ="{{ .full_name | markdownify }} " rel ="noopener ">
79+ {{ replace .full_name "Netcentric/" "" | markdownify }}
7780 </ a >
7881 </ h3 >
79- < p class ="card-text "> {{ $repo .description | markdownify }}</ p >
82+ < p class ="card-text "> {{ .description | markdownify }}</ p >
8083 </ div >
8184 < div class ="card-footer ">
8285 < div class ="d-flex ">
8386 < span class ="d-flex align-items-center mr-3 ">
8487 < img class ="icon mr-2 " alt ="Star " src ="/images/icons/star.svg " />
85- < span class ="d-inline-block "> {{ $repo .stargazers_count }}</ span >
88+ < span class ="d-inline-block "> {{ .stargazers_count }}</ span >
8689 </ span >
87- {{ if gt $repo .forks_count 0 }}
90+ {{ if gt .forks_count 0 }}
8891 < span class ="d-flex align-items-center ">
8992 < img class ="icon mr-2 " alt ="Github forks " src ="/images/icons/github.svg " />
9093 < span >
91- {{ $repo .forks_count }}
92- {{ if gt $repo .forks_count 1 }}forks{{ else }}fork{{ end }}
94+ {{ .forks_count }}
95+ {{ if gt .forks_count 1 }}forks{{ else }}fork{{ end }}
9396 </ span >
9497 </ span >
9598 {{ end }}
9699 </ div >
97100 </ div >
98101 </ div >
99- {{ if eq (mod (add ( $index) 1 ) 2) 0 }}
102+ {{ if eq (mod ($.Scratch.Get " $index" ) 2) 0 }}
100103 </ div > < div class ="card-group ">
101104 {{ end }}
102105 {{ end }}
0 commit comments