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

main
smtbook 2 years ago committed by welpo
parent 85ccc081e4
commit e7dc5eb44e
No known key found for this signature in database
GPG Key ID: A2F978CF4EC1F5A6

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://www.w3.org/2005/Atom">
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ca">
<head>
<title>
<xsl:value-of select="/atom:feed/atom:title"/> • Feed
</title>
<meta charset="utf-8"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="/main.css"/>
</head>
<body>
<div class="content">
<main>
<div class="info-box">
<strong>This is a web feed</strong>, also known as an Atom feed. <strong>Subscribe</strong> by copying the URL from the address bar into your newsreader. Visit <a href="https://aboutfeeds.com">About Feeds</a> to learn more and get started. Its free.
</div>
<section id="banner-home-subtitle">
<div class="padding-top home-title">
<xsl:value-of select="/atom:feed/atom:title"/>
</div>
<p>
<xsl:value-of select="/atom:feed/atom:subtitle"/>
</p>
<a class="readmore">
<xsl:attribute name="href">
<xsl:value-of select="/atom:feed/atom:link[2]/@href"/>
</xsl:attribute>
Visit Website → </a><p></p>
</section>
<div class="padding-top listing-title bottom-divider">
<h1>Recent Posts</h1>
</div>
<div class="bloglist-container">
<xsl:for-each select="/atom:feed/atom:entry">
<section class="bloglist-row bottom-divider">
<div class="date">
<xsl:value-of select="substring(atom:published, 0, 11)"/>
</div>
<div class="bloglist-content">
<div class="bloglist-title">
<a>
<xsl:attribute name="href">
<xsl:value-of select="atom:link/@href"/>
</xsl:attribute>
<xsl:value-of select="atom:title"/>
</a>
</div>
<div class="description">
<xsl:value-of select="atom:summary"/>
</div>
<a class="readmore" href="">
<xsl:attribute name="href">
<xsl:value-of select="atom:link/@href"/>
</xsl:attribute>
</a>
</div>
</section>
</xsl:for-each>
</div>
</main>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

@ -11,7 +11,7 @@
<meta charset="utf-8"/> <meta charset="utf-8"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="main.css"/> <link rel="stylesheet" href="/main.css"/>
</head> </head>
<body> <body>
<div class="content"> <div class="content">

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://www.w3.org/2005/Atom">
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es">
<head>
<title>
<xsl:value-of select="/atom:feed/atom:title"/> • Feed
</title>
<meta charset="utf-8"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="/main.css"/>
</head>
<body>
<div class="content">
<main>
<div class="info-box">
<strong>This is a web feed</strong>, also known as an Atom feed. <strong>Subscribe</strong> by copying the URL from the address bar into your newsreader. Visit <a href="https://aboutfeeds.com">About Feeds</a> to learn more and get started. Its free.
</div>
<section id="banner-home-subtitle">
<div class="padding-top home-title">
<xsl:value-of select="/atom:feed/atom:title"/>
</div>
<p>
<xsl:value-of select="/atom:feed/atom:subtitle"/>
</p>
<a class="readmore">
<xsl:attribute name="href">
<xsl:value-of select="/atom:feed/atom:link[2]/@href"/>
</xsl:attribute>
Visit Website → </a><p></p>
</section>
<div class="padding-top listing-title bottom-divider">
<h1>Recent Posts</h1>
</div>
<div class="bloglist-container">
<xsl:for-each select="/atom:feed/atom:entry">
<section class="bloglist-row bottom-divider">
<div class="date">
<xsl:value-of select="substring(atom:published, 0, 11)"/>
</div>
<div class="bloglist-content">
<div class="bloglist-title">
<a>
<xsl:attribute name="href">
<xsl:value-of select="atom:link/@href"/>
</xsl:attribute>
<xsl:value-of select="atom:title"/>
</a>
</div>
<div class="description">
<xsl:value-of select="atom:summary"/>
</div>
<a class="readmore" href="">
<xsl:attribute name="href">
<xsl:value-of select="atom:link/@href"/>
</xsl:attribute>
</a>
</div>
</section>
</xsl:for-each>
</div>
</main>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?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 }}"> <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}">
<title>{{ config.title }} <title>{{ config.title }}
{%- if term %} - {{ term.name }} {%- if term %} - {{ term.name }}

@ -43,7 +43,7 @@
{# Check if the language code matches the default language #} {# Check if the language code matches the default language #}
{%- if lcode == config.default_language -%} {%- if lcode == config.default_language -%}
{# If it does, link to the root path (no language code in URL) #} {# 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 -%} {%- else -%}
{# Check if the current language is the default language #} {# Check if the current language is the default language #}
{%- if lang == config.default_language -%} {%- if lang == config.default_language -%}

Loading…
Cancel
Save