From 9714cd7eb765157f8fff860ab4360a1b2e4323e7 Mon Sep 17 00:00:00 2001 From: "P. Ottlinger" Date: Tue, 28 Mar 2023 22:50:36 +0200 Subject: [PATCH 1/5] #126: Update config.toml to show a version info can be added By default the version info is disabled. --- exampleSite/config.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 93c2efc..15aba0d 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -11,6 +11,9 @@ theme = "hugo-scroll" # The browser tab name title = "Jane Doe - Nutrition Coach & Chef Consultant" +# In order to add version information in the page's footer set to true. +# enableGitInfo = true + # Theme-specific variables `.Site.Params.myParamName` [params] From 15cd22dc37b10bef342a8f90d0f4da8b419efaf7 Mon Sep 17 00:00:00 2001 From: "P. Ottlinger" Date: Wed, 29 Mar 2023 21:05:21 +0200 Subject: [PATCH 2/5] #126: Add more info about footer version information --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3544d7c..2c41751 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ For live demo of master branch, please visit https://zjedi.github.io/hugo-scroll As a fallback, see a screenshot which may be a bit outdated: ![Screenshot Hugo Scroll Theme](https://raw.githubusercontent.com/zjedi/hugo-scroll/master/images/tn.png) ## Installation -If you already have a hugo site on your machine, you can simply add this theme via +If you already have a Hugo site on your machine, you can simply add this theme via ``` git submodule add https://github.com/zjedi/hugo-scroll.git themes/hugo-scroll ``` @@ -24,7 +24,7 @@ For more information, read the official [Hugo setup guide][hugo-setup-guide]. If you are starting fresh, simply copy over the contents of the `exampleSite`-directory included in this theme to your source directory. That should give you a good idea about how things work, and then you can go on from there to make the site your own. -Please check out the [config.toml](https://github.com/zjedi/hugo-scroll/blob/master/exampleSite/config.toml) included on the [exampleSite](https://github.com/zjedi/hugo-scroll/tree/master/exampleSite) of this theme. +Please check out the [config.toml](https://github.com/zjedi/hugo-scroll/blob/master/exampleSite/config.toml) included in the [exampleSite](https://github.com/zjedi/hugo-scroll/tree/master/exampleSite) of this theme. You can add **a new section to the homepage** by running `hugo new homepage/my-new-content.md` (or craft the file manually) @@ -36,14 +36,16 @@ This theme includes the full set of [Fork Awesome 1.2.0 Icons][fork-awesome-icon ```markdown Look at this nice »envelope«-icon: `{{}}`. I took this from https://forkaweso.me/Fork-Awesome/icon/envelope/ :-) ``` - ### Header logo Configured in `_index.md`, see `exampleSite`: `header_logo: "images/chef-hat.png"` -### External links -You can add external link in the menu, see `external.md` in the `exampleSite`. +### Footer version information +In order to see technical version information (extracted from Hugo's [GitInfo](https://gohugo.com.cn/variables/git/)) set the following general option in your config.toml: `enableGitInfo = true` -You can also use `extlink` shortcode to create a link opening in new tab: +### External links +You can add external links in the menu, see `external.md` in the `exampleSite`. + +You can also use `extlink` shortcode to create a link opening in a new tab: ```markdown Visit as at {{}} ``` From 881c5b0194975b75b9fff2555e02a96d2e5b63e1 Mon Sep 17 00:00:00 2001 From: "P. Ottlinger" Date: Wed, 29 Mar 2023 21:18:43 +0200 Subject: [PATCH 3/5] #126: Fix link to GitInfo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c41751..f3efddb 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Look at this nice »envelope«-icon: `{{}}`. I took Configured in `_index.md`, see `exampleSite`: `header_logo: "images/chef-hat.png"` ### Footer version information -In order to see technical version information (extracted from Hugo's [GitInfo](https://gohugo.com.cn/variables/git/)) set the following general option in your config.toml: `enableGitInfo = true` +In order to see technical version information (extracted from Hugo's [GitInfo](https://gohugo.io/variables/git/))) set the following general option in your config.toml: `enableGitInfo = true` ### External links You can add external links in the menu, see `external.md` in the `exampleSite`. From 6d4b5c8df418e9c88583dd802ca4de51a844e757 Mon Sep 17 00:00:00 2001 From: "P. Ottlinger" Date: Wed, 29 Mar 2023 21:19:43 +0200 Subject: [PATCH 4/5] #126: Remove empty section from generated markup --- layouts/partials/footer.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 33f9c4a..7879bd4 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -4,13 +4,10 @@ {{ end }} -
{{ echoParam .Site.Params "hidebyline" }}
- {{ if ne .Site.Params.hidedesignbyline true }}
Hugo Scroll template
{{ end }} - From 192b6d361efb62fb570f95b2b1a8acf7a5481fc8 Mon Sep 17 00:00:00 2001 From: "P. Ottlinger" Date: Wed, 29 Mar 2023 21:21:11 +0200 Subject: [PATCH 5/5] #126: Update footer.html to contain version information Format and extract version information from GitInfo - uncommitted pages generate a bogus date. --- layouts/partials/footer.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 7879bd4..a19e393 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -9,5 +9,13 @@ Hugo Scroll template {{ end }} + + {{ if ne .Params.enableGitInfo false }} + {{- if $.GitInfo -}} +
+ version: {{ .Lastmod.Format "2006-01-02" }} | #{{ .GitInfo.AbbreviatedHash }} +
+ {{- end -}} + {{ end }}