Files
Arya Kiran b42c480606 prettier
2023-07-23 12:11:22 +05:30

89 lines
2.6 KiB
HTML

{{ template "header" .}}
<main>
{{ if .repo }} {{ range $key, $value := .repo}}
<div class="button-parent">
<a href="/{{.Fullname}}/archive/{{.DefaultBranch}}.zip" class="button"
>Download (zip)</a
>
<a rel="noreferrer" href="https://github.com/{{.Fullname}}" class="button"
>View on GitHub</a
>
</div>
<div class="user-profile">
<h1>{{.Fullname}}</h1>
{{ if .Parent }}
<p>This repository is a fork of <a href="/{{.Parent}}">{{.Parent}}</a>.</p>
{{ end }} {{ if .Description }}
<p>{{.Description}}</p>
{{ end }} {{ if .Link }} <a href="{{.Link}}">{{.Link}}</a> {{end}} {{ if
.Tags }}
<p>Tags: {{range .Tags}} {{.}} {{end}}</p>
{{end}} {{ if .License }}
<p>
⭐ {{.Stars}} 🍴 {{.Forks}} 👀 {{.Watchers}} ⚖️ {{.License}} 🌿
{{.DefaultBranch}}
</p>
{{ else }}
<p>
⭐ {{.Stars}} 🍴 {{.Forks}} 👀 {{.Watchers}} ⚖️ No license 🌿
{{.DefaultBranch}}
</p>
<p><a href="/{{.Fullname}}/wiki">Wiki</a></p>
{{ end }} {{ if .Language }} {{range $o := .Language}}{{$o.Name}}
{{$o.Percent}}, {{end}}
<div class="lang-bar">
{{range $i, $o := .Language}}
<span style="width: {{$o.Percent}}; background-color: {{$o.Color}}">
&nbsp;
</span>
{{end}}
</div>
{{end}} {{ if or .CommitsAhead .CommitsBehind }}
<p>
This repository is {{if .CommitsBehind}} {{.CommitsBehind}} commits behind
{{end}} {{if and .CommitsBehind .CommitsAhead}} and {{end}} {{if
.CommitsAhead}} {{ .CommitsAhead }} commits ahead of {{end}} its parent.
</p>
{{end}}
</div>
{{end}} {{ if .files}}
<div class="user-readme">
<h3>Files</h3>
<div class="user-readme-text">
<ul class="file-u-list">
{{ range $key, $value := .files}} {{ if eq .Type "dir" }}
<li class="file-list">
📁
<a
href="/{{.Fullname}}/tree/{{.DefaultBranch}}/{{.Path}}"
class="filesA"
>{{.Path}}</a
>
</li>
{{ else }}
<li class="file-list">
🗒️
<a href="/{{.Fullname}}/blob/{{.DefaultBranch}}/{{.Path}}"
>{{.Path}}</a
>
</li>
{{ end }} {{ end }}
</ul>
</div>
</div>
{{ end }} {{ if .readme}}
<div class="user-readme">
{{ if .repo }} {{ range $key, $value := .repo}}
<h3>{{.Readme}}</h3>
{{end}} {{end}}
<div class="user-readme-text">{{ unescape .readme}}</div>
</div>
{{ end }} {{ else }}
<h2>Repository not found</h2>
<p>That repository doesn't exist.</p>
{{ end }}
</main>
{{ template "footer" .}}