|
1 | 1 | {{- $repoInfo := .RepoInfo -}}
|
2 | 2 | {{- $githubLangColors := .GithubLangColors -}}
|
3 | 3 |
|
4 |
| -<div class="gh-repo-card"> |
5 |
| - <div class="repo-card-content"> |
6 |
| - <div class="repo-name"> |
7 |
| - <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo mr-1 color-fg-muted"> |
8 |
| - <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> |
9 |
| - </svg> |
10 |
| - <a href="{{ $repoInfo.html_url }}" class="repo-url" title="{{ $repoInfo.full_name }}" target="_blank"> |
11 |
| - <span>{{ $repoInfo.owner.login }}/</span><span>{{ $repoInfo.name }}</span> |
12 |
| - </a> |
13 |
| - {{- $visibility := cond $repoInfo.is_template (add $repoInfo.visibility " template") $repoInfo.visibility -}} |
14 |
| - {{- $visibility = cond $repoInfo.archived (add $repoInfo.visibility " archived") $visibility -}} |
15 |
| - <span class="repo-visibility" data-archived="{{ $repoInfo.archived }}">{{ strings.FirstUpper $visibility }}</span> |
16 |
| - </div> |
17 |
| - {{- with $repoInfo.parent -}} |
18 |
| - <p class="repo-fork-from">Fork from <a href="{{ .html_url }}" target="_blank">{{ .full_name }}</a></p> |
19 |
| - {{- end -}} |
20 |
| - <p class="repo-desc">{{ $repoInfo.description }}</p> |
21 |
| - <p class="repo-statistics"> |
22 |
| - {{- with $repoInfo.language -}} |
23 |
| - <span class="repo-lang"> |
24 |
| - <span class="repo-lang-color" style="background-color: {{ (index $githubLangColors $repoInfo.language).color }};"></span> |
25 |
| - <span itemprop="programmingLanguage">{{ $repoInfo.language }}</span> |
26 |
| - </span> |
27 |
| - {{- end -}} |
28 |
| - {{- with $repoInfo.stargazers_count -}} |
29 |
| - <a href="{{ add $repoInfo.html_url `/stargazers` }}" title="{{ . }} stars" class="repo-stars" target="_blank"> |
30 |
| - <svg aria-label="stars" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star"> |
31 |
| - <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> |
32 |
| - </svg> |
33 |
| - {{- partial "function/format-number" (dict "NUMBER" .) -}} |
| 4 | +{{- if $repoInfo | and $githubLangColors -}} |
| 5 | + <div class="gh-repo-card"> |
| 6 | + <div class="repo-card-content"> |
| 7 | + <div class="repo-name"> |
| 8 | + <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo mr-1 color-fg-muted"> |
| 9 | + <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> |
| 10 | + </svg> |
| 11 | + <a href="{{ $repoInfo.html_url }}" class="repo-url" title="{{ $repoInfo.full_name }}" target="_blank"> |
| 12 | + <span>{{ $repoInfo.owner.login }}/</span><span>{{ $repoInfo.name }}</span> |
34 | 13 | </a>
|
| 14 | + {{- $visibility := cond $repoInfo.is_template (add $repoInfo.visibility " template") $repoInfo.visibility -}} |
| 15 | + {{- $visibility = cond $repoInfo.archived (add $repoInfo.visibility " archived") $visibility -}} |
| 16 | + <span class="repo-visibility" data-archived="{{ $repoInfo.archived }}">{{ strings.FirstUpper $visibility }}</span> |
| 17 | + </div> |
| 18 | + {{- with $repoInfo.parent -}} |
| 19 | + <p class="repo-fork-from">Fork from <a href="{{ .html_url }}" target="_blank">{{ .full_name }}</a></p> |
35 | 20 | {{- end -}}
|
36 |
| - {{- with $repoInfo.forks_count -}} |
37 |
| - <a href="{{ add $repoInfo.html_url `/forks` }}" title="{{ . }} forks" class="repo-forks" target="_blank"> |
38 |
| - <svg aria-label="forks" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked"> |
39 |
| - <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> |
40 |
| - </svg> |
41 |
| - {{- partial "function/format-number" (dict "NUMBER" .) -}} |
42 |
| - </a> |
43 |
| - {{- end -}} |
44 |
| - </p> |
| 21 | + <p class="repo-desc">{{ $repoInfo.description }}</p> |
| 22 | + <p class="repo-statistics"> |
| 23 | + {{- with $repoInfo.language -}} |
| 24 | + <span class="repo-lang"> |
| 25 | + <span class="repo-lang-color" style="background-color: {{ (index $githubLangColors $repoInfo.language).color }};"></span> |
| 26 | + <span itemprop="programmingLanguage">{{ $repoInfo.language }}</span> |
| 27 | + </span> |
| 28 | + {{- end -}} |
| 29 | + {{- with $repoInfo.stargazers_count -}} |
| 30 | + <a href="{{ add $repoInfo.html_url `/stargazers` }}" title="{{ . }} stars" class="repo-stars" target="_blank"> |
| 31 | + <svg aria-label="stars" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star"> |
| 32 | + <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> |
| 33 | + </svg> |
| 34 | + {{- partial "function/format-number" (dict "NUMBER" .) -}} |
| 35 | + </a> |
| 36 | + {{- end -}} |
| 37 | + {{- with $repoInfo.forks_count -}} |
| 38 | + <a href="{{ add $repoInfo.html_url `/forks` }}" title="{{ . }} forks" class="repo-forks" target="_blank"> |
| 39 | + <svg aria-label="forks" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked"> |
| 40 | + <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> |
| 41 | + </svg> |
| 42 | + {{- partial "function/format-number" (dict "NUMBER" .) -}} |
| 43 | + </a> |
| 44 | + {{- end -}} |
| 45 | + </p> |
| 46 | + </div> |
45 | 47 | </div>
|
46 |
| -</div> |
47 |
| -{{- /* EOF */ -}} |
| 48 | +{{- else -}} |
| 49 | + {{- erroridf "error-get-gh-repo" (printf "[component-projects]: %v" (T "projects.errorGetGhRepo")) -}} |
| 50 | +{{- end -}} |
0 commit comments