all repos — legit @ 1574bbecb5b2856b2018d064a32d2e7f484a58b1

web frontend for git, written in go

cleaner titles

by nilix
Anirudh Oppiliappan x@icyphox.sh
Sat, 18 Feb 2023 14:16:43 +0530
commit

1574bbecb5b2856b2018d064a32d2e7f484a58b1

parent

d5a33e9150da61d95ad3ae06f6754a6dd101124a

M routes/routes.goroutes/routes.go

@@ -190,6 +190,7 @@ data["name"] = name

data["ref"] = ref data["parent"] = treePath data["desc"] = getDescription(path) + data["dotdot"] = filepath.Dir(treePath) d.listFiles(files, data, w) return

@@ -254,7 +255,7 @@ data["meta"] = d.c.Meta

data["name"] = name data["ref"] = ref data["desc"] = getDescription(path) - data["dotdot"] = filepath.Dir(path) + data["log"] = true if err := t.ExecuteTemplate(w, "log", data); err != nil { log.Println(err)
M static/style.cssstatic/style.css

@@ -252,17 +252,18 @@ margin-right: 1ch;

} .file-wrapper { + display: flex; + flex-direction: row; + grid-template-columns: 1rem minmax(0, 1fr); + gap: 1rem; + padding: 0.5rem; background: var(--light-gray); - display: table; - padding: 0.5rem - width: 100%; } .file-content { background: var(--light-gray); overflow-y: hidden; overflow-x: auto; - display: block; } .diff-type {
M templates/file.htmltemplates/file.html

@@ -1,29 +1,23 @@

{{ define "file" }} <html> {{ template "head" . }} - <title>{{.name }} &mdash; {{ .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>
M templates/head.htmltemplates/head.html

@@ -5,6 +5,26 @@ <meta name="viewport" content="width=device-width, initial-scale=1">

<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 }} &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 }} <meta name="go-import" content="{{ .servername}}/{{ .name }} git https://{{ .servername }}/{{ .name }}"> {{ end }}
M templates/index.htmltemplates/index.html

@@ -2,10 +2,6 @@ {{ define "index" }}

<html> {{ template "head" . }} - <title> - {{ .meta.Title }} - </title> - <header> <h1>{{ .meta.Title }}</h1> <h2>{{ .meta.Description }}</h2>
M templates/log.htmltemplates/log.html

@@ -2,10 +2,6 @@ {{ define "log" }}

<html> {{ template "head" . }} - <title> - {{ .name }} &mdash; log - </title> - {{ template "repoheader" . }} <body> {{ template "nav" . }}
M templates/refs.htmltemplates/refs.html

@@ -2,10 +2,6 @@ {{ define "refs" }}

<html> {{ template "head" . }} - <title> - {{ .name }} &mdash; refs - </title> - {{ template "repoheader" . }} <body> {{ template "nav" . }}
M templates/repo.htmltemplates/repo.html

@@ -1,10 +1,5 @@

{{ define "repo" }} <html> - <title>{{ .name }} - {{ if .parent }} - &mdash; {{ .parent }} - {{ end }} - </title> {{ template "head" . }} {{ template "repoheader" . }}
M templates/tree.htmltemplates/tree.html

@@ -1,10 +1,6 @@

{{ define "tree" }} <html> - <title>{{ .name }} - {{ if .parent }} - &mdash; {{ .parent }} - {{ end }} - </title> + {{ template "head" . }} {{ template "repoheader" . }}