Skip to content

Commit 8793697

Browse files
committed
trending-github-repositories fixes
Removed contributors, interpolate 'unknown' when no language found
1 parent 93d0260 commit 8793697

2 files changed

Lines changed: 49 additions & 54 deletions

File tree

widgets/trending-github-repositories/README.md

Lines changed: 48 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,57 @@ The data is sourced from the [OSS Insights](https://ossinsight.io/) trend API, g
55

66
```yaml
77
- type: custom-api
8-
title: Trending Repositories
9-
cache: 24h
10-
url: 'https://api.ossinsight.io/v1/trends/repos/?period=${PERIOD}&language=${LANGUAGE}'
11-
template: |
12-
<ul class="list list-gap-10 collapsible-container" data-collapse-after="3">
13-
{{ range .JSON.Array "data.rows"}}
14-
<li>
15-
<a class="color-primary-if-not-visited" href="https://github.com/{{ .String "repo_name" }}">{{ .String "repo_name" }}</a>
16-
<ul class="list-horizontal-text">
17-
<li class="color-highlight"> {{.String "primary_language"}} </li>
18-
19-
<li style="display: flex; align-items: center;gap: 4px;">
20-
{{ .Int "stars" }}
21-
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="currentColor" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
22-
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
23-
</svg>
24-
</li>
25-
26-
<li style="display: flex; align-items: center;gap: 4px;">
27-
{{ .Int "forks" }}
28-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
29-
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
30-
<circle cx="12" cy="18" r="2" />
31-
<circle cx="7" cy="6" r="2" />
32-
<circle cx="17" cy="6" r="2" />
33-
<path d="M7 8v2a2 2 0 0 0 2 2h6a2 2 0 0 0 2 -2v-2" />
34-
<path d="M12 12l0 4" />
35-
</svg>
36-
</li>
37-
38-
<li style="display: flex; align-items: center;gap: 4px;">
39-
{{ .Int "pull_requests" }}
40-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
41-
<circle cx="6" cy="6" r="3"></circle>
42-
<circle cx="18" cy="18" r="3"></circle>
43-
<path d="M13 6h3a2 2 0 0 1 2 2v7"></path>
44-
<line x1="6" y1="9" x2="6" y2="21"></line>
45-
</svg>
46-
</li>
47-
48-
</ul>
49-
<ul class="list collapsible-container">
50-
<li style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" class="color-subdue">
51-
Contributors: {{ .String "contributor_logins"}}
52-
</li>
53-
<li>
54-
{{ .String "description" }}
55-
</li>
56-
</ul>
57-
</li>
58-
{{ end }}
59-
</ul>
8+
title: Trending Repositories
9+
cache: 24h
10+
url: 'https://api.ossinsight.io/v1/trends/repos/?period=${PERIOD}&language=${LANGUAGE}'
11+
template: |
12+
<ul class="list list-gap-10 collapsible-container" data-collapse-after="3">
13+
{{ range .JSON.Array "data.rows"}}
14+
<li>
15+
<a class="color-primary-if-not-visited" href="https://github.com/{{ .String "repo_name" }}">{{ .String "repo_name" }}</a>
16+
<ul class="list-horizontal-text" style="flex-wrap: nowrap;">
17+
<li class="color-highlight">{{ if .String "primary_language" }}{{.String "primary_language"}}{{ else }}Unknown{{ end }}</li>
18+
19+
<li style="display: flex; align-items: center;gap: 4px;">
20+
{{ .Int "stars" }}
21+
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" fill="currentColor" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
22+
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
23+
</svg>
24+
</li>
25+
26+
<li style="display: flex; align-items: center;gap: 4px;">
27+
{{ .Int "forks" }}
28+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
29+
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
30+
<circle cx="12" cy="18" r="2" />
31+
<circle cx="7" cy="6" r="2" />
32+
<circle cx="17" cy="6" r="2" />
33+
<path d="M7 8v2a2 2 0 0 0 2 2h6a2 2 0 0 0 2 -2v-2" />
34+
<path d="M12 12l0 4" />
35+
</svg>
36+
</li>
37+
38+
<li style="display: flex; align-items: center;gap: 4px;">
39+
{{ .Int "pull_requests" }}
40+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
41+
<circle cx="6" cy="6" r="3"></circle>
42+
<circle cx="18" cy="18" r="3"></circle>
43+
<path d="M13 6h3a2 2 0 0 1 2 2v7"></path>
44+
<line x1="6" y1="9" x2="6" y2="21"></line>
45+
</svg>
46+
</li>
47+
48+
</ul>
49+
<div>
50+
{{ .String "description" }}
51+
</div>
52+
</li>
53+
{{ end }}
54+
</ul>
6055
```
6156
6257
## Environment Variables
6358
- `PERIOD` - Period over which the trend is calculated, possible options are [`past_24_hours`, `past_week`, `past_month`, `past_3_months`]
6459
- `LANGUAGE` - The main language used in the repository, possiblities are [`All`, `JavaScript`, `Java`, `Python`, `PHP`, `C++`, `C#`, `TypeScript`, `Shell`, `C`, `Ruby`, `Rust`, `Go`, `Kotlin`, `HCL`, `PowerShell`, `CMake`, `Groovy`, `PLpgSQL`, `TSQL`, `Dart`, `Swift`, `HTML`, `CSS`, `Elixir`, `Haskell`, `Solidity`, `Assembly`, `R`, `Scala`, `Julia`, `Lua`, `Clojure`, `Erlang`, `Common Lisp`, `Emacs Lisp`, `OCaml`, `MATLAB`, `Objective-C`, `Perl`, `Fortran`]
6560

66-
For any further changes consult the [API's documentation](https://ossinsight.io/docs/api/list-trending-repos).
61+
For any further changes consult the [API's documentation](https://ossinsight.io/docs/api/list-trending-repos).
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
title: Trending GitHub Repositories
22
description: Daily trending GitHub repositories.
3-
author: jelkuweiss
3+
author: jelkuweiss dankozlowski

0 commit comments

Comments
 (0)