From f05cd393b1f70c2844e78ae8d803c80f9553da05 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sat, 16 Sep 2023 21:16:13 -0600 Subject: clean up a bit of template logic --- templates/ref.gmi | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'templates/ref.gmi') diff --git a/templates/ref.gmi b/templates/ref.gmi index 909690f..61296b8 100644 --- a/templates/ref.gmi +++ b/templates/ref.gmi @@ -35,15 +35,13 @@ => mailto:{{.CommitterEmail}} {{.CommitterName}} {{.CommitDate.Format "Mon Jan _2 15:04:05 MST 2006"}} -{{ if ne .Parents nil -}} -{{ with index .Parents 0 -}} ```diffstat +{{ if eq .Parents nil -}} +{{$.Repo.Diffstat $.Ctx "4b825dc642cb6eb9a060e54bf8d69288fbee4904" $.Params.ref}} +{{ else -}} +{{ with index .Parents 0 -}} {{$.Repo.Diffstat $.Ctx . $.Params.ref}} -``` {{ end -}} -{{ else -}} -```diffstat -{{$.Repo.Diffstat $.Ctx "4b825dc642cb6eb9a060e54bf8d69288fbee4904" $.Params.ref}} ``` {{ end -}} {{ end -}} -- cgit v1.2.3