mirror of https://github.com/lxndrblz/anatole.git

Alexander Bilz
25.13.2021 a49c697da8e83618cfc0be88cc20b231ecc6e311
Merge pull request #209 from swflint/copyright-string-include-year

Include substitution of year in user-defined copyright strings
2 files modified
6 ■■■■ changed files
README.md 4 ●●●● patch | view | raw | blame | history
layouts/partials/sidebar.html 2 ●●● patch | view | raw | blame | history
README.md
@@ -87,9 +87,9 @@
Add your own favicon in `static/favicons/favicon.ico`.
### Copyright
By default, the copyright will show the authors name followed by the current year, but you can change this by configuring the `copyright` parameter.
By default, the copyright will show the authors name followed by the current year, but you can change this by configuring the `copyright` parameter.  If this method is used, the string `{{ YEAR }}` will be replaced with the current year during site generation.
```toml
copyright = "2020-2021"
copyright = "2020-{{ YEAR }}"
```
### Navigation items
layouts/partials/sidebar.html
@@ -18,6 +18,6 @@
        {{ end }}
    </ul>
    <div class="footer">
        <div class="by_farbox">&copy; {{ if isset .Site.Params "copyright" }} {{ .Site.Params.copyright | markdownify }} {{ else }} {{ .Site.Params.author }} {{ now.Format "2006"}} {{end}}</div>
        <div class="by_farbox">&copy; {{ if isset .Site.Params "copyright" }} {{ replace .Site.Params.copyright "{{ YEAR }}" (now.Format "2006") | markdownify }} {{ else }} {{ .Site.Params.author }} {{ now.Format "2006"}} {{end}}</div>
    </div>
</div>