git-preview @ main

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

git: add unlisted repositories

Fri, 04 Oct 2024
4 files changed, 16 insertions(+), 7 deletions(-)
M config/config.go

@@ -14,6 +14,7 @@ ScanPath string `yaml:"scanPath"`

Readme []string `yaml:"readme"` MainBranch []string `yaml:"mainBranch"` Ignore []string `yaml:"ignore,omitempty"` + Unlisted []string `yaml:"unlisted,omitempty"` } `yaml:"repo"` Dirs struct { Templates string `yaml:"templates"`
M readme

@@ -61,6 +61,7 @@ • dirs: use this to override the default templates and static assets.

• repo.readme: readme files to look for. • repo.mainBranch: main branch names to look for. • repo.ignore: repos to ignore, relative to scanPath. +• repo.unlisted: repos to hide, relative to scanPath. • server.name: used for go-import meta tags and clone URLs.
M routes/routes.go

@@ -40,11 +40,12 @@

infos := []info{} for _, dir := range dirs { - if !dir.IsDir() || d.isIgnored(dir.Name()) { + name := dir.Name() + if !dir.IsDir() || d.isIgnored(name) || d.isUnlisted(name) { continue } - path := filepath.Join(d.c.Repo.ScanPath, dir.Name())

… preview truncated

… and 1 more changed files not shown in this preview