Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Cai <jimmehcai@gmail.com>2020-12-20 14:34:44 +0300
committerGitHub <noreply@github.com>2020-12-20 14:34:44 +0300
commitcea1064927d5b00f5b53a4a105b341c12ad0801f (patch)
tree7f8835e455495870622d647ee17d988d373a4420
parentddd6aa2d207890e2cef6808522b181d29b1ddc56 (diff)
feat(footer): add copyright since & custom text (#74)
closes https://github.com/CaiJimmy/hugo-theme-stack/issues/55
-rw-r--r--exampleSite/config.yaml4
-rw-r--r--layouts/index.html2
-rw-r--r--layouts/partials/footer/footer.html13
3 files changed, 17 insertions, 2 deletions
diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml
index 64706d0..20dcda6 100644
--- a/exampleSite/config.yaml
+++ b/exampleSite/config.yaml
@@ -22,6 +22,10 @@ params:
rssFullContent: true
favicon:
+ footer:
+ since: 2020
+ customText:
+
dateFormat:
published: Jan 02, 2006
lastUpdated: Jan 02, 2006 15:04 MST
diff --git a/layouts/index.html b/layouts/index.html
index b04b926..576faef 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -11,7 +11,7 @@
</section>
{{- partial "pagination.html" . -}}
- {{ partialCached "footer/footer" . }}
+ {{- partial "footer/footer" . -}}
{{ end }}
{{ define "right-sidebar" }}
diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html
index 2443f4c..4155255 100644
--- a/layouts/partials/footer/footer.html
+++ b/layouts/partials/footer/footer.html
@@ -1,7 +1,18 @@
{{- $ThemeVersion := "1.1.0" -}}
<footer class="site-footer">
- <section class="copyright">&copy; {{ now.Format "2006" }} {{ .Site.Title }}</section>
+ <section class="copyright">
+ &copy;
+ {{ if and (.Site.Params.footer.since) (ne .Site.Params.footer.since (int (now.Format "2006"))) }}
+ {{ .Site.Params.footer.since }} -
+ {{ end }}
+ {{ now.Format "2006" }} {{ .Site.Title }}
+ </section>
+
<section class="powerby">
+ {{ with .Site.Params.footer.customText }}
+ {{ . | safeHTML }} <br/>
+ {{ end }}
+
{{- $Generator := `<a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo</a>` -}}
{{- $Theme := printf `<b><a href="https://github.com/CaiJimmy/hugo-theme-stack" target="_blank" rel="noopener" data-version="%s">Stack</a></b>` $ThemeVersion -}}
{{- $DesignedBy := `<a href="https://jimmycai.com" target="_blank" rel="noopener">Jimmy</a>` -}}