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["name"] = name
data["ref"] = ref data["ref"] = ref
data["desc"] = getDescription(path) data["desc"] = getDescription(path)
data["path"] = treePath
d.showFile(contents, data, w) d.showFile(contents, data, w)
return return

View file

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

View file

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

View file

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

View file

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