Initial translation support for text strings like headers and sentences

This commit is contained in:
Michael Boelen 2024-11-08 12:23:46 +00:00
parent 7500d67c4a
commit fde1ab5b32
3 changed files with 27 additions and 3 deletions

View file

@ -0,0 +1,6 @@
- id: header_latest_news
translation: "Latest news"
- id: header_upcoming_events
translation: "Upcoming events"
- id: sentence_more_events_planned
translation: "Besides these events by us, there are additional events planned in the near future"

View file

@ -4,7 +4,7 @@
{{ if gt (len (where .Site.RegularPages "Section" "nieuws")) 0 }} {{ if gt (len (where .Site.RegularPages "Section" "nieuws")) 0 }}
<section> <section>
<h2>Laatste nieuws</h2> <h2>{{ i18n "header_latest_news" | default "Laatste nieuws" }}</h2>
<ul class="list"> <ul class="list">
{{ range (first 5 (where .Site.RegularPages "Section" "nieuws").ByDate.Reverse) }} {{ range (first 5 (where .Site.RegularPages "Section" "nieuws").ByDate.Reverse) }}
<li> <li>
@ -20,7 +20,7 @@
<section> <section>
{{ $upcoming_events := sort .Site.Data.evenementen.kalender "date_start" "asc" }} {{ $upcoming_events := sort .Site.Data.evenementen.kalender "date_start" "asc" }}
<h2>Aankomende evenementen</h2> <h2>{{ i18n "header_upcoming_events" | default "Aankomende evenementen" }}</h2>
<div class="three-column-grid"> <div class="three-column-grid">
{{ range $upcoming_events }} {{ range $upcoming_events }}
{{ $date_start := .date_start | time.Format "2006-01-02" }} {{ $date_start := .date_start | time.Format "2006-01-02" }}
@ -45,7 +45,7 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>
<p>Naast de door ons georganiseerde evenementen staat er meer op de agenda.</p> <p>{{ i18n "sentence_more_events_planned" | default "Naast de door ons georganiseerde evenementen staat er meer op de agenda" }}.</p>
<ul> <ul>
{{ range first 10 (where $upcoming_events "date_start" "ge" (dateFormat "2006-01-02" now)) }} {{ range first 10 (where $upcoming_events "date_start" "ge" (dateFormat "2006-01-02" now)) }}
<li><time class="time" datetime="{{ .date_start | dateFormat "2006-01-02" }}">{{ .date_start | dateFormat "02-01-2006" }}</time> - <a href="/evenementen/kalender/#{{ anchorize (.date_start | dateFormat "2006-01-02") }}-{{ anchorize .name }}">{{ .name }}</a></li> <li><time class="time" datetime="{{ .date_start | dateFormat "2006-01-02" }}">{{ .date_start | dateFormat "02-01-2006" }}</time> - <a href="/evenementen/kalender/#{{ anchorize (.date_start | dateFormat "2006-01-02") }}-{{ anchorize .name }}">{{ .name }}</a></li>

View file

@ -0,0 +1,18 @@
<script type="application/ld+json">
{
"@context":"https://schema.org",
"@type":"ItemList",
"mainEntityOfPage":{
"@type":"CollectionPage",
"@id":"https://example.com/"
},
"itemListElement": [
"@type": "ListItem",
"position": "1",
"item": {
"@type": "Person",
"url": "http://example.com/big_list_of_recipes#strawberry-mango-pie",
"name": "Naam",
"image": "{{ .thumbnail }}",
}
]