git-preview @ main

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

routes: serve static content from /static
Sat, 17 Dec 2022
5 files changed, 24 insertions(+), 13 deletions(-)
M config.yaml

@@ -8,8 +8,9 @@ - README.md

mainBranch: - master - main -template: - dir: ./templates +dirs: + templates: ./templates + static: ./static meta: title: git good

… preview truncated

M config/config.go

@@ -13,9 +13,10 @@ ScanPath string `yaml:"scanPath"`

Readme []string `yaml:"readme"` MainBranch []string `yaml:"mainBranch"` } `yaml:"repo"` - Template struct { - Dir string `yaml:"dir"` - } `yaml:"template"` + Dirs struct { + Templates string `yaml:"templates"` + Static string `yaml:"static"` + } `yaml:"dirs"`

… preview truncated

M routes/handler.go

@@ -56,6 +56,7 @@ d.Write404(w)

}) mux.HandleFunc("/", d.Index, "GET") + mux.HandleFunc("/static/:file", d.ServeStatic, "GET") mux.HandleFunc("/:name", dw.Multiplex, "GET", "POST") mux.HandleFunc("/:name/tree/:ref/...", d.RepoTree, "GET") mux.HandleFunc("/:name/blob/:ref/...", d.FileContent, "GET")

… and 2 more changed files not shown in this preview