commit c61d98835bd35fc99be5c16051c45b2b87056a5e
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2026-06-22T10:04:41Z |
| subject | Split owner path and repo path |
commit c61d98835bd35fc99be5c16051c45b2b87056a5e
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2026-06-22T10:04:41Z
Split owner path and repo path
---
examples/tinyproxy.json | 2 +-
internal/buildinfo/buildinfo_gen.go | 4 ++--
internal/render/manifest.go | 4 ++++
internal/render/templates.go | 4 +++-
4 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/examples/tinyproxy.json b/examples/tinyproxy.json
index 5113657..cdedc35 100644
--- a/examples/tinyproxy.json
+++ b/examples/tinyproxy.json
@@ -19,7 +19,7 @@
"owner": "penguin",
"name": "tinyproxy",
"url": "https://github.com/tgckpg/tinyproxy",
- "default_branch": "main",
+ "default_branch": "master",
"description": "tinyporxy source tree"
}
]
diff --git a/internal/buildinfo/buildinfo_gen.go b/internal/buildinfo/buildinfo_gen.go
index 67a5c25..5bf6f03 100644
--- a/internal/buildinfo/buildinfo_gen.go
+++ b/internal/buildinfo/buildinfo_gen.go
@@ -2,6 +2,6 @@ package buildinfo
const (
Version = "dev"
- GitRevision = "b4a1f393e27b2bf688c26d7e367b2c19a8d93436"
- Timestamp = "20260619.073254"
+ GitRevision = "748df2db506f433b5f56a298d27f616085da27aa"
+ Timestamp = "20260622.100339"
)
diff --git a/internal/render/manifest.go b/internal/render/manifest.go
index fda517c..c702e56 100644
--- a/internal/render/manifest.go
+++ b/internal/render/manifest.go
@@ -1,6 +1,8 @@
package render
import (
+ "path"
+ "strings"
"time"
"github.com/tgckpg/flatgit/internal/config"
@@ -30,6 +32,7 @@ type ManifestRepository struct {
DefaultCommit string `json:"default_commit"`
DefaultRefSlug string `json:"default_ref_slug"`
SitePath string `json:"site_path"`
+ OwnerSitePath string `json:"owner_site_path"`
}
type ManifestHumanRoutes struct {
@@ -74,6 +77,7 @@ func NewManifest(repo config.Repo, defaultBranch string, defaultCommit string) M
DefaultCommit: defaultCommit,
DefaultRefSlug: refSlug(repo.DefaultBranch),
SitePath: repo.RepoBase(),
+ OwnerSitePath: path.Dir(strings.TrimSuffix(repo.RepoBase(), "/")),
},
Human: ManifestHumanRoutes{
Index: "./index.html",
diff --git a/internal/render/templates.go b/internal/render/templates.go
index 450f259..1c8a414 100644
--- a/internal/render/templates.go
+++ b/internal/render/templates.go
@@ -13,7 +13,9 @@ const layoutTemplate = `{{define "layout"}}<!doctype html>
</head>
<body>
<header>
-<h1><a href="{{.RepoManifest.Repository.SitePath}}">{{.RepoManifest.Repository.FullName}}</a></h1>
+<h1>
+<a href="{{.RepoManifest.Repository.OwnerSitePath}}">{{.RepoManifest.Repository.Owner}}</a>/<a href="{{.RepoManifest.Repository.SitePath}}">{{.RepoManifest.Repository.Name}}</a>
+</h1>
{{if .RepoManifest.Repository.Description}}<p class="muted">{{.RepoManifest.Repository.Description}}</p>{{end}}
<nav>
<a href="{{.RepoManifest.Repository.SitePath}}">summary</a>