feat: better copyright year formatting (#17)

This commit is contained in:
Peter Mikola 2024-07-01 14:33:15 +02:00 committed by GitHub
parent 6fc7951994
commit c2a7f409f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,9 @@
<footer class="mx-auto flex max-w-3xl flex-wrap items-center px-8 py-4 text-sm opacity-60"> <footer class="mx-auto flex max-w-3xl flex-wrap items-center px-8 py-4 text-sm opacity-60">
<div class="mr-auto basis-full lg:basis-1/2"> <div class="mr-auto basis-full lg:basis-1/2">
&copy; {% if config.extra.footer.since %}{{ config.extra.footer.since }} - {% endif %} {{ now() {% set current_year = now() | date(format="%Y") | int %}
| date(format="%Y") }} &copy; {% if config.extra.footer.since and config.extra.footer.since != current_year %}
{{ config.extra.footer.since }} - {{ current_year }}
{% else %}{{ current_year }}{% endif %}
<a class="link" href="{{ get_url(path=``) }}" <a class="link" href="{{ get_url(path=``) }}"
>{{ config.author | default(value=config.title) }}</a >{{ config.author | default(value=config.title) }}</a
> >