From a23580c87d0c9815be43d9c0efaff175992afe23 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Mon, 9 Oct 2023 07:58:40 +0200 Subject: [PATCH] multilang begin --- _config.yml | 48 +- _data/snippets.yml | 39 + _includes/footer.html | 8 + _includes/head.html | 20 + _includes/header.html | 9 + _includes/index_header.html | 4 + _includes/language-switch.html | 53 ++ _includes/localizations.html | 24 + _includes/navigation.html | 12 + _includes/posts.html | 11 + _includes/title.html | 13 + _includes/toc.html | 4 + _includes/toc.md | 4 + _layouts/{default.html => index.html} | 10 +- _layouts/{posts.html => post.html} | 0 _posts/2021-06-12-look-zonder-look.md | 84 -- _posts/2021-06-14-zomereikwijn.md | 8 - _posts/2021-06-16-aalbessen-krentjesjam.md | 38 - _posts/en/2021-01-01-hello-world.markdown | 14 + _posts/en/2021-01-02-hello-mars.markdown | 14 + archive/lejos-ubuntu.html | 32 - archive/nsa-dropbox.html | 46 -- archive/thin.html | 91 --- archive/wlan-debian.html | 78 -- archive/youtube-term.html | 31 - dvorak.md | 83 -- en/home.md | 1 + files/3cows.pdf | Bin 108978 -> 0 bytes files/alberts.pdf | Bin 1744562 -> 0 bytes files/amlap15.pdf | Bin 1623205 -> 0 bytes files/andrade.pdf | Bin 675914 -> 0 bytes files/artz.pdf | Bin 1457082 -> 0 bytes files/bachelor.pdf | Bin 658303 -> 0 bytes files/boer.pdf | Bin 398167 -> 0 bytes "files/b\303\266hm.pdf" | Bin 569504 -> 0 bytes files/crooijmans.pdf | Bin 1443123 -> 0 bytes files/dvorak-0.74.map | 145 ---- files/dvorak_dos.tar | Bin 10240 -> 0 bytes files/gc/GC8WNDQ.png | Bin 17427 -> 0 bytes files/gc/GC8WNDQ_klein.png | Bin 854 -> 0 bytes files/gc/GC8YY6C.png | Bin 79355 -> 0 bytes files/gc/GC8ZV56_a-c.png | Bin 772899 -> 0 bytes files/gc/GC8ZV56_d-g.png | Bin 957370 -> 0 bytes files/gc/GC8ZV56_h-j.png | Bin 923735 -> 0 bytes files/ifl18.pdf | Bin 606574 -> 0 bytes files/ifl19.pdf | Bin 634305 -> 0 bytes files/iot20.pdf | Bin 2714186 -> 0 bytes files/master.pdf | Bin 906160 -> 0 bytes files/phonetic_dvorak.gz | Bin 744 -> 0 bytes files/pympi_presentation2014.zip | Bin 535299 -> 0 bytes files/rwdsl17.pdf | Bin 594474 -> 0 bytes files/tfp20pres.pdf | Bin 459111 -> 0 bytes files/tt21.pdf | Bin 1800669 -> 0 bytes files/veen.pdf | Bin 464772 -> 0 bytes foerageer.md | 27 - foerageer.xml | 34 - griezels/achtergronden/marble1.jpg | Bin 18298 -> 0 bytes griezels/animaties/bar10.gif | Bin 14363 -> 0 bytes griezels/animaties/hoofd1.gif | Bin 9461 -> 0 bytes griezels/boven.htm | 23 - griezels/fotos/fpcounter2.gif | Bin 2063 -> 0 bytes griezels/fotos/heks.JPG | Bin 174718 -> 0 bytes griezels/fotos/heks_small1.JPG | Bin 2645 -> 0 bytes griezels/fotos/heksen.JPG | Bin 360674 -> 0 bytes griezels/fotos/heksen_small1.JPG | Bin 2605 -> 0 bytes griezels/fotos/heksles.JPG | Bin 72036 -> 0 bytes griezels/fotos/heksles_small1.JPG | Bin 3858 -> 0 bytes griezels/fotos/weervolven.JPG | Bin 180722 -> 0 bytes griezels/fotos/weerwolf.JPG | Bin 50823 -> 0 bytes griezels/fotos/weerwolf1.JPG | Bin 208287 -> 0 bytes griezels/fotos/weerwolf1_small1.JPG | Bin 3162 -> 0 bytes griezels/fotos/weerwolf_small1.JPG | Bin 1932 -> 0 bytes griezels/heksen.htm | 55 -- griezels/hoofd.htm | 72 -- griezels/index.html | 31 - griezels/knoppen/fantbat3001.gif | Bin 2121 -> 0 bytes griezels/knoppen/geesten.gif | Bin 1897 -> 0 bytes griezels/knoppen/heksen.gif | Bin 1885 -> 0 bytes griezels/knoppen/links.gif | Bin 1853 -> 0 bytes griezels/knoppen/start.gif | Bin 1854 -> 0 bytes griezels/knoppen/vampiers.gif | Bin 1942 -> 0 bytes griezels/knoppen/weerwolven.gif | Bin 1972 -> 0 bytes griezels/linker.htm | 26 - griezels/links.htm | 37 - griezels/vampiers.htm | 294 ------- griezels/weerwolven.htm | 58 -- index.md | 30 +- langes.md | 112 --- mart@martlubbers.net.asc | 30 - nds/thoos.md | 9 + nl/thuis.md | 8 + nonm.md | 125 --- o.html | 31 - readme.markdown | 855 +++++++++++++++++++++ test.php | 47 -- triest/index.html | 12 - 96 files changed, 1156 insertions(+), 1684 deletions(-) create mode 100644 _data/snippets.yml create mode 100644 _includes/footer.html create mode 100755 _includes/head.html create mode 100644 _includes/header.html create mode 100644 _includes/index_header.html create mode 100644 _includes/language-switch.html create mode 100755 _includes/localizations.html create mode 100644 _includes/navigation.html create mode 100755 _includes/posts.html create mode 100644 _includes/title.html create mode 100644 _includes/toc.html create mode 100644 _includes/toc.md rename _layouts/{default.html => index.html} (78%) rename _layouts/{posts.html => post.html} (100%) delete mode 100644 _posts/2021-06-12-look-zonder-look.md delete mode 100644 _posts/2021-06-14-zomereikwijn.md delete mode 100644 _posts/2021-06-16-aalbessen-krentjesjam.md create mode 100644 _posts/en/2021-01-01-hello-world.markdown create mode 100644 _posts/en/2021-01-02-hello-mars.markdown delete mode 100644 archive/lejos-ubuntu.html delete mode 100644 archive/nsa-dropbox.html delete mode 100644 archive/thin.html delete mode 100644 archive/wlan-debian.html delete mode 100644 archive/youtube-term.html delete mode 100644 dvorak.md create mode 120000 en/home.md delete mode 100644 files/3cows.pdf delete mode 100644 files/alberts.pdf delete mode 100644 files/amlap15.pdf delete mode 100644 files/andrade.pdf delete mode 100644 files/artz.pdf delete mode 100644 files/bachelor.pdf delete mode 100644 files/boer.pdf delete mode 100644 "files/b\303\266hm.pdf" delete mode 100644 files/crooijmans.pdf delete mode 100644 files/dvorak-0.74.map delete mode 100644 files/dvorak_dos.tar delete mode 100644 files/gc/GC8WNDQ.png delete mode 100644 files/gc/GC8WNDQ_klein.png delete mode 100644 files/gc/GC8YY6C.png delete mode 100644 files/gc/GC8ZV56_a-c.png delete mode 100644 files/gc/GC8ZV56_d-g.png delete mode 100644 files/gc/GC8ZV56_h-j.png delete mode 100644 files/ifl18.pdf delete mode 100644 files/ifl19.pdf delete mode 100644 files/iot20.pdf delete mode 100644 files/master.pdf delete mode 100644 files/phonetic_dvorak.gz delete mode 100644 files/pympi_presentation2014.zip delete mode 100644 files/rwdsl17.pdf delete mode 100644 files/tfp20pres.pdf delete mode 100644 files/tt21.pdf delete mode 100644 files/veen.pdf delete mode 100644 foerageer.md delete mode 100644 foerageer.xml delete mode 100755 griezels/achtergronden/marble1.jpg delete mode 100755 griezels/animaties/bar10.gif delete mode 100755 griezels/animaties/hoofd1.gif delete mode 100755 griezels/boven.htm delete mode 100644 griezels/fotos/fpcounter2.gif delete mode 100755 griezels/fotos/heks.JPG delete mode 100755 griezels/fotos/heks_small1.JPG delete mode 100755 griezels/fotos/heksen.JPG delete mode 100755 griezels/fotos/heksen_small1.JPG delete mode 100755 griezels/fotos/heksles.JPG delete mode 100755 griezels/fotos/heksles_small1.JPG delete mode 100755 griezels/fotos/weervolven.JPG delete mode 100755 griezels/fotos/weerwolf.JPG delete mode 100755 griezels/fotos/weerwolf1.JPG delete mode 100755 griezels/fotos/weerwolf1_small1.JPG delete mode 100755 griezels/fotos/weerwolf_small1.JPG delete mode 100755 griezels/heksen.htm delete mode 100755 griezels/hoofd.htm delete mode 100755 griezels/index.html delete mode 100755 griezels/knoppen/fantbat3001.gif delete mode 100644 griezels/knoppen/geesten.gif delete mode 100644 griezels/knoppen/heksen.gif delete mode 100644 griezels/knoppen/links.gif delete mode 100644 griezels/knoppen/start.gif delete mode 100644 griezels/knoppen/vampiers.gif delete mode 100644 griezels/knoppen/weerwolven.gif delete mode 100755 griezels/linker.htm delete mode 100755 griezels/links.htm delete mode 100755 griezels/vampiers.htm delete mode 100755 griezels/weerwolven.htm delete mode 100644 langes.md delete mode 100644 mart@martlubbers.net.asc create mode 100644 nds/thoos.md create mode 100644 nl/thuis.md delete mode 100644 nonm.md delete mode 100644 o.html create mode 100644 readme.markdown delete mode 100644 test.php delete mode 100644 triest/index.html diff --git a/_config.yml b/_config.yml index 4b153be..f530e41 100644 --- a/_config.yml +++ b/_config.yml @@ -1,11 +1,45 @@ -#baseurl: https://martlubbers.net +# Site settings livereload: true + + #version: '2021-01-01' + +default_language: 'en' +fallback_page: home + +timezone: Europe/Amsterdam +encoding: utf-8 + +# Build settings markdown: kramdown + +# Markdown Processors kramdown: - parse_block_html: true + parse_block_html: true + auto_ids: true + footnote_nr: 1 + entity_output: as_char + toc_levels: 2..3 + +# Defaults defaults: - - - scope: - path: "" - values: - layout: "default" +- + scope: + path: '_posts/en' + type: 'posts' + values: + permalink: 'en/:title' + language: en +- + scope: + path: '_posts/nl' + type: 'posts' + values: + permalink: 'nl/:title' + language: nl +- + scope: + path: '_posts/nds' + type: 'posts' + values: + permalink: 'nds/:title' + language: nds diff --git a/_data/snippets.yml b/_data/snippets.yml new file mode 100644 index 0000000..1af7034 --- /dev/null +++ b/_data/snippets.yml @@ -0,0 +1,39 @@ +title: + en: Mart Lubbers' Website + nl: Mart Lubbers' Webpagina + nds: Mart Lubbers zien Webstie + +languages: + en: + value: en + slug: en + nl: + value: nl + slug: nl + nds: + value: nds + slug: nds + +back: + en: Back to top + nl: Terug naar boven + nds: Teruw noar båm + +top: + en: Top + nl: Boven + nds: Båm + +languagename: + en: Languages + nl: Talen + nds: Språken + +currentfunction: + en: Scientific programmer at TOP Software + nl: Wetenschappelijk programmeur bij TOP Software + nds: Wetenschoppelyk programmeur by TOP Software +fingerprint: + en: Fingerprint + nl: Vingerafdruk + nds: Vingerofdruk diff --git a/_includes/footer.html b/_includes/footer.html new file mode 100644 index 0000000..9516ee3 --- /dev/null +++ b/_includes/footer.html @@ -0,0 +1,8 @@ + diff --git a/_includes/head.html b/_includes/head.html new file mode 100755 index 0000000..ed612a0 --- /dev/null +++ b/_includes/head.html @@ -0,0 +1,20 @@ + + + + + + {% if page.title %}{{ page.title | escape }} / {{ site.title | escape }}{% else %}{{ site.title | escape }}{% endif %} + + +{% include localizations.html %} + + + + \ No newline at end of file diff --git a/_includes/header.html b/_includes/header.html new file mode 100644 index 0000000..1d4c8d7 --- /dev/null +++ b/_includes/header.html @@ -0,0 +1,9 @@ +
+{% include title.html %} + + + +
diff --git a/_includes/index_header.html b/_includes/index_header.html new file mode 100644 index 0000000..85ccbe6 --- /dev/null +++ b/_includes/index_header.html @@ -0,0 +1,4 @@ +{% include img.html alt='A photo of Mart Lubbers' img='p' %}
+{{ site.data.snippets.currentfunction[page.language] }}
+mart@martlubbers.net (GPG: AD3FEBE7)
+mart@cs.ru.nl diff --git a/_includes/language-switch.html b/_includes/language-switch.html new file mode 100644 index 0000000..57cbfad --- /dev/null +++ b/_includes/language-switch.html @@ -0,0 +1,53 @@ + {{ site.data.snippets.languagename[page.language] }}: + {%- for language in site.data.snippets.languages %} + {%- if page.layout == 'page' %} + {%- assign navigation_pages = site.pages + | where: 'language_reference', page.language_reference + | where: 'language', language[1].slug %} + {%- if navigation_pages.size == 1 %} + {%- for navigation_page in navigation_pages %} + {%- assign url = site.baseurl | append: navigation_page.url %} + {%- endfor %} + {%- else %} + {%- assign navigation_pages = site.pages + | where: 'language_reference', site.fallback_page + | where: 'language', language[1].slug %} + {%- for navigation_page in navigation_pages %} + {%- assign url = site.baseurl | append: navigation_page.url %} + {%- endfor %} + {%- endif %} + + {%- elsif page.layout == 'post' %} + {%- assign navigation_posts = site.posts + | where: 'language_reference', page.language_reference + | where: 'language', language[1].slug %} + {%- if navigation_posts.size == 1 %} + {%- for navigation_post in navigation_posts %} + {%- assign url = site.baseurl | append: navigation_post.url %} + {%- endfor %} + {%- else %} + {%- assign navigation_pages = site.pages + | where: 'language_reference', site.fallback_page + | where: 'language', language[1].slug %} + {%- for navigation_page in navigation_pages %} + {%- assign url = site.baseurl | append: navigation_page.url %} + {%- endfor %} + {%- endif %} + + {%- else %} + {%- assign navigation_pages = site.pages + | where: 'language_reference', site.fallback_page + | where: 'language', language[1].slug %} + {%- for navigation_page in navigation_pages %} + {%- assign url = site.baseurl | append: navigation_page.url %} + {%- endfor %} + + {%- endif %} + {%- if language[1].slug == page.language %} + + {%- endif %} + {{ language[1].value }} + {%- if language[1].slug == page.language %} + + {%- endif %} + {%- endfor %} diff --git a/_includes/localizations.html b/_includes/localizations.html new file mode 100755 index 0000000..4dd05d5 --- /dev/null +++ b/_includes/localizations.html @@ -0,0 +1,24 @@ +{%- if page.layout == 'page' %} + {%- assign localized_pages = site.pages + | where: 'language_reference', page.language_reference + | sort: 'language' %} + {%- for localized_page in localized_pages %} + + {%- endfor %} + +{%- elsif page.layout == 'post' %} + {%- assign localized_posts = site.posts + | where: 'language_reference', page.language_reference + | sort: 'language' %} + {%- for localized_post in localized_posts %} + + {%- endfor %} + +{%- elsif page.layout == 'index' %} + {%- assign localized_pages = site.pages + | where: 'language_reference', site.fallback_page + | sort: 'language' %} + {%- for localized_page in localized_pages %} + + {%- endfor %} +{%- endif %} \ No newline at end of file diff --git a/_includes/navigation.html b/_includes/navigation.html new file mode 100644 index 0000000..6bb9f3d --- /dev/null +++ b/_includes/navigation.html @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/_includes/posts.html b/_includes/posts.html new file mode 100755 index 0000000..d06794a --- /dev/null +++ b/_includes/posts.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/_includes/title.html b/_includes/title.html new file mode 100644 index 0000000..562c317 --- /dev/null +++ b/_includes/title.html @@ -0,0 +1,13 @@ + {%- if page.language == site.default_language %} + {%- assign url = site.baseurl | append: '/'%} + {%- else %} + {%- assign navigation_pages = site.pages + | where: 'language_reference', site.fallback_page + | where: 'language', page.language %} + {%- for navigation_page in navigation_pages %} + {%- assign url = site.baseurl | append: navigation_page.url %} + {%- endfor %} + {%- endif %} +

+ {{ site.title }} +

\ No newline at end of file diff --git a/_includes/toc.html b/_includes/toc.html new file mode 100644 index 0000000..593a934 --- /dev/null +++ b/_includes/toc.html @@ -0,0 +1,4 @@ +#### Table of Contents + +* - +{:toc} diff --git a/_includes/toc.md b/_includes/toc.md new file mode 100644 index 0000000..593a934 --- /dev/null +++ b/_includes/toc.md @@ -0,0 +1,4 @@ +#### Table of Contents + +* - +{:toc} diff --git a/_layouts/default.html b/_layouts/index.html similarity index 78% rename from _layouts/default.html rename to _layouts/index.html index 0d529fa..c3fab70 100644 --- a/_layouts/default.html +++ b/_layouts/index.html @@ -4,6 +4,7 @@ {{ page.title }} + {% include localizations.html %}
@@ -13,26 +14,31 @@ {% endif %} {{ page.title }} + {% include language-switch.html %} {% if page.collection == "posts" %} Terug naar het blog {% endif %} - {% if page.name != "index.md" %} + {% if page.layout != "index" %} Back to home/terug naar home {% endif %} +
+ {% include index_header.html %} +
{{ content }}