Browse Source

minor bug fix in translation urls

added more heading icons
pull/55/head
Samuel Philipp 4 months ago
parent
commit
4448b13580
Signed by: samuel-p GPG Key ID: 2AD495D17760CB4E
  1. 3
      .eleventy.js
  2. 17
      src/_includes/layouts/base.njk
  3. 2
      src/de/contact.html
  4. 2
      src/de/imprint.html
  5. 2
      src/de/privacy.html
  6. 2
      src/en/contact.html
  7. 2
      src/en/imprint.html
  8. 6
      src/en/privacy.html

3
.eleventy.js

@ -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: {

17
src/_includes/layouts/base.njk

@ -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 }}

2
src/de/contact.html

@ -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>

2
src/de/imprint.html

@ -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/>

2
src/de/privacy.html

@ -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>

2
src/en/contact.html

@ -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">

2
src/en/imprint.html

@ -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/>

6
src/en/privacy.html

@ -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>
Loading…
Cancel
Save