feat: localize new taxonomy names
- Tag links now use the actual taxonomy name for the URL and the displayed label is wrapped in a translation macro instead of the previous placeholder-based logic. - Simplify the taxonomy tag URL by passing the name directly and add translation support for the tag label. - Introduce a new taxon_name_i18n variable to translate the taxonomy name and swap in this localized value for the page title and “See all” link, while also simplifying the all-taxa URL by passing taxonomy.name directly to get_url. Signed-off-by: CHEN, CHUN <jim60105@gmail.com>
This commit is contained in:
@ -53,7 +53,7 @@
|
||||
{%- for name, taxon in page.taxonomies %}
|
||||
<small>
|
||||
<ul class="tags">
|
||||
<a class="tag" href="{{- get_url(path='$TAXON', lang=lang) | replace(from="$TAXON", to=name) | lower -}}">{{ name }}:</a>
|
||||
<a class="tag" href="{{- get_url(path=name, lang=lang) | lower -}}">{{ macros_translate::translate(key=name, default=name, language_strings=language_strings) }}:</a>
|
||||
{%- for item in taxon -%}
|
||||
<li><a class="tag" href="{{ get_taxonomy_url(kind=name, name=item, lang=lang) }}">{{ item }}</a></li>
|
||||
{%- endfor %}
|
||||
|
Reference in New Issue
Block a user