- commit
- 67b21be
- parent
- 9b1e71e
- author
- Eric Bower
- date
- 2023-08-17 20:14:55 +0000 UTC
refactor: better page titles
9 files changed,
+26,
-9
M
Makefile
+4,
-0
1@@ -13,6 +13,10 @@ img:
2 docker build -t neurosnap/pgit:latest .
3 .PHONY: img
4
5+fmt:
6+ go fmt ./...
7+.PHONY: fmt
8+
9 static: build clean
10 ./pgit \
11 --out ./public \
+2,
-1
1@@ -8,8 +8,9 @@
2
3 <meta name="keywords" content="git code forge repo repository" />
4
5+ {{template "meta" .}}
6+
7 <link rel="stylesheet" href="/main.css" />
8- <link rel="stylesheet" href="/syntax.css" />
9 </head>
10 <body>
11 <header>{{template "header" .}}</header>
+4,
-1
1@@ -1,5 +1,8 @@
2 {{template "base" .}}
3-{{define "title"}}commit log{{end}}
4+{{define "title"}}{{.Commit.Summary}} - {{.Repo.RepoName}}@{{.CommitID}}{{end}}
5+{{define "meta"}}
6+<link rel="stylesheet" href="/syntax.css" />
7+{{end}}
8
9 {{define "content"}}
10 <dl>
+4,
-1
1@@ -1,5 +1,8 @@
2 {{template "base" .}}
3-{{define "title"}}file{{end}}
4+{{define "title"}}{{.Path}}@{{.RevData.Name}}{{end}}
5+{{define "meta"}}
6+<link rel="stylesheet" href="/syntax.css" />
7+{{end}}
8
9 {{define "content"}}
10 <h2 class="text-lg">{{.Path}}</h2>
+2,
-2
1@@ -11,8 +11,8 @@
2 <a href="{{.SiteURLs.SummaryURL}}">summary</a> |
3 <a href="{{.SiteURLs.RefsURL}}">refs</a> |
4 <span class="font-bold">{{.RevData.Name}}</span> |
5- <a href="{{.RevData.TreeURL}}">tree</a> |
6- <a href="{{.RevData.LogURL}}">log</a>
7+ <a href="{{.RevData.TreeURL}}">code</a> |
8+ <a href="{{.RevData.LogURL}}">commits</a>
9 </nav>
10
11 <div class="mt-lg">
+2,
-1
1@@ -1,6 +1,7 @@
2 {{template "base" .}}
3
4-{{define "title"}}log{{end}}
5+{{define "title"}}commits - {{.Repo.RepoName}}@{{.RevData.Name}}{{end}}
6+{{define "meta"}}{{end}}
7
8 {{define "content"}}
9 <div>
+2,
-1
1@@ -1,6 +1,7 @@
2 {{template "base" .}}
3
4-{{define "title"}}refs{{end}}
5+{{define "title"}}refs - {{.Repo.RepoName}}{{end}}
6+{{define "meta"}}{{end}}
7
8 {{define "content"}}
9 <h2 class="text-lg font-bold">refs</h2>
+4,
-1
1@@ -1,6 +1,9 @@
2 {{template "base" .}}
3
4-{{define "title"}}summary{{end}}
5+{{define "title"}}{{.Repo.RepoName}}{{end}}
6+{{define "meta"}}
7+<link rel="stylesheet" href="/syntax.css" />
8+{{end}}
9
10 {{define "content"}}
11 {{.Readme}}
+2,
-1
1@@ -1,6 +1,7 @@
2 {{template "base" .}}
3
4-{{define "title"}}tree{{end}}
5+{{define "title"}}files - {{.Repo.RepoName}}@{{.RevData.Name}}{{end}}
6+{{define "meta"}}{{end}}
7
8 {{define "content"}}
9 <div>