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

github.com/rhazdon/hugo-theme-hello-friend-ng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDjordje Atlialp <djordje@atlialp.com>2021-04-29 11:24:27 +0300
committerGitHub <noreply@github.com>2021-04-29 11:24:27 +0300
commit0070fb5fcda737d9b44019970186744d322f351a (patch)
treece091308766ece860b88408ecbd7678a793815e4
parentc65d56dc7e18a47467375b24e7bfc8edab970602 (diff)
parentaa17a7f93313e7d6bfe77f1d92f9ee8cab392af0 (diff)
Merge pull request #264 from Reijnn/footer-fix
Improve footer
-rw-r--r--exampleSite/config.toml11
-rw-r--r--layouts/partials/footer.html18
2 files changed, 20 insertions, 9 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index b7ac286..23bc26c 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -103,8 +103,15 @@ disableHugoGeneratorInject = false
# Custom footer
# If you want, you can easily override the default footer with your own content.
#
- # footerLeft = "Powered by <a href=\"http://gohugo.io\">Hugo</a>"
- # footerRight = "Made with &#10084; by <a href=\"https://github.com/rhazdon\">Djordje Atlialp</a>"
+ [params.footer]
+ trademark = true
+ rss = true
+ copyright = true
+ author = true
+
+ topText = []
+ bottomText = ["Powered by <a href=\"http://gohugo.io\">Hugo</a>",
+ "Made with &#10084; by <a href=\"https://github.com/rhazdon\">Djordje Atlialp</a>"]
# Colors for favicons
#
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 857104b..41b83cb 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,16 +1,20 @@
<footer class="footer">
+ {{if or (.Site.Params.footer.trademark) (.Site.Params.footer.author) (.Site.Params.footer.copyright) (.Site.Params.footer.rss) (.Site.Params.footer.topText) }}
<div class="footer__inner">
<div class="footer__content">
- <span>&copy; {{ now.Format "2006" }}</span>
- {{ if .Site.Author.name }}<span><a href="{{ .Site.BaseURL }}">{{ .Site.Author.name }}</a></span>{{ end }}
- {{ if .Site.Copyright }}<span>{{ .Site.Copyright| safeHTML }}</span>{{ end }}
- {{- with (not (in (.Site.Language.Get "disableKinds") "RSS")) }}<span><a href="{{ "posts/index.xml" | absLangURL }}" target="_blank" title="rss"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rss"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg></a></span>{{ end }}
+ {{ if .Site.Params.footer.trademark }}<span>&copy; {{ now.Format "2006" }}</span>{{ end }}
+ {{ if .Site.Params.footer.author }}<span><a href="{{ .Site.BaseURL }}">{{ .Site.Author.name }}</a></span>{{ end }}
+ {{ if .Site.Params.footer.copyright }}<span>{{ .Site.Copyright| safeHTML }}</span>{{ end }}
+ {{ if .Site.Params.footer.rss }}<span><a href="{{ "posts/index.xml" | absLangURL }}" target="_blank" title="rss"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rss"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg></a></span>{{ end }}
+ {{ range .Site.Params.footer.topText }}<span>{{ . | safeHTML}}</span>{{ end }}
</div>
</div>
+ {{ end }}
+ {{with .Site.Params.footer.bottomText}}
<div class="footer__inner">
<div class="footer__content">
- <span>{{ .Site.Params.footerLeft | default "Powered by <a href=\"http://gohugo.io\">Hugo</a>" | safeHTML }}</span>
- <span>{{ .Site.Params.footerRight | default "Made with &#10084; by <a href=\"https://github.com/rhazdon\">Djordje Atlialp</a>" | safeHTML }}</span>
- </div>
+ {{ range . }}<span>{{ . | safeHTML}}</span>{{ end }}
+ </div>
</div>
+ {{ end }}
</footer>