diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/file.html | 22 | ||||
-rw-r--r-- | templates/head.html | 20 | ||||
-rw-r--r-- | templates/index.html | 4 | ||||
-rw-r--r-- | templates/log.html | 4 | ||||
-rw-r--r-- | templates/refs.html | 4 | ||||
-rw-r--r-- | templates/repo.html | 5 | ||||
-rw-r--r-- | templates/tree.html | 6 |
7 files changed, 29 insertions, 36 deletions
diff --git a/templates/file.html b/templates/file.html index 82a3384..8898786 100644 --- a/templates/file.html +++ b/templates/file.html @@ -1,29 +1,23 @@ {{ define "file" }} <html> {{ template "head" . }} - <title>{{.name }} — {{ .path }}</title> - {{ template "repoheader" . }} <body> {{ template "nav" . }} <main> <p>{{ .path }}</p> - <table class="file-wrapper"> - <tbody><tr> - <td class="line-numbers"> - <pre> - {{- range .linecount }} + <div class="file-wrapper"> + <div class="line-numbers"> + {{- range .linecount }} <a id="L{{ . }}" href="#L{{ . }}">{{ . }}</a> - {{- end -}} - </pre> - </td> - <td class="file-content"> + {{- end -}} + </div> + <div class="file-content"> + <span></span> <pre> {{- .content -}} </pre> - </td> - </tbody></tr> - </table> + </div> </main> </body> </html> diff --git a/templates/head.html b/templates/head.html index 53487eb..08c572e 100644 --- a/templates/head.html +++ b/templates/head.html @@ -5,6 +5,26 @@ <link rel="stylesheet" href="/static/style.css" type="text/css"> <link rel="stylesheet" href="https://cdn.icyphox.sh/fonts/inter.css" type="text/css"> <link rel="icon" type="image/png" size="32x32" href="/static/legit.png"> + {{ if .parent }} + <title>{{ .meta.Title }} — {{ .name }} ({{ .ref }}): {{ .parent }}/</title> + + {{ else if .path }} + <title>{{ .meta.Title }} — {{ .name }} ({{ .ref }}): {{ .path }}</title> + {{ else if .files }} + <title>{{ .meta.Title }} — {{ .name }} ({{ .ref }})</title> + {{ else if .commit }} + <title>{{ .meta.Title }} — {{ .name }}: {{ .commit.This }}</title> + {{ else if .branches }} + <title>{{ .meta.Title }} — {{ .name }}: refs</title> + {{ else if .commits }} + {{ if .log }} + <title>{{ .meta.Title }} — {{ .name }}: log</title> + {{ else }} + <title>{{ .meta.Title }} — {{ .name }}</title> + {{ end }} + {{ else }} + <title>{{ .meta.Title }}</title> + {{ end }} {{ if and .servername .gomod }} <meta name="go-import" content="{{ .servername}}/{{ .name }} git https://{{ .servername }}/{{ .name }}"> {{ end }} diff --git a/templates/index.html b/templates/index.html index 8bff3d7..80c9e1d 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,10 +2,6 @@ <html> {{ template "head" . }} - <title> - {{ .meta.Title }} - </title> - <header> <h1>{{ .meta.Title }}</h1> <h2>{{ .meta.Description }}</h2> diff --git a/templates/log.html b/templates/log.html index 1ab6cbc..7d74cb3 100644 --- a/templates/log.html +++ b/templates/log.html @@ -2,10 +2,6 @@ <html> {{ template "head" . }} - <title> - {{ .name }} — log - </title> - {{ template "repoheader" . }} <body> {{ template "nav" . }} diff --git a/templates/refs.html b/templates/refs.html index 8480856..76add7d 100644 --- a/templates/refs.html +++ b/templates/refs.html @@ -2,10 +2,6 @@ <html> {{ template "head" . }} - <title> - {{ .name }} — refs - </title> - {{ template "repoheader" . }} <body> {{ template "nav" . }} diff --git a/templates/repo.html b/templates/repo.html index 1c700b5..1cd9b5c 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -1,10 +1,5 @@ {{ define "repo" }} <html> - <title>{{ .name }} - {{ if .parent }} - — {{ .parent }} - {{ end }} - </title> {{ template "head" . }} {{ template "repoheader" . }} diff --git a/templates/tree.html b/templates/tree.html index 496dceb..c4b7e4f 100644 --- a/templates/tree.html +++ b/templates/tree.html @@ -1,10 +1,6 @@ {{ define "tree" }} <html> - <title>{{ .name }} - {{ if .parent }} - — {{ .parent }} - {{ end }} - </title> + {{ template "head" . }} {{ template "repoheader" . }} |