summaryrefslogtreecommitdiff
path: root/site
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-10-05 21:27:57 -0300
committerEuAndreh <eu@euandre.org>2020-10-10 14:31:24 -0300
commita7c4db7e9215694ef6c50debcc0b4e7402265687 (patch)
treed45b89f1758b34416e5157cb0e7404276c6fa49a /site
parentcargo2nix: Use overlay on example (diff)
downloadeuandre.org-a7c4db7e9215694ef6c50debcc0b4e7402265687.tar.gz
euandre.org-a7c4db7e9215694ef6c50debcc0b4e7402265687.tar.xz
Refactor i18n structure, remove layouts, add slides
Yep, this commit is too big big I didn't want to take the trouble of splitting it now. - _config.yml translation keys are now simetrical on the entitiy: articles, pastebins, tils, slides, etc.; - _posts were moved to _articles: the _posts collection had special treatment in Jekyll which I wanted to avoid; - the filtering of entries for the Atom feed is now done inside the _includes/feed.atom file instead of every feed file; - all entities are now dealt with using the pluralized name: articles, pastebins, tils, slides. No more inconsistencies on the key names, they now should only make sense as the translation value on the dictionary; - add base reveal.js infrastruture, with Jekyll generating the listing page and nothing else.
Diffstat (limited to '')
-rw-r--r--site.json67
-rw-r--r--sitemap.xml11
2 files changed, 54 insertions, 24 deletions
diff --git a/site.json b/site.json
index 2a27e8d..061eede 100644
--- a/site.json
+++ b/site.json
@@ -1,14 +1,33 @@
---
---
{
- "posts": [
- {% assign filtered_posts = "" | split:"" %}
- {% for post in site.posts %}
+ "pages": [
+ {% assign filtered_pages = "" | split:"" %}
+ {% for page in site.pages %}
+ {% unless page.plaintext %}
+ {% assign filtered_pages = filtered_pages | push:page %}
+ {% endunless %}
+ {% endfor %}
+ {% for page in filtered_pages %}
+ {
+ "title": "{{ page.title | smartify }}",
+ "url": "{{ page.url }}",
+ "lang": "{{ page.lang }}",
+ "ref": "{{ page.ref }}",
+ "plaintext": "{{ page.plaintext }}",
+ "layout": "{{ page.layout }}",
+ "content": {{ page.content | strip_html | jsonify }}
+ }{% unless forloop.last %},{% endunless %}
+ {% endfor %}
+ ],
+ "articles": [
+ {% assign filtered_articles = "" | split:"" %}
+ {% for post in site.articles %}
{% unless post.plaintext %}
- {% assign filtered_posts = filtered_posts | push:post %}
+ {% assign filtered_articles = filtered_articles | push:post %}
{% endunless %}
{% endfor %}
- {% for post in filtered_posts %}
+ {% for post in filtered_articles %}
{
"title": "{{ post.title | smartify }}",
"date": "{{ post.date }}",
@@ -20,25 +39,6 @@
}{% unless forloop.last %},{% endunless %}
{% endfor %}
],
- "pages": [
- {% assign filtered_pages = "" | split:"" %}
- {% for page in site.pages %}
- {% unless page.plaintext %}
- {% assign filtered_pages = filtered_pages | push:page %}
- {% endunless %}
- {% endfor %}
- {% for page in filtered_pages %}
- {
- "title": "{{ page.title | smartify }}",
- "url": "{{ page.url }}",
- "lang": "{{ page.lang }}",
- "ref": "{{ page.ref }}",
- "plaintext": "{{ page.plaintext }}",
- "layout": "{{ page.layout }}",
- "content": {{ page.content | strip_html | jsonify }}
- }{% unless forloop.last %},{% endunless %}
- {% endfor %}
- ],
"pastebins": [
{% assign filtered_pastebins = "" | split:"" %}
{% for pastebin in site.pastebins %}
@@ -76,5 +76,24 @@
"content": {{ til.content | strip_html | jsonify }}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
+ ],
+ "slides": [
+ {% assign filtered_slides = "" | split:"" %}
+ {% for slide in site.data.slides %}
+ {% unless slide.plaintext %}
+ {% assign filtered_slides = filtered_slides | push:slide %}
+ {% endunless %}
+ {% endfor %}
+ {% for slide in site.slides %}
+ {
+ "title": "{{ slide.title | smartify }}",
+ "date": "{{ slide.date }}",
+ "url": "{{ slide.url }}",
+ "lang": "{{ slide.lang }}",
+ "ref": "{{ slide.ref }}",
+ "layout": "{{ slide.layout }}",
+ "content": {{ slide.content | strip_html | jsonify }}
+ }{% unless forloop.last %},{% endunless %}
+ {% endfor %}
]
}
diff --git a/sitemap.xml b/sitemap.xml
index 8f3aa6f..050bdb4 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -39,6 +39,17 @@
<loc>{{ site.url }}{{ til.url }}</loc>
{% assign versions=site.tils | where:"ref", til.ref %}
{% for version in versions %}
+ <xhtml:link rel="alternate" hreflang="{{ version.lang }}" href="{{ site.url }}{{ version.url }}" />
+ {% endfor %}
+ <changefreq>monthly</changefreq>
+ </url>
+ {% endfor %}
+
+ {% for slide in site.slides %}
+ <url>
+ <loc>{{ site.url }}{{ slide.url }}</loc>
+ {% assign versions=site.slides | where:"ref", slide.ref %}
+ {% for version in versions %}
<xhtml:link rel="alternate" hreflang="{{ version.lang }}" href="{{ site.url }}{{ version.url }}" />
{% endfor %}
<changefreq>monthly</changefreq>