Smarter title
This commit is contained in:
@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
- Don't scale down article cards when clicking on tags in them.
|
- Don't scale down article cards when clicking on tags in them.
|
||||||
- Improve performance of the page when navbar is hidden by using the `config.extra.nav.auto_hide` config variable.
|
- Improve performance of the page when navbar is hidden by using the `config.extra.nav.auto_hide` config variable.
|
||||||
|
- Improve tab title generation.
|
||||||
- Replace `config.extra.debug_*` config variables with variables under the `config.extra.debug` section.
|
- Replace `config.extra.debug_*` config variables with variables under the `config.extra.debug` section.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
@ -1,7 +1,35 @@
|
|||||||
{%- if page.title -%}
|
{# Taken from https://github.com/welpo/tabi/blob/69713c973c11d7646c8fe56476261d96cc1978d8/templates/partials/title.html #}
|
||||||
{{- page.title }} {{ config.extra.title_separator | default(value="-") }} {{ config.title -}}
|
|
||||||
{%- elif section.title -%}
|
{#- Setup -#}
|
||||||
{{- section.title }} {{ config.extra.title_separator | default(value="-") }} {{ config.title -}}
|
{%- set suffix = config.title | safe -%}
|
||||||
|
{%- set custom_separator = config.extra.title_separator | default(value="-") -%}
|
||||||
|
{%- set separator = " " ~ custom_separator ~ " " -%}
|
||||||
|
|
||||||
|
{#- Get the base path for the current language -#}
|
||||||
|
{%- if lang != config.default_language %}
|
||||||
|
{%- set base_path = "/" ~ lang ~ "/" %}
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
{{- config.title -}}
|
{%- set base_path = "/" %}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- if current_path and current_path == base_path -%}
|
||||||
|
{%- set prefix = "" -%}
|
||||||
|
{%- set separator = "" -%}
|
||||||
|
{% elif title %}
|
||||||
|
{%- set prefix = title -%}
|
||||||
|
{% elif section.title -%}
|
||||||
|
{%- set prefix = section.title -%}
|
||||||
|
{% elif page.title %}
|
||||||
|
{%- set prefix = page.title -%}
|
||||||
|
{% elif term.name %}
|
||||||
|
{#- Individual tags -#}
|
||||||
|
{%- set prefix = term.name -%}
|
||||||
|
{% elif taxonomy.name %}
|
||||||
|
{#- List of tags -#}
|
||||||
|
{%- set prefix = macros_translate::translate(key=taxonomy.name, language_strings=language_strings) | capitalize -%}
|
||||||
|
{% else %}
|
||||||
|
{%- set prefix = "404" %}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
|
{#- Return the final concatenated string -#}
|
||||||
|
{{- prefix ~ separator ~ suffix -}}
|
||||||
|
Reference in New Issue
Block a user