From 04b9162a2698dc2bbd0bfecc7cb9cebcaeaf30e8 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Sun, 17 Apr 2022 15:19:06 -0700 Subject: 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 --- config.toml | 3 +++ templates/base.html | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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 @@

{{ social_macros::social_links(social_config=config.extra.social) }}

- {# Copyright #}

Copyright © 2019-{{ now() | date(format="%Y") }} {{ config.title }}

+ + {# 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")) %} +

Copyright © {{ start_year ~ end_year}} {{ config.title }}

+

{% for i in config.extra.menu_footer %}{{ i.name }}   {% endfor %}

{# Optional footer credit #} {% if config.extra.footer_credit %} -- cgit v1.3.1