git-preview @ main

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

routes: index view
Mon, 12 Dec 2022
7 files changed, 86 insertions(+), 11 deletions(-)
M config.yaml

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

git: - scanPath: /home/icy/code/tmp + scanPath: /home/icy/code/tmp/testrepos readme: - readme - README
M git/git.go

@@ -52,6 +52,14 @@

return commits, nil } +func (g *GitRepo) LastCommit() (*object.Commit, error) { + c, err := g.r.CommitObject(g.h) + if err != nil { + return nil, fmt.Errorf("last commit: %w", err) + } + return c, nil +}

… preview truncated

M routes/routes.go

@@ -4,7 +4,9 @@ import (

"html/template" "log" "net/http" + "os" "path/filepath" + "time" "github.com/alexedwards/flow" "icyphox.sh/legit/config"

@@ -16,14 +18,50 @@ c *config.Config

}

… preview truncated

… and 4 more changed files not shown in this preview