templates: add title tags

This commit is contained in:
Anirudh Oppiliappan 2022-12-18 11:14:38 +05:30
parent 5ea7cae973
commit 7fe98772b0
No known key found for this signature in database
GPG Key ID: 8A93F96F78C5D4C4
5 changed files with 14 additions and 0 deletions

View File

@ -173,6 +173,7 @@ func (d *deps) FileContent(w http.ResponseWriter, r *http.Request) {
data["name"] = name
data["ref"] = ref
data["desc"] = getDescription(path)
data["path"] = treePath
d.showFile(contents, data, w)
return

View File

@ -1,6 +1,7 @@
{{ define "file" }}
<html>
{{ template "head" . }}
<title>{{.name }} &mdash; {{ .path }}</title>
{{ template "repoheader" . }}
<body>

View File

@ -2,6 +2,10 @@
<html>
{{ template "head" . }}
<title>
{{ .meta.Title }}
</title>
<header>
<h1>{{ .meta.Title }}</h1>
<h2>{{ .meta.Description }}</h2>

View File

@ -2,6 +2,10 @@
<html>
{{ template "head" . }}
<title>
{{ .name }} &mdash; log
</title>
{{ template "repoheader" . }}
<body>
{{ template "nav" . }}

View File

@ -2,6 +2,10 @@
<html>
{{ template "head" . }}
<title>
{{ .name }} &mdash; refs
</title>
{{ template "repoheader" . }}
<body>
{{ template "nav" . }}