diff --git a/config.toml b/config.toml index cf0ceb0..d7d79ad 100644 --- a/config.toml +++ b/config.toml @@ -240,14 +240,18 @@ code_block_name_links = true compact_tags = false short_date_format = "" + +# Date format used for the archive page. +# Default is "06 July" in English and "%d %b" in other languages. +archive_date_format = "" + # Per-language date format overrides. # Examples: Spanish uses "3 de febrero de 2024", German uses "3. Februar 2024" date_formats = [ - { lang = "ru", long = "%d %B %Y", short = "%-d %b %Y" }, + { lang = "ru", long = "%d %B %Y", short = "%-d %b %Y", archive = "%d %b" }, { lang = "en", long = "%d. %B %Y", short = "%d.%m.%Y" }, ] - tag_sorting = "frequency" menu = [ diff --git a/themes/tabi/templates/archive.html b/themes/tabi/templates/archive.html index f2f9dd3..637b414 100644 --- a/themes/tabi/templates/archive.html +++ b/themes/tabi/templates/archive.html @@ -7,6 +7,18 @@ {# Set locale for date #} {% set date_locale = macros_translate::translate(key="date_locale", default="en_GB", language_strings=language_strings) %} +{#- Check for language-specific date formats -#} +{%- set language_format = "" -%} +{%- if config.extra.date_formats -%} + {%- for format_config in config.extra.date_formats -%} + {%- if format_config.lang == lang -%} + {%- if format_config.archive -%} + {%- set_global language_format = format_config.archive -%} + {%- endif -%} + {%- endif -%} + {%- endfor -%} +{%- endif -%} +