templates: fix 404 and 500

This commit is contained in:
Anirudh Oppiliappan 2022-12-12 20:53:44 +05:30
parent f04137f841
commit 7d99afc5cd
No known key found for this signature in database
GPG key ID: 8A93F96F78C5D4C4
4 changed files with 14 additions and 4 deletions

View file

@ -1,7 +1,9 @@
{{ define "404" }}
<html>
<title>404</title>
{{ template "header" . }}
{{ template "head" . }}
<body>
404 &mdash; nothing like that here
</body>
</html>
{{ end }}

View file

@ -1,3 +1,4 @@
{{ define "500" }}
<html>
<title>500</title>
{{ template "header" . }}
@ -5,3 +6,4 @@
500 &mdash; something broke!
</body>
</html>
{{ end }}

View file

@ -1,9 +1,10 @@
{{ define "nav" }}
<nav>
<ul>
<li>some
<li>thing
<li>here
<li><a href="/">all repos</a>
<li><a href="/{{ .name }}">{{ .name }}</a>
<li><a href="/{{ .name }}/tree/{{ .ref }}/">tree</a>
<li><a href="/{{ .name }}/log/{{ .ref }}">log</a>
</ul>
</nav>
{{ end }}

View file

@ -44,6 +44,11 @@
{{ end }}
{{ end }}
</table>
<article>
<pre>
{{- if .readme }}{{ .readme }}{{- end -}}
</pre>
</article>
</main>
</body>
</html>