summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-09-17 14:00:03 -0600
committertjpcc <tjp@ctrl-c.club>2023-09-17 14:00:03 -0600
commitce0def95f3924a10b0faceb72aa5df18bf813fb1 (patch)
tree2f0300d84738343ea2fb9f13db1af1e649b41917 /templates
parentebea6fe755fb052b79cbe05b6280611337e1e5f6 (diff)
GOPHER
Diffstat (limited to 'templates')
-rw-r--r--templates/branch_list.gophermap9
-rw-r--r--templates/diff.gophertext1
-rw-r--r--templates/diffstat.gophertext1
-rw-r--r--templates/ref.gmi2
-rw-r--r--templates/ref.gophermap34
-rw-r--r--templates/repo_home.gophermap20
-rw-r--r--templates/repo_root.gophermap7
-rw-r--r--templates/tag_list.gophermap9
-rw-r--r--templates/tree.gophermap9
9 files changed, 91 insertions, 1 deletions
diff --git a/templates/branch_list.gophermap b/templates/branch_list.gophermap
new file mode 100644
index 0000000..cd238ad
--- /dev/null
+++ b/templates/branch_list.gophermap
@@ -0,0 +1,9 @@
+i{{.Repo.Name}} Branches ⌥ {{.Selector}} {{.Host}} {{.Port}}
+i{{ range .Repo.NameBytes }}-{{ end }}----------- {{.Selector}} {{.Host}} {{.Port}}
+i {{.Selector}} {{.Host}} {{.Port}}
+{{ range .Repo.Refs .Ctx -}}
+{{ if .IsBranch -}}
+1{{.ShortName}} {{combine $.Selector "refs/" .Hash}} {{$.Host}} {{$.Port}}
+{{ end -}}
+{{ end -}}
+.
diff --git a/templates/diff.gophertext b/templates/diff.gophertext
new file mode 100644
index 0000000..f2b795b
--- /dev/null
+++ b/templates/diff.gophertext
@@ -0,0 +1 @@
+{{.Repo.Diff .Ctx .Params.fromref .Params.toref}}
diff --git a/templates/diffstat.gophertext b/templates/diffstat.gophertext
new file mode 100644
index 0000000..a51e06b
--- /dev/null
+++ b/templates/diffstat.gophertext
@@ -0,0 +1 @@
+{{.Repo.Diffstat .Ctx .Params.fromref .Params.toref}}
diff --git a/templates/ref.gmi b/templates/ref.gmi
index 61296b8..07c7602 100644
--- a/templates/ref.gmi
+++ b/templates/ref.gmi
@@ -42,6 +42,6 @@
{{ with index .Parents 0 -}}
{{$.Repo.Diffstat $.Ctx . $.Params.ref}}
{{ end -}}
-```
{{ end -}}
+```
{{ end -}}
diff --git a/templates/ref.gophermap b/templates/ref.gophermap
new file mode 100644
index 0000000..3e8d6f9
--- /dev/null
+++ b/templates/ref.gophermap
@@ -0,0 +1,34 @@
+{{ with .Repo.Commit .Ctx .Params.ref -}}
+i{{.Repo.Name}} {{slice .Hash 0 8}} {{$.Selector}} {{$.Host}} {{$.Port}}
+i{{ range .Repo.NameBytes }}-{{ end }}--------- {{$.Selector}} {{$.Host}} {{$.Port}}
+i {{$.Selector}} {{$.Host}} {{$.Port}}
+i{{.ShortMessage}} {{$.Selector}} {{$.Host}} {{$.Port}}
+i {{$.Selector}} {{$.Host}} {{$.Port}}
+{{ with .RestOfMessage -}}
+{{ if ne . "" -}}
+i{{.}} {{$.Selector}} {{$.Host}} {{$.Port}}
+i {{$.Selector}} {{$.Host}} {{$.Port}}
+{{ end -}}
+{{ end -}}
+1🗂️ Repository {{combine $.Selector ".."}} {{$.Host}} {{$.Port}}
+1📄 Files {{$.Selector}}/tree {{$.Host}} {{$.Port}}
+{{ if ne .Parents nil -}}
+0🔩 Full Diff {{join $.Selector "../../diff" .ParentHash .Hash}} {{$.Host}} {{$.Port}}
+{{ else -}}
+0🔩 Full Diff {{combine $.Selector "../diff/4b825dc642cb6eb9a060e54bf8d69288fbee4904" .Hash}} {{$.Host}} {{$.Port}}
+{{ end -}}
+{{ range .Parents -}}
+1👤 Parent {{slice . 0 8}} {{combine $.Selector .}} {{$.Host}} {{$.Port}}
+{{ end -}}
+{{ range .Repo.Refs $.Ctx -}}
+{{ if .IsTag -}}
+{{ if eq $.Params.ref .Hash -}}
+1🏷️ {{.ShortName}} ../{{.Hash}} {{$.Host}} {{$.Port}}
+{{ end -}}
+{{ end -}}
+{{ end -}}
+i {{$.Selector}} {{$.Host}} {{$.Port}}
+iAuthored by {{.AuthorName}}<{{.AuthorEmail}}> on {{.AuthorDate.Format "Mon Jan _2 15:04:05 MST 2006"}} {{$.Selector}} {{$.Host}} {{$.Port}}
+iCommitted by {{.CommitterName}}<{{.CommitterEmail}}> on {{.CommitDate.Format "Mon Jan _2 15:04:05 MST 2006"}} {{$.Selector}} {{$.Host}} {{$.Port}}
+{{ end -}}
+.
diff --git a/templates/repo_home.gophermap b/templates/repo_home.gophermap
new file mode 100644
index 0000000..17f06f7
--- /dev/null
+++ b/templates/repo_home.gophermap
@@ -0,0 +1,20 @@
+i{{.Repo.Name}} {{.Selector}} {{.Host}} {{.Port}}
+i{{ range .Repo.NameBytes }}-{{ end }} {{.Selector}} {{.Host}} {{.Port}}
+i {{.Selector}} {{.Host}} {{.Port}}
+i{{.Repo.Description}} {{.Selector}} {{.Host}} {{.Port}}
+i {{.Selector}} {{.Host}} {{.Port}}
+1⌥ Branches {{.Selector}}/branches {{.Host}} {{.Port}}
+1🏷️ Tags {{.Selector}}/tags {{.Host}} {{.Port}}
+1📄 Files {{.Selector}}/refs/HEAD/tree {{.Host}} {{.Port}}
+i {{.Selector}} {{.Host}} {{.Port}}
+iLatest Commits: {{.Selector}} {{.Host}} {{.Port}}
+i {{.Selector}} {{.Host}} {{.Port}}
+{{ with .Repo.Commits .Ctx "HEAD" 5 -}}
+{{ range . -}}
+1{{.ShortMessage}} {{$.Selector}}/refs/{{.Hash}} {{$.Host}} {{$.Port}}
+{{ end -}}
+{{ if len . | eq 0 -}}
+i(no commits to show) {{$.Selector}} {{$.Host}} {{$.Port}}
+{{ end -}}
+{{ end -}}
+.
diff --git a/templates/repo_root.gophermap b/templates/repo_root.gophermap
new file mode 100644
index 0000000..1e32e76
--- /dev/null
+++ b/templates/repo_root.gophermap
@@ -0,0 +1,7 @@
+iRepositories {{.Selector}} {{.Host}} {{.Port}}
+i------------ {{.Selector}} {{.Host}} {{.Port}}
+i {{.Selector}} {{.Host}} {{.Port}}
+{{ range .Repos -}}
+1{{.}} {{.}}/ {{$.Host}} {{$.Port}}
+{{ end -}}
+.
diff --git a/templates/tag_list.gophermap b/templates/tag_list.gophermap
new file mode 100644
index 0000000..ea5ee84
--- /dev/null
+++ b/templates/tag_list.gophermap
@@ -0,0 +1,9 @@
+i{{.Repo.Name}} Tags 🏷️ {{.Selector}} {{.Host}} {{.Port}}
+i{{ range .Repo.NameBytes }}-{{ end }}-------- {{.Selector}} {{.Host}} {{.Port}}
+i {{.Selector}} {{.Host}} {{.Port}}
+{{ range .Repo.Refs .Ctx -}}
+{{ if .IsTag -}}
+1{{.ShortName}} {{combine $.Selector "refs/" .Hash}} {{$.Host}} {{$.Port}}
+{{ end -}}
+{{ end -}}
+.
diff --git a/templates/tree.gophermap b/templates/tree.gophermap
new file mode 100644
index 0000000..ed9c1e7
--- /dev/null
+++ b/templates/tree.gophermap
@@ -0,0 +1,9 @@
+{{ with .Repo.Commit .Ctx .Params.ref -}}
+i{{slice .Hash 0 8}}:{{ if ne $.Params.path "" }}{{$.Params.path}}{{ else }}/{{ end }} {{$.Selector}} {{$.Host}} {{$.Port}}
+i {{$.Selector}} {{$.Host}} {{$.Port}}
+{{ end -}}
+1{{ if ne .Params.path "" }}../{{ else }}Commit{{ end }} {{join $.Selector ".."}} {{$.Host}} {{$.Port}}
+{{ range .Repo.Tree .Ctx $.Params.ref $.Params.path -}}
+{{ if eq .Type "blob" }}0📄 {{ else }}1📂 {{ end }}{{.Path}} {{join $.Selector .Path}} {{$.Host}} {{$.Port}}
+{{ end -}}
+.