refactor: remove dependency on alt page

This commit is contained in:
relikd
2022-11-14 20:35:59 +01:00
parent ff1dc6af43
commit 29d61ca8ad

View File

@@ -12,7 +12,7 @@
</head> </head>
<body> {#- ontouchstart="" #} <body> {#- ontouchstart="" #}
<header> <header>
<a id="logo" href="{{ site.get('/', alt=this.alt)|url }}">recipe lekture</a> <a id="logo" href="{{ site.get('/', this.alt)|url }}">recipe lekture</a>
<nav> <nav>
<ul> <ul>
{%- set allRecipes = site.get('recipes', this.alt) %} {%- set allRecipes = site.get('recipes', this.alt) %}
@@ -39,10 +39,11 @@
<td>Build with <a href="https://www.getlektor.com/">Lektor</a>, template by <a href="https://github.com/relikd/lektor-recipes">relikd</a>.</td>{#--#} <td>Build with <a href="https://www.getlektor.com/">Lektor</a>, template by <a href="https://github.com/relikd/lektor-recipes">relikd</a>.</td>{#--#}
<td class="buttons xlarge"> <td class="buttons xlarge">
<a href="/static/pdf-{{ this.alt }}.pdf" download="recipes-{{ this.alt }}.pdf" title="{{ localize(this.alt, 'other', 'get_pdf') }}"><img class="h1em" alt="(PDF)" height="20" src="{{ '/img/icon-pdf.svg'|url }}"></a> <a href="/static/pdf-{{ this.alt }}.pdf" download="recipes-{{ this.alt }}.pdf" title="{{ localize(this.alt, 'other', 'get_pdf') }}"><img class="h1em" alt="(PDF)" height="20" src="{{ '/img/icon-pdf.svg'|url }}"></a>
{%- set url_without_alt = ('.'|url(absolute=True))[4:] -%}
{%- if this.alt == 'de' -%} {%- if this.alt == 'de' -%}
<a href="{{ '.'|url(alt='en') }}" title="zur englischen Seite wechseln">🇺🇸</a> <a href="/en/{{url_without_alt}}" title="zur englischen Seite wechseln">🇺🇸</a>
{%- else -%} {%- else -%}
<a href="{{ '.'|url(alt='de') }}" title="switch to german page">🇩🇪</a> <a href="/de/{{url_without_alt}}" title="switch to german page">🇩🇪</a>
{%- endif -%} {%- endif -%}
</td>{#--#} </td>{#--#}
</table>{#--#} </table>{#--#}