Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.

Commit 1a7b618

Browse files
committed
feat: notice when repo has no branches/tags
Display a message when repo has no branches or tags yet.
1 parent c511e28 commit 1a7b618

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

tmpl/index.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,23 @@ <h3>Last Update: {{ .LastUpdate }}</h3>
66

77
<main>
88
{{ if .ShowBranches }}
9-
<h2>Branches</h2>
10-
{{ range $value := .Branches }}<a href="/branch/{{ . }}">{{ . }}<br></a>{{ end }}
9+
<h2>Branches</h2>
10+
{{ if not .Branches }}
11+
This repository has no branches yet.
12+
{{ else }}
13+
{{ range $value := .Branches }}<a href="/branch/{{ . }}">{{ . }}<br></a>{{ end }}
14+
{{ end }}
1115
{{ end }}
1216

1317
{{ if .ShowTags }}
14-
<h2>Tags</h2>
15-
{{ range $value := .Tags }}
16-
<a href="/tag/{{ .Tag }}">{{ .Tag }} {{ if $.Cfg.Display.Tags.ShowDate }}({{ .Date }}){{ end }}<br/></a>
17-
{{ end }}
18+
<h2>Tags</h2>
19+
{{ if not .Tags }}
20+
This repository has no tags yet.
21+
{{ else }}
22+
{{ range $value := .Tags }}
23+
<a href="/tag/{{ .Tag }}">{{ .Tag }} {{ if $.Cfg.Display.Tags.ShowDate }}({{ .Date }}){{ end }}<br/></a>
24+
{{ end }}
25+
{{ end }}
1826
{{ end }}
1927
</main>
2028

0 commit comments

Comments
 (0)