summaryrefslogtreecommitdiff
path: root/templates/tree.gmi
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-09-16 20:56:32 -0600
committertjpcc <tjp@ctrl-c.club>2023-09-16 20:56:32 -0600
commita38d04936cd859711dfb0938d5cb998ffc9ce247 (patch)
tree54d97c42cadc7a36f8148456f84ec10df5f7cf37 /templates/tree.gmi
parent90fa2795ad177b9add2fe46382576993e96ece4b (diff)
use short hashes in page titles
Diffstat (limited to 'templates/tree.gmi')
-rw-r--r--templates/tree.gmi4
1 files changed, 3 insertions, 1 deletions
diff --git a/templates/tree.gmi b/templates/tree.gmi
index 35d0d02..b686c2c 100644
--- a/templates/tree.gmi
+++ b/templates/tree.gmi
@@ -1,5 +1,7 @@
-# {{.Params.ref}}:{{ if ne .Params.path "" }}{{.Params.path}}{{ else }}/{{ end }}
+{{ with .Repo.Commit .Ctx .Params.ref -}}
+# {{slice .Hash 0 8}}:{{ if ne $.Params.path "" }}{{$.Params.path}}{{ else }}/{{ end }}
+{{ end -}}
=> ../ {{ if ne .Params.path "" }}../{{ else }}Commit{{ end }}
{{ range .Repo.Tree .Ctx .Params.ref .Params.path -}}
=> ./{{.Path}}{{if eq .Type "tree"}}/{{end}} {{if eq .Type "blob"}}📄{{else if eq .Type "tree"}}📂{{end}} {{.Path}}