From 503b7b134f31333ddbb33eec4ca84b9f3c569ba8 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Tue, 5 Nov 2024 15:28:59 +0100 Subject: [PATCH] Update hermit-v2. Add git-info shortcode. --- layouts/shortcodes/git-info.html | 12 ++++++++++++ themes/hermit-v2 | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 layouts/shortcodes/git-info.html diff --git a/layouts/shortcodes/git-info.html b/layouts/shortcodes/git-info.html new file mode 100644 index 0000000..b4e4dbd --- /dev/null +++ b/layouts/shortcodes/git-info.html @@ -0,0 +1,12 @@ +

+ {{ partial "svg.html" (dict "context" . "name" "posts_single_date") }} {{ dateFormat .Site.Params.dateformNumTime .Page.Date.Local }} + {{ if and (not (eq .Page.Params.ShowLastmod nil)) (.Page.Params.ShowLastmod) }} + {{ if and .GitInfo .Site.Params.gitUrl }} + [{{ partial "svg.html" (dict "context" . "name" "posts_single_git_commit") }}{{ .Page.GitInfo.AbbreviatedHash -}} @ {{ dateFormat .Site.Params.dateformNum .Page.GitInfo.AuthorDate.Local }}] + {{ else if not (eq .Page.Lastmod .Page.Date ) }} +  [{{.Site.Params.initialPublish | default "Initial Published on : "}} {{ dateFormat .Site.Params.dateformNumTime .Page.Lastmod.Local }}] + {{ else }} + {{ errorf "Lastmod is not found in Page Frontmatter or Lastmod is same as Date" }} + {{ end }} + {{ end }} +

\ No newline at end of file diff --git a/themes/hermit-v2 b/themes/hermit-v2 index 5a04168..a01afdd 160000 --- a/themes/hermit-v2 +++ b/themes/hermit-v2 @@ -1 +1 @@ -Subproject commit 5a041686f7848416c66d89a6d101e373a6d5de14 +Subproject commit a01afdd69a7dfc2cd5c2813e2b324046f68effe6