minor bug fix in translation urls
All checks were successful
continuous-integration/drone/push Build is passing

added more heading icons
This commit is contained in:
Samuel Philipp 2021-04-05 21:46:34 +02:00
parent ddfde3282c
commit 4448b13580
Signed by: samuel-p
GPG key ID: 2AD495D17760CB4E
8 changed files with 13 additions and 23 deletions

View file

@ -11,6 +11,9 @@ module.exports = function(eleventyConfig) {
"node_modules/@fortawesome/fontawesome-free/webfonts/": "font",
"node_modules/flag-icon-css/flags/4x3/(de|us)*": "flags"
});
eleventyConfig.addShortcode("translatedUrl", function(currentLocale, newLocale) {
return this.page.url.replace(new RegExp(`\/${currentLocale}\/`), `/${newLocale}/`);
});
return {
dir: {

View file

@ -43,14 +43,8 @@ title: sp-codes
<div class="flex-grow-1"></div>
{% for language in site.languages %}
{% set translatedUrl = "/" + language.code + "/" %}
{% for item in collections.all %}
{% if item.data.key == key and item.data.locale == language.code and not item.data.hidden %}
{% set translatedUrl = item.url %}
{% endif %}
{% endfor%}
<div {% if language.code== locale %} class="active" {% endif %}>
<a href="{{ translatedUrl | url }}" class="ml-3">
<a href="{% translatedUrl locale, language.code %}" class="ml-3">
<span class="flag-icon flag-icon-{{ language.icon }}" title="{{ language.label }}"></span>
</a>
</div>
@ -74,20 +68,15 @@ title: sp-codes
<div class="lang-large">
{% for language in site.languages %}
{% set translatedUrl = "/" + language.code + "/" %}
{% for item in collections.all %}
{% if item.data.key == key and item.data.locale == language.code and not item.data.hidden %}
{% set translatedUrl = item.url %}
{% endif %}
{% endfor%}
<div {% if language.code== locale %} class="active" {% endif %}>
<a href="{{ translatedUrl | url }}" class="ml-3">
<a href="{% translatedUrl locale, language.code %}" class="ml-3">
<span class="flag-icon flag-icon-{{ language.icon }}" title="{{ language.label }}"></span>
</a>
</div>
{% endfor %}
</div>
</nav>
<p>{{url}}</p>
<div class="content">
<div class="container">
{{ content | safe }}

View file

@ -8,7 +8,7 @@ eleventyNavigation:
icon: comment-dots
order: 3
---
<h1>Kontaktmöglichkeiten</h1>
<h1><i class="fas fa-comment-dots"></i> Kontaktmöglichkeiten</h1>
<p>Du möchtest mit mir in Kontakt treten, mir einen Fehler mitteilen, hast eine Frage zu einem Dienst oder möchtest
mich unterstützen? Schick mir gerne deine Nachricht auf einem der folgenden Wege. Ich freue mich von dir zu
hören.</p>

View file

@ -2,7 +2,7 @@
layout: base.njk
title: Impressum
---
<h1>Impressum</h1>
<h1><i class="fas fa-info-circle"></i> Impressum</h1>
<div class="mb-4">
<h2>Angaben gemäß § 5 TMG:</h2>
<p>Samuel Philipp<br/>

View file

@ -2,7 +2,7 @@
layout: base.njk
title: Datenschutzerklärung
---
<h1>Datenschutzerklärung</h1>
<h1><i class="fas fa-user-secret"></i> Datenschutzerklärung</h1>
<div class="mb-3">
<h2>Verantwortlicher</h2>
<p>

View file

@ -8,7 +8,7 @@ eleventyNavigation:
icon: comment-dots
order: 3
---
<h1>Contact Information</h1>
<h1><i class="fas fa-comment-dots"></i> Contact Information</h1>
<p>You want to contact me, report a problem, have a question about a service or would like to support me? Please
send me your message in any of the following ways. I am looking forward to receive your message.</p>
<div class="row justify-content-center">

View file

@ -2,7 +2,7 @@
layout: base.njk
title: sp-codes
---
<h1>Imprint</h1>
<h1><i class="fas fa-info-circle"></i> Imprint</h1>
<div class="mb-4">
<h2>Information as per § 5 TMG:</h2>
<p>Samuel Philipp<br/>

View file

@ -1,8 +1,6 @@
---
layout: base.njk
title: sp-codes
title: Privacy
---
<body class="legal">
<h2>Privacy</h2>
<h1><i class="fas fa-user-secret"></i> Privacy</h1>
<p>Sorry, this document is only available in German so far. Read it <a href="/de/privacy">here</a>.</p>
</body>