Optional footer.since for copyright time range (#5275)

Co-authored-by: iBug <git@ibugone.com>
This commit is contained in:
Pander 2025-07-11 03:48:10 +02:00 committed by GitHub
parent 30c69ad7fc
commit db81998d57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 14 additions and 1 deletions

View File

@ -6,6 +6,7 @@
- Hide page__footer-follow if there are no links nor atom feed. (#5279)
- Add HTML escaping for some titles, labels and metada that was missing. (#5276)
- Add optional `footer.since` for copyright time range. (#5275)
## [4.27.1](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.27.1)

View File

@ -159,6 +159,7 @@ footer:
- label: "Instagram"
icon: "fab fa-fw fa-instagram"
# url:
since: "2013"
# Reading Files

View File

@ -23,4 +23,4 @@
</div>
{% endif %}
<div class="page__footer-copyright">&copy; {{ site.time | date: '%Y' }} <a href="{{ site.copyright_url | default: site.url }}">{{ site.copyright | default: site.title | escape_once | strip }}</a>. {{ site.data.ui-text[site.locale].powered_by | default: "Powered by" }} <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/jekyll-themes/minimal-mistakes/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">&copy; {% assign site_time = site.time | date: '%Y' %}{% if site.footer.since and site_time != site.footer.since %}{{ site.footer.since }} - {% endif %}{{ site_time }} <a href="{{ site.copyright_url | default: site.url }}">{{ site.copyright | default: site.title | escape_once | strip }}</a>. {{ site.data.ui-text[site.locale].powered_by | default: "Powered by" }} <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/jekyll-themes/minimal-mistakes/" rel="nofollow">Minimal Mistakes</a>.</div>

View File

@ -129,6 +129,7 @@ footer:
- label: "Instagram"
icon: "fab fa-fw fa-instagram"
url: "https://instagram.com/mmistakes"
since: "2013"
# Reading Files

View File

@ -962,6 +962,15 @@ footer:
To change "Follow:" text that precedes footer links, edit the `follow_label` key in `_data/ui-text.yml`.
The copyright notice in the footer shows the year the site has been generated. This can be overridden with `time` in `_config.yml`. If `footer.since` is added and the value is not equal to the current year or the optional value of `time`, then a time range will be shown.
```yaml
footer:
since: "2013"
```
The above will result for example in `© 2013 - 2025 Minimal ...`. Note that `time` and `footer.since` also support values other than year numbers.
## Reading files
Nothing out of the ordinary here. `include` and `exclude` may be the only things you need to alter.

View File

@ -122,6 +122,7 @@ footer:
- label: "Instagram"
icon: "fab fa-fw fa-instagram"
url: "https://instagram.com/"
since: "2013"
# Reading Files