fix: multilingual issues in feeds and 'nav.html'

This commit is contained in:
smtbook
2023-07-31 15:36:23 +08:00
committed by welpo
parent 85ccc081e4
commit e7dc5eb44e
5 changed files with 145 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="feed_style.xsl" type="text/xsl"?>
<?xml-stylesheet href="/feed_style/{{ lang }}.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}">
<title>{{ config.title }}
{%- if term %} - {{ term.name }}

View File

@@ -43,7 +43,7 @@
{# Check if the language code matches the default language #}
{%- if lcode == config.default_language -%}
{# If it does, link to the root path (no language code in URL) #}
<a type="Button" href="{{ current_url | replace(from=current_path | default(value="") | truncate(length=4, end=""), to="/") }}">{{ language_name }}</a>
<a type="Button" href="{{ current_url | replace(from='/' ~ lang ~ '/', to = '/') }}">{{ language_name }}</a>
{%- else -%}
{# Check if the current language is the default language #}
{%- if lang == config.default_language -%}