From c3811ec6894aa93e7133120e0b4b955b4ec890a7 Mon Sep 17 00:00:00 2001 From: Tommi Date: Wed, 1 Jun 2022 19:34:23 +0200 Subject: [PATCH] Migration to Eleventy almost complete The website now builds with Eleventy, but there are still many bugs to fix. --- .eleventy.js | 25 +----- 404.html | 2 +- data/tommi.json | 37 +++++++++ includes/comments.html | 18 ++--- includes/draft.html | 10 +-- includes/edit.html | 8 +- includes/footer.html | 26 +++--- includes/head.html | 103 ++++++++++++++++++++---- includes/l10n.html | 6 +- includes/nav.html | 104 +++++++++++++----------- includes/share.html | 73 ++++++----------- layouts/full.html | 6 +- layouts/level.html | 4 +- layouts/page.html | 41 +++------- layouts/wrapper.html | 61 ++++++++------ logos/red-cursor-hover.svg | 3 +- logos/red-cursor.svg | 3 +- package-lock.json | 4 +- pages/Contribute.md | 2 +- pages/Development.md | 2 +- pages/FAQ.md | 4 +- pages/Home.html | 94 +++++++++------------- pages/Learn.md | 26 ------ pages/Localization.md | 2 +- pages/Press.md | 6 +- pages/Watch.md | 2 +- pages/fr/About.md | 1 - pages/fr/FAQ.md | 1 - pages/fr/Home.html | 21 +++-- pages/fr/Path.md | 1 - pages/fr/Why.md | 1 - pages/fr/fr.11tydata.json | 3 + pages/index.html | 25 +++--- pages/it/Ascolta.md | 1 - pages/it/Contribuisci.md | 3 +- pages/it/Elimina.md | 3 +- pages/it/FAQ.md | 3 +- pages/it/Guarda.md | 1 - pages/it/Home.html | 13 ++- pages/it/Info.md | 6 +- pages/it/Links.md | 3 +- pages/it/Ma.md | 1 - pages/it/Partecipanti.md | 7 +- pages/it/Perché.md | 5 +- pages/it/Percorso.md | 1 - pages/it/Soluzioni.md | 3 +- pages/it/Stampa.md | 8 +- pages/it/Veloce.md | 3 +- pages/it/it.11tydata.json | 3 + pages/pages.11tydata.js | 35 ++++++++ styles/parts/_nav.scss | 158 ++++++++++++++++++------------------- styles/style.scss | 34 +++++--- 52 files changed, 530 insertions(+), 486 deletions(-) create mode 100644 data/tommi.json delete mode 100644 pages/Learn.md create mode 100644 pages/fr/fr.11tydata.json create mode 100644 pages/it/it.11tydata.json create mode 100644 pages/pages.11tydata.js diff --git a/.eleventy.js b/.eleventy.js index b65bbd9..f9b34e2 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -33,27 +33,6 @@ module.exports = function(eleventyConfig) { eleventyConfig.setFrontMatterParsingOptions({ excerpt: true, excerpt_separator: ''}); eleventyConfig.setQuietMode(true); - // Collections // - eleventyConfig.addCollection('posts', function(collection) { - return collection.getFilteredByGlob('content/posts/*').sort((a, b) => { - return b.date - a.date; // sort by date - descending - }); - }); - eleventyConfig.addCollection('jam', function(collection) { - return collection.getFilteredByGlob('content/notes/public/*').sort((a, b) => { - return b.date - a.date; - }); - }); - eleventyConfig.addCollection('poetry', function(collection) { - return collection.getFilteredByGlob('content/poetry/*').sort((a, b) => { - return b.date - a.date; - }); - }); - eleventyConfig.addCollection('sconnesso', function(collection) { - return collection.getFilteredByGlob('content/sconnesso/*').sort((a, b) => { - return b.date - a.date; - }); - }); // Multilingual sitemap collection. See https://github.com/quasibit/eleventy-plugin-sitemap#create-a-multilingual-sitemap eleventyConfig.addCollection('sitemap', function(collectionApi) { return collectionApi @@ -150,7 +129,7 @@ module.exports = function(eleventyConfig) { eleventyConfig.addFilter('convertHtmlToAbsoluteUrls', pluginRss.convertHtmlToAbsoluteUrls); // Minify output // - eleventyConfig.addTransform('miniHtml', function(content, outputPath) { + /*eleventyConfig.addTransform('miniHtml', function(content, outputPath) { if( this.outputPath && this.outputPath.endsWith('.html') ) { let minified = miniHtml.minify(content, { useShortDoctype: true, @@ -163,7 +142,7 @@ module.exports = function(eleventyConfig) { return minified; } return content; - }); + });*/ // 404 // eleventyConfig.setBrowserSyncConfig({ diff --git a/404.html b/404.html index d5dd4fb..2b70e38 100644 --- a/404.html +++ b/404.html @@ -1,6 +1,6 @@ --- permalink: /404.html -layout: full +layout: full.html sitemap: false title: 404 link: 'javascript:history.go(-1)' diff --git a/data/tommi.json b/data/tommi.json new file mode 100644 index 0000000..12e8954 --- /dev/null +++ b/data/tommi.json @@ -0,0 +1,37 @@ +{ + "@context": "http://schema.org", + "@type": "Person", + "gender": "Male", + "url": "https://tommi.space", + "name": "Tommi", + "givenName": "Tommaso", + "familyname": "Marmo", + "nationality": "IT", + "mainEntityOfPage": "https://tommi.space/about", + "image": "https://tommi.space/profile-full.jpg", + "birthDate": "2000-07-08", + "knowsLanguage": ["it", "en", "fr"], + "jobTitle": "Enthusiast", + "worksFor": { + "@type": "Organization", + "additionalType": "Brand", + "name": "A.P.S. Oltre", + "email": "staff@scambi.org", + "url": "https://scambi.org/oltre", + "sameAs": "https://tommi.space/oltre", + "address":{ + "@type": "PostalAddress", + "addressCountry": "IT", + "addressRegion": "IM", + "postalCode": 18038, + "streetAddress": "Via Dante Alighieri, 81" + }, + "event": { + "name": "Scambi Festival", + "location": "Sanremo, Italy" + } + }, + "hasOccupation": {}, + "knows": [], + "memberOf": [] +} \ No newline at end of file diff --git a/includes/comments.html b/includes/comments.html index d931f0c..33ac9f6 100644 --- a/includes/comments.html +++ b/includes/comments.html @@ -1,10 +1,8 @@ -{% if page.comments %} -
-

{% case page.lang %}{% when 'it' %}Commenti{% when 'fr' %}Commentaires{% else %}Comments{% endcase %}

- -
-
-{% endif %} +
+

{% case lang %}{% when 'it' %}Commenti{% when 'fr' %}Commentaires{% else %}Comments{% endcase %}

+ +
+
\ No newline at end of file diff --git a/includes/draft.html b/includes/draft.html index e924ec8..461f247 100644 --- a/includes/draft.html +++ b/includes/draft.html @@ -1,16 +1,16 @@
diff --git a/includes/edit.html b/includes/edit.html index cf6ab4f..51c19b6 100644 --- a/includes/edit.html +++ b/includes/edit.html @@ -1,12 +1,12 @@
-

modifica questa pagina + Modifica questa pagina su Codeberg'>modifica questa pagina {% when 'fr' %} - Modifiez cette page-ci sur GitHub'>Modifiez cette page-ci + Modifiez cette page-ci sur Codeberg'>Modifiez cette page-ci {% else %} - Edit this page on GitHub'>edit this page + Edit this page on Codeeberg'>edit this page {% endcase %}

diff --git a/includes/footer.html b/includes/footer.html index 14fb589..09cc74a 100644 --- a/includes/footer.html +++ b/includes/footer.html @@ -1,8 +1,8 @@
-

{% case page.lang%} +

{% case lang%} {% when 'it' %} - Questo sito è stato ideato e creato da Tommi con ❤️ e dedizione. + Questo sito è stato ideato e creato da Tommi con ❤️ e dedizione. {% when 'fr' %} Ce site-ci à été creé par Tommi et traduit en Français par LeJun. {% else %} @@ -10,29 +10,27 @@ {% endcase %}

-

{% case page.lang %}{% when 'it %}Ultimo aggiornamento di questa pagina{% when 'fr'%}Dernière mise à jour de cette page-ci{% else %}This page was last updated on{% endcase %}:

- - + {% endcomment %}
- - - - - + {% comment %} + - - + + + - + {% endcomment %}
- {% case page.lang %} + {% case lang %} {% when 'it' %}

Eccetto dove diversamente specificato, tutto quello che c’è in questo sito, compreso il codice sorgente, è protetto dalla licenza Creative Commons Attribution-ShareAlike 4.0 International.

{% when 'fr' %} diff --git a/includes/head.html b/includes/head.html index 4c512fb..5b61646 100644 --- a/includes/head.html +++ b/includes/head.html @@ -1,24 +1,93 @@ +{% assign absoluteUrl = url | prepend: site.url %} + + + + + + - {% seo %} - - - - {{ page.title }} | Quit Social Media + + + - - - - - - - - - - - - + + + + + + + + + + {% if title %}{{ title }} | {% endif %}{{ site.title }} + + {% if description != nil %} + + + {% else %} + + + {% endif %} + + + + + + {% if date %}{% endif %} + {% if updated %}{% endif %} + + + + + + + + {% if alternates %} + {% for alternate in alternates %} + + + {% endfor %} + {% endif %} + + + {% comment %}{% endcomment %} + + + + + + + + + {% for account in accounts %} + {% if account.deleted == '' and account.url != '' %} + + {% endif %} + {% endfor %} + + + diff --git a/includes/l10n.html b/includes/l10n.html index e663b3e..1839dc8 100644 --- a/includes/l10n.html +++ b/includes/l10n.html @@ -3,11 +3,11 @@

🚧 {% case page.lang%}{% when 'it' %}Traduzione in corso{% when 'fr' %}Traduction en cours{% else %}Translation in progress{% endcase %} 🏗

{% case page.lang %} {% when 'it' %} - Questa pagina non è stato completamente tradotta; tutti gli articoli e le note con traduzione in sospeso sono contraddistinte dal tag l10n.
Per visualizzare il contenuto aggiornato, visualizza questa pagina in inglese + Questa pagina non è stato completamente tradotta; tutti gli articoli e le note con traduzione in sospeso sono contraddistinte dal tag l10n.
Per visualizzare il contenuto aggiornato, visualizza questa pagina in inglese {% when 'fr' %} - Cette page-ci n’a pas été complètement traduite; tous les pages dont traductions sont incomplètes sont marquées avec l’étiquette l10n.
Pour visualiser la version à jour de la page, visualisez-la en anglais + Cette page-ci n’a pas été complètement traduite; tous les pages dont traductions sont incomplètes sont marquées avec l’étiquette l10n.
Pour visualiser la version à jour de la page, visualisez-la en anglais {% else %} - This page has not been completely translated from the language it was originally written in. You may seen chunks of it in other languages. Please, consider helping out in translating it! + This page has not been completely translated from the language it was originally written in. You may seen chunks of it in other languages. Please, consider helping out in translating it! {% endcase %}
diff --git a/includes/nav.html b/includes/nav.html index 6e6a4a5..c705425 100644 --- a/includes/nav.html +++ b/includes/nav.html @@ -1,48 +1,56 @@ - - - - - - - - - - - -

Quit Social Media

- - - + \ No newline at end of file diff --git a/includes/share.html b/includes/share.html index eee3bd8..4d714c0 100644 --- a/includes/share.html +++ b/includes/share.html @@ -1,29 +1,20 @@ -
- -

{% case page.lang %}{% when 'it' %}Condividi{% when 'fr' %}Partagez{% else %}Share{% endcase %}

- - + \ No newline at end of file diff --git a/layouts/full.html b/layouts/full.html index a5e88ea..5f03174 100644 --- a/layouts/full.html +++ b/layouts/full.html @@ -1,12 +1,10 @@ ---- -layout: ~ ---- -{% include head.html %} +{% render 'head.html', date: date, updated: updated, title: title, description: description, primary: primary, lang: lang, alternates: alternates, site: site, url: page.url, layout: layout, image: image %}