all repos — legit-config @ 4f7973141a5423c2afd45e1d69dc3391bfaeea30

Configs for my instance of [legit](https://git.icyphox.sh/legit)

Save first config to git
Tim Izzo tim@5ika.ch
Sat, 19 Oct 2024 21:58:37 +0200
commit

4f7973141a5423c2afd45e1d69dc3391bfaeea30

A static/style.css

@@ -0,0 +1,338 @@

+:root { + --color-primary: #4f46e5; + --color-primary-light: rgba(79, 70, 229, 0.08); + --color-bg: #f1f5f9; + --text-secondary: #374151; + + --light: #f4f4f4; + --cyan: #509c93; + --light-gray: #eee; + --medium-gray: #ddd; + --gray: #6a6a6a; + --dark: #444; + --darker: #222; + + --sans-font: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; + --display-font: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", sans-serif; + --mono-font: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', 'Roboto Mono', Menlo, Consolas, monospace; +} + +@media (prefers-color-scheme: dark) { + :root { + color-scheme: dark light; + --light: #181818; + --cyan: #76c7c0; + --light-gray: #333; + --medium-gray: #444; + --gray: #aaa; + --dark: #ddd; + --darker: #f4f4f4; + } +} + +html { + background: var(--color-bg); + -webkit-text-size-adjust: none; + font-family: var(--sans-font); +} + +pre { + font-family: var(--mono-font); +} + +::selection { + background: var(--medium-gray); + opacity: 0.3; +} + +* { + box-sizing: border-box; + padding: 0; + margin: 0; +} + +body { + max-width: 60rem; + padding: 0 13px; + margin: 40px auto; +} + +main { + margin: 0 auto; + padding: 2rem 0 4rem; +} + +footer { + font-size: 1rem; + padding: 0; + line-height: 160%; +} + +main h1, h2, h3, strong { + font-family: var(--display-font); + font-weight: 500; +} + +strong { + font-weight: 500; +} + +main h1 { + font-size: 20px; + padding: 10px 0 10px 0; +} + +main h2 { + font-size: 18px; +} + +main h2, h3 { + padding: 20px 0 15px 0; +} + +nav { + padding: 0.4rem 0 1.5rem 0; +} + +nav ul { + padding: 0; + margin: 0; + list-style: none; + padding-bottom: 20px; +} + +nav ul li { + padding-right: 10px; + display: inline-block; +} + +a { + margin: 0; + padding: 0; + box-sizing: border-box; + text-decoration: none; + word-wrap: break-word; +} + +a { + color: var(--color-primary); +} + +a:hover { + text-decoration: underline; +} + +.index { + padding-top: 2rem; + display: grid; + grid-template-columns: 6em 1fr minmax(0, 8rem); + grid-row-gap: 1rem; + column-gap: 1rem; + min-width: 0; +} + +.clone-url { + padding-top: 2rem; + +} + +.clone-url pre { + color: var(--dark); + white-space: pre-wrap; +} + +.desc { + font-weight: normal; + color: var(--gray); + font-style: italic; +} + +.tree { + display: grid; + grid-template-columns: 10ch auto 1fr; + grid-row-gap: 0.5em; + grid-column-gap: 1em; + min-width: 0; +} + +.log { + display: grid; + grid-template-columns: 20rem minmax(0, 1fr); + grid-row-gap: 0.8em; + grid-column-gap: 8rem; + margin-bottom: 2em; + padding-bottom: 1em; + border-bottom: 1.5px solid var(--medium-gray); +} + +.log pre { + white-space: pre-wrap; +} + +.mode, .size { + font-family: var(--mono-font); +} +.size { + text-align: right; +} + +.readme pre { + white-space: pre-wrap; + padding: 1rem; +} + +.readme { + background: var(--light-gray); + padding: 0.5rem; +} + +.readme ul, .readme ol { + padding: revert; +} + +.readme img { + max-width: 100%; +} + +.diff { + margin: 1rem 0 1rem 0; + padding: 1rem 0 1rem 0; + border-bottom: 1.5px solid var(--medium-gray); +} + +.diff pre { + overflow: scroll; +} + +.diff-stat { + padding: 1rem 0 1rem 0; +} + +.commit-hash, .commit-email { + font-family: var(--mono-font); +} + +.commit-email:before { + content: '<'; +} + +.commit-email:after { + content: '>'; +} + +.commit { + margin-bottom: 1rem; +} + +.commit pre { + padding-bottom: 1rem; + white-space: pre-wrap; +} + +.diff-stat ul li { + list-style: none; + padding-left: 0.5em; +} + +.diff-add { + color: green; +} + +.diff-del { + color: red; +} + +.diff-noop { + color: var(--gray); +} + +.ref { + font-family: var(--display-font); + font-size: 14px; + color: var(--gray); + display: inline-block; + padding-top: 0.7em; +} + +.refs pre { + white-space: pre-wrap; + padding-bottom: 0.5rem; +} + +.refs strong { + padding-right: 1em; +} + +.line-numbers { + white-space: pre-line; + -moz-user-select: -moz-none; + -khtml-user-select: none; + -webkit-user-select: none; + -o-user-select: none; + user-select: none; + display: flex; + float: left; + flex-direction: column; + 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); + overflow-x: auto; +} + +.chroma-file-wrapper { + display: flex; + flex-direction: row; + grid-template-columns: 1rem minmax(0, 1fr); + overflow-x: auto; +} + +.file-content { + background: var(--light-gray); + overflow-y: hidden; + overflow-x: auto; +} + +.diff-type { + color: var(--gray); +} + +.commit-info { + color: var(--gray); + padding-bottom: 1.5rem; + font-size: 0.85rem; +} + +@media (max-width: 600px) { + .index { + grid-row-gap: 0.8em; + } + + .log { + grid-template-columns: 1fr; + grid-row-gap: 0em; + } + + .index { + grid-template-columns: 1fr; + grid-row-gap: 0em; + } + + .index-name:not(:first-child) { + padding-top: 1.5rem; + } + + .commit-info:not(:last-child) { + padding-bottom: 1.5rem; + } + + pre { + font-size: 0.8rem; + } +}
A templates/404.html

@@ -0,0 +1,13 @@

+{{ define "404" }} +<html> + <title>404</title> +{{ template "head" . }} + <body> + {{ template "nav" . }} + <main> + <h3>404 &mdash; nothing like that here.</h3> + </main> + </body> + +</html> +{{ end }}
A templates/500.html

@@ -0,0 +1,13 @@

+{{ define "500" }} +<html> + <title>500</title> +{{ template "head" . }} + <body> + {{ template "nav" . }} + <main> + <h3>500 &mdash; something broke!</h3> + </main> + </body> + +</html> +{{ end }}
A templates/commit.html

@@ -0,0 +1,104 @@

+{{ define "commit" }} +<html> +{{ template "head" . }} + + {{ template "repoheader" . }} + <body> + {{ template "nav" . }} + <main> + <section class="commit"> + <pre> + {{- .commit.Message -}} + </pre> + <div class="commit-info"> + {{ .commit.Author.Name }} <a href="mailto:{{ .commit.Author.Email }}" class="commit-email">{{ .commit.Author.Email}}</a> + <div>{{ .commit.Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</div> + </div> + + <div> + <strong>commit</strong> + <p><a href="/{{ .name }}/commit/{{ .commit.This }}" class="commit-hash"> + {{ .commit.This }} + </a> + </p> + </div> + + {{ if .commit.Parent }} + <div> + <strong>parent</strong> + <p><a href="/{{ .name }}/commit/{{ .commit.Parent }}" class="commit-hash"> + {{ .commit.Parent }} + </a></p> + </div> + + {{ end }} + <div class="diff-stat"> + <div> + {{ .stat.FilesChanged }} files changed, + {{ .stat.Insertions }} insertions(+), + {{ .stat.Deletions }} deletions(-) + </div> + <div> + <br> + <strong>jump to</strong> + {{ range .diff }} + <ul> + <li><a href="#{{ .Name.New }}">{{ .Name.New }}</a></li> + </ul> + {{ end }} + </div> + </div> + </section> + <section> + {{ $repo := .name }} + {{ $this := .commit.This }} + {{ $parent := .commit.Parent }} + {{ range .diff }} + <div id="{{ .Name.New }}"> + <div class="diff"> + {{ if .IsNew }} + <span class="diff-type">A</span> + {{ end }} + {{ if .IsDelete }} + <span class="diff-type">D</span> + {{ end }} + {{ if not (or .IsNew .IsDelete) }} + <span class="diff-type">M</span> + {{ end }} + {{ if .Name.Old }} + <a href="/{{ $repo }}/blob/{{ $parent }}/{{ .Name.Old }}">{{ .Name.Old }}</a> + {{ if .Name.New }} + &#8594; + <a href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}">{{ .Name.New }}</a> + {{ end }} + {{ else }} + <a href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}">{{ .Name.New }}</a> + {{- end -}} + {{ if .IsBinary }} + <p>Not showing binary file.</p> + {{ else }} + <pre> + {{- range .TextFragments -}} + <p>{{- .Header -}}</p> + {{- range .Lines -}} + {{- if eq .Op.String "+" -}} + <span class="diff-add">{{ .String }}</span> + {{- end -}} + {{- if eq .Op.String "-" -}} + <span class="diff-del">{{ .String }}</span> + {{- end -}} + {{- if eq .Op.String " " -}} + <span class="diff-noop">{{ .String }}</span> + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + </pre> + </div> + </div> + {{ end }} + </section> + </main> + </body> +</html> +{{ end }}
A templates/file.html

@@ -0,0 +1,36 @@

+{{ define "file" }} +<html> + {{ template "head" . }} + {{ template "repoheader" . }} + <body> + {{ template "nav" . }} + <main> + <p>{{ .path }} (<a style="color: gray" href="?raw=true">view raw</a>)</p> + {{if .chroma }} + <div class="chroma-file-wrapper"> + {{ .content }} + </div> + {{else}} + <div class="file-wrapper"> + <table> + <tbody><tr> + <td class="line-numbers"> + <pre> + {{- range .linecount }} + <a id="L{{ . }}" href="#L{{ . }}">{{ . }}</a> + {{- end -}} + </pre> + </td> + <td class="file-content"> + <pre> + {{- .content -}} + </pre> + </td> + </tbody></tr> + </table> + </div> + {{end}} + </main> + </body> +</html> +{{ end }}
A templates/head.html

@@ -0,0 +1,33 @@

+{{ define "head" }} +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <link rel="stylesheet" href="/static/style.css" type="text/css" /> + <link rel=icon href=https://5ika.ch/favicon.ico> {{ 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 }} + <!-- other meta tags here --> +</head> +{{ end }}
A templates/index.html

@@ -0,0 +1,25 @@

+{{ define "index" }} +<html> + {{ template "head" . }} + + <header> + <h1> + {{ .meta.Title }} @<a href="https://5ika.ch/" class="u-url">5ika.ch</a> + </h1> + <h2>{{ .meta.Description }}</h2> + </header> + <body> + <main> + <div class="index"> + {{ range .info }} + <div class="index-name"> + <a href="/{{ .Name }}">{{ .DisplayName }}</a> + </div> + <div class="desc">{{ .Desc }}</div> + <div>{{ .Idle }}</div> + {{ end }} + </div> + </main> + </body> +</html> +{{ end }}
A templates/log.html

@@ -0,0 +1,25 @@

+{{ define "log" }} +<html> +{{ template "head" . }} + + {{ template "repoheader" . }} + <body> + {{ template "nav" . }} + <main> + {{ $repo := .name }} + <div class="log"> + {{ range .commits }} + <div> + <div><a href="/{{ $repo }}/commit/{{ .Hash.String }}" class="commit-hash">{{ slice .Hash.String 0 8 }}</a></div> + <pre>{{ .Message }}</pre> + </div> + <div class="commit-info"> + {{ .Author.Name }} <a href="mailto:{{ .Author.Email }}" class="commit-email">{{ .Author.Email }}</a> + <div>{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</div> + </div> + {{ end }} + </div> + </main> + </body> +</html> +{{ end }}
A templates/nav.html

@@ -0,0 +1,14 @@

+{{ define "nav" }} + <nav> + <ul> + {{ if .name }} + <li><a href="/{{ .name }}">summary</a> + <li><a href="/{{ .name }}/refs">refs</a> + {{ if .ref }} + <li><a href="/{{ .name }}/tree/{{ .ref }}/">tree</a> + <li><a href="/{{ .name }}/log/{{ .ref }}">log</a> + {{ end }} + {{ end }} + </ul> + </nav> +{{ end }}
A templates/refs.html

@@ -0,0 +1,40 @@

+{{ define "refs" }} +<html> +{{ template "head" . }} + + {{ template "repoheader" . }} + <body> + {{ template "nav" . }} + <main> + {{ $name := .name }} + <h3>branches</h3> + <div class="refs"> + {{ range .branches }} + <div> + <strong>{{ .Name.Short }}</strong> + <a href="/{{ $name }}/tree/{{ .Name.Short }}/">browse</a> + <a href="/{{ $name }}/log/{{ .Name.Short }}">log</a> + <a href="/{{ $name }}/archive/{{ .Name.Short }}.tar.gz">tar.gz</a> + </div> + {{ end }} + </div> + {{ if .tags }} + <h3>tags</h3> + <div class="refs"> + {{ range .tags }} + <div> + <strong>{{ .Name }}</strong> + <a href="/{{ $name }}/tree/{{ .Name }}/">browse</a> + <a href="/{{ $name }}/log/{{ .Name }}">log</a> + <a href="/{{ $name }}/archive/{{ .Name }}.tar.gz">tar.gz</a> + {{ if .Message }} + <pre>{{ .Message }}</pre> + </div> + {{ end }} + {{ end }} + </div> + {{ end }} + </main> + </body> +</html> +{{ end }}
A templates/repo-header.html

@@ -0,0 +1,12 @@

+{{ define "repoheader" }} +<header> + <h2> + <a href="/">all repos</a> + &mdash; {{ .displayname }} + {{ if .ref }} + <span class="ref">@ {{ .ref }}</span> + {{ end }} + </h2> + <h3 class="desc">{{ .desc }}</h3> +</header> +{{ end }}
A templates/repo.html

@@ -0,0 +1,38 @@

+{{ define "repo" }} +<html> +{{ template "head" . }} + +{{ template "repoheader" . }} + + <body> + {{ template "nav" . }} + <main> + {{ $repo := .name }} + <div class="log"> + {{ range .commits }} + <div> + <div><a href="/{{ $repo }}/commit/{{ .Hash.String }}" class="commit-hash">{{ slice .Hash.String 0 8 }}</a></div> + <pre>{{ .Message }}</pre> + </div> + <div class="commit-info"> + {{ .Author.Name }} <a href="mailto:{{ .Author.Email }}" class="commit-email">{{ .Author.Email }}</a> + <div>{{ .Author.When.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</div> + </div> + {{ end }} + </div> +{{- if .readme }} + <article class="readme"> + {{- .readme -}} + </article> +{{- end -}} + + <div class="clone-url"> + <strong>clone</strong> + <pre> +git clone https://{{ .servername }}/{{ .name }} + </pre> + </div> + </main> + </body> +</html> +{{ end }}
A templates/tree.html

@@ -0,0 +1,55 @@

+{{ define "tree" }} +<html> + +{{ template "head" . }} + + {{ template "repoheader" . }} + <body> + {{ template "nav" . }} + <main> + {{ $repo := .name }} + {{ $ref := .ref }} + {{ $parent := .parent }} + + <div class="tree"> + {{ if $parent }} + <div></div> + <div></div> + <div><a href="/{{ $repo }}/tree/{{ $ref }}/{{ .dotdot }}">..</a></div> + {{ end }} + {{ range .files }} + {{ if not .IsFile }} + <div class="mode">{{ .Mode }}</div> + <div class="size">{{ .Size }}</div> + <div> + {{ if $parent }} + <a href="/{{ $repo }}/tree/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a> + {{ else }} + <a href="/{{ $repo }}/tree/{{ $ref }}/{{ .Name }}">{{ .Name }}/</a> + {{ end }} + </div> + {{ end }} + {{ end }} + {{ range .files }} + {{ if .IsFile }} + <div class="mode">{{ .Mode }}</div> + <div class="size">{{ .Size }}</div> + <div> + {{ if $parent }} + <a href="/{{ $repo }}/blob/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}</a> + {{ else }} + <a href="/{{ $repo }}/blob/{{ $ref }}/{{ .Name }}">{{ .Name }}</a> + {{ end }} + </div> + {{ end }} + {{ end }} + </div> + <article> + <pre> + {{- if .readme }}{{ .readme }}{{- end -}} + </pre> + </article> + </main> + </body> +</html> +{{ end }}