git-preview @ main

static git web frontend but with images and html previews + code truncation

template: line numbers for file view
Tue, 13 Dec 2022
4 files changed, 41 insertions(+), 1 deletions(-)
M routes/template.go

@@ -1,10 +1,13 @@

package routes import ( + "bytes" "html/template" + "io" "log" "net/http" "path/filepath" + "strings"

… preview truncated

M templates/file.html

@@ -9,6 +9,11 @@ </header>

<body> {{ template "nav" . }} <main> + <pre> +{{ range .linecount }} +<a id="#L{{ . }}" href="#{{ . }}">{{ . }}</a> +{{- end -}} + </pre> <pre> {{ .content }}

… preview truncated

M templates/head.html

@@ -2,6 +2,7 @@ {{ 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"> <!-- other meta tags here --> </head> {{ end }}

… and 1 more changed files not shown in this preview