fix title tag and tree .. link

This commit is contained in:
Iris Lightshard 2023-02-09 23:30:07 -07:00
parent ad6ece2ad2
commit 1f7d760e41
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
8 changed files with 22 additions and 28 deletions

View file

@ -187,6 +187,7 @@ func (d *deps) RepoTree(w http.ResponseWriter, r *http.Request) {
data["ref"] = ref data["ref"] = ref
data["parent"] = treePath data["parent"] = treePath
data["desc"] = getDescription(path) data["desc"] = getDescription(path)
data["dotdot"] = filepath.Dir(treePath)
d.listFiles(files, data, w) d.listFiles(files, data, w)
return return
@ -249,7 +250,7 @@ func (d *deps) Log(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["dotdot"] = filepath.Dir(path) data["log"] = true
if err := d.t.ExecuteTemplate(w, "log", data); err != nil { if err := d.t.ExecuteTemplate(w, "log", data); err != nil {
log.Println(err) log.Println(err)

View file

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

View file

@ -5,6 +5,26 @@
<link rel="stylesheet" href="/static/style.css" type="text/css"> <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="stylesheet" href="https://cdn.icyphox.sh/fonts/inter.css" type="text/css">
<link rel="icon" type="image/png" size="32x32" href="/static/legit.png"> <link rel="icon" type="image/png" size="32x32" href="/static/legit.png">
{{ if .parent }}
<title>{{ .meta.Title }} &mdash; {{ .name }} ({{ .ref }}): {{ .parent }}/</title>
{{ else if .path }}
<title>{{ .meta.Title }} &mdash; {{ .name }} ({{ .ref }}): {{ .path }}</title>
{{ else if .files }}
<title>{{ .meta.Title }} &mdash; {{ .name }} ({{ .ref }})</title>
{{ else if .commit }}
<title>{{ .meta.Title }} &mdash; {{ .name }}: {{ .commit.This }}</title>
{{ else if .branches }}
<title>{{ .meta.Title }} &mdash; {{ .name }}: refs</title>
{{ else if .commits }}
{{ if .log }}
<title>{{ .meta.Title }} &mdash; {{ .name }}: log</title>
{{ else }}
<title>{{ .meta.Title }} &mdash; {{ .name }}</title>
{{ end }}
{{ else }}
<title>{{ .meta.Title }}</title>
{{ end }}
{{ if and .servername .gomod }} {{ if and .servername .gomod }}
<meta name="go-import" content="{{ .servername}}/{{ .name }} git https://{{ .servername }}/{{ .name }}"> <meta name="go-import" content="{{ .servername}}/{{ .name }} git https://{{ .servername }}/{{ .name }}">
{{ end }} {{ end }}

View file

@ -1,12 +1,6 @@
{{ define "index" }} {{ define "index" }}
<html> <html>
{{ template "head" . }} {{ template "head" . }}
<title>
{{ .meta.Title }}
</title>
<body> <body>
<header> <header>
<h1>{{ .meta.Title }}</h1> <h1>{{ .meta.Title }}</h1>

View file

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

View file

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

View file

@ -1,10 +1,5 @@
{{ define "repo" }} {{ define "repo" }}
<html> <html>
<title>{{ .name }}
{{ if .parent }}
&mdash; {{ .parent }}
{{ end }}
</title>
{{ template "head" . }} {{ template "head" . }}
<body> <body>
{{ template "repoheader" . }} {{ template "repoheader" . }}

View file

@ -1,10 +1,5 @@
{{ define "tree" }} {{ define "tree" }}
<html> <html>
<title>{{ .name }}
{{ if .parent }}
&mdash; {{ .parent }}
{{ end }}
</title>
{{ template "head" . }} {{ template "head" . }}
<body> <body>
{{ template "repoheader" . }} {{ template "repoheader" . }}