diff options
| author | Clayton Craft | 2022-04-17 15:19:06 -0700 |
|---|---|---|
| committer | Jieiku | 2022-05-30 22:20:18 -0700 |
| commit | 04b9162a2698dc2bbd0bfecc7cb9cebcaeaf30e8 (patch) | |
| tree | f9eeea5577870c185ec27d6a5bdbe9c122a642a1 | |
| parent | 2c6fd450834a1452ef2c5436aa27d90f12f5a7f0 (diff) | |
| download | abridge-04b9162a2698dc2bbd0bfecc7cb9cebcaeaf30e8.tar.gz abridge-04b9162a2698dc2bbd0bfecc7cb9cebcaeaf30e8.tar.bz2 abridge-04b9162a2698dc2bbd0bfecc7cb9cebcaeaf30e8.zip | |
base: add options to set copyright start/end years
start_year and end_year are both optional. If start_year is unset, then
it's omitted from what is generated, so it'll be something like
"Copyright (c) 2022". if end_year is unset, then it defaults to the
current year.
fixes #4
| -rw-r--r-- | config.toml | 3 | ||||
| -rw-r--r-- | templates/base.html | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/config.toml b/config.toml index 6ecae61..9d985a0 100644 --- a/config.toml +++ b/config.toml @@ -81,3 +81,6 @@ instagram = "your-user-name" pinterest = "your-user-name" twitch = "your-user-name" youtube = "your-channel-id" + +start_year = 2019 # optional, copyright start year +# end_year = 2022 #optional, copyright end year, defaults to current year if unset diff --git a/templates/base.html b/templates/base.html index 7f6f95f..0e826da 100644 --- a/templates/base.html +++ b/templates/base.html @@ -120,7 +120,13 @@ <hr> <center> <p>{{ social_macros::social_links(social_config=config.extra.social) }}</p> - {# Copyright #}<p>Copyright © 2019-{{ now() | date(format="%Y") }} {{ config.title }}</p> + + {# Copyright #} + {% set start_year=config.extra.start_year | default(value="") %} + {% if start_year %}{% set start_year=start_year ~ "-" %}{% endif %} + {% set end_year=config.extra.end_year | default(value=now() | date(format="%Y")) %} + <p>Copyright © {{ start_year ~ end_year}} {{ config.title }}</p> + <p>{% for i in config.extra.menu_footer %}<a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}">{{ i.name }}</a> {% endfor %}</p> {# Optional footer credit #} {% if config.extra.footer_credit %} |
