diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-28 13:14:33 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-28 13:14:33 +0200 |
| commit | 512e94b28b243105e053c1090f56ac31846bc7cf (patch) | |
| tree | 4558f03558e7e1f9acb3c85194f5d8c7e02f3dc5 | |
| parent | b40abdfab128f8e5b1f42261c4e8b0cf524370c4 (diff) | |
| download | gohugo-theme-ed-512e94b28b243105e053c1090f56ac31846bc7cf.tar.gz | |
Footer text now is fully optional
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | exampleSite/config.toml | 7 | ||||
| -rw-r--r-- | exampleSite/content/poems/o-captain.md | 2 | ||||
| -rw-r--r-- | layouts/partials/footer.html | 34 |
4 files changed, 28 insertions, 18 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a19fd3a..3573a4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add fallback if main sections are not configured - Reformat default 404 page - Rework the "Latest Publications" section, add post date -- Add 404 page to robots.txt file (to prevent search engines from indexing it) +- Add 404 page to robots.txt file (to prevent search engines from indexing it) +- Footer text now is fully optional (do not show default text if it is empty) ### Fixed diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 3421458..3b82dc0 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -128,14 +128,15 @@ disableKinds = ['RSS'] [params] # Site description. Used in meta description description = 'Ed is a Hugo theme designed for textual editors based on minimal computing principles, and focused on legibility and flexibility.' - # Copyright string + # Copyright string. "{year}" will be replaced by © and the current year. copyright = 'Copyright © 2019-{year} John Doe' # Color scheme. Options: red, orange, magenta, cyan, blue, brown colorScheme = '' # Used in site header tagline = 'a Hugo theme for minimal editions' - # Custom footer text - footer = '' + # Custom footer text on left sidebar. Use HTMl if needed. + # "{year}" will be replaced by © and the current year. + footer = 'Built with <a href="https://github.com/sergeyklay/gohugo-theme-ed" target="_blank" rel="noopener noreferrer">Ed</a>. Distributed under an MIT license.' # Sections to be displayed in the main page, as well as RSS/Atom feeds mainSections = ['posts', 'dramas', 'narratives', 'poems'] # Order of post meta information diff --git a/exampleSite/content/poems/o-captain.md b/exampleSite/content/poems/o-captain.md index ccc555f..1ccef46 100644 --- a/exampleSite/content/poems/o-captain.md +++ b/exampleSite/content/poems/o-captain.md @@ -1,6 +1,6 @@ --- title: "O Captain! My Captain!" -date: 2022-02-02T23:56:58+02:00 +date: 2021-02-02T23:56:58+02:00 draft: false author: Walt Whitman editor: Alex Gil diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index fd50c5e..7525a24 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,13 +1,21 @@ -<div class="sidebar-item"> - <p> - {{- with site.Params.footer -}} - {{- $footer_text := replace . "{year}" now.Year -}} - {{- $footer_text = replace $footer_text "©" "©" }} - {{ $footer_text | safeHTML }} - {{- else }}{{- /* TODO: translate strings */ -}} - {{- with .Params.editor }}<p>Edited by {{ . }}, {{ now.Format "2006" }}.</p>{{ end }} - Built with <a href="https://github.com/sergeyklay/gohugo-theme-ed" target="_blank" rel="noopener noreferrer">Ed.</a> - Distributed under an MIT license. - {{- end }} - </p> -</div> +{{ if or site.Params.footer .Params.editor }} + <div class="sidebar-item"> + <p> + {{ with site.Params.footer }} + {{ $footerText := replace . "{year}" now.Year }} + {{ $footerText | safeHTML }} + {{ end }} + {{ with .Params.editor }} + <p> + Edited by {{ . }}, + {{ if not $.Params.Lastmod.IsZero }} + {{ $.Params.Lastmod.Format "2006" }} + {{ else }} + {{ now.Format "2006" }} + {{ end }} + . + </p> + {{ end }} + </p> + </div> +{{ end }} |
