diff options
-rw-r--r-- | src/build/i18n.mjs | 15 | ||||
-rw-r--r-- | src/build/index.mjs | 6 | ||||
-rw-r--r-- | src/build/rss.mjs | 8 |
3 files changed, 21 insertions, 8 deletions
diff --git a/src/build/i18n.mjs b/src/build/i18n.mjs index b348c09..09dd6e4 100644 --- a/src/build/i18n.mjs +++ b/src/build/i18n.mjs @@ -22,11 +22,18 @@ const i18n = { "2FA-discord-sur-pc.md", "duckduckgo-google-en-mieux.md", ], + rss_full: { + title: "ache: Blog personnel", + quick_description: + "Programmation, Algorithmique, Système, *pick you poison*", + description: `<b>Ceci est un flux RSS</b> à destination des agrégateurs de contenu.<br>\nEn tant qu'être humain vous cherchez certainement <a href="https://ache.one/fr/">mon site web</a><br>\n<br>\nCe flux contient tous mes écrits petits ou grands. Si vous cherchez à ne suivre que les articles les plus importants et d'une certaine qualité, il existe un <a href="https://ache.one/fr/rss-full.xml">Flux RSS qui ne contient que mes principaux articles.</a>`, + }, + rss: { title: "ache: Blog personnel", quick_description: "Programmation, Algorithmique, Système, *pick you poison*", - description: `<b>Ceci est un flux RSS</b> à destination des agrégateurs de contenu.<br>\nEn tant qu'être humain vous cherchez certainement <a href="https://ache.one/fr/">mon site web</a>.`, + description: `<b>Ceci est un flux RSS</b> à destination des agrégateurs de contenu.<br>\nEn tant qu'être humain vous cherchez certainement <a href="https://ache.one/fr/">mon site web</a><br>\n<br>\nCe flux ne contient que les articles, une version existe également avec tous mes écrits. <a href="https://ache.one/fr/rss-full.xml">Flux RSS avec les notes.</a>`, }, toc_keyword: "Sommaire", tag_desc: "Liste des articles ayant le tag", @@ -57,9 +64,13 @@ const i18n = { "web-image-formats.md", "c-language-quirks.md", ], + rss_full: { + title: "ache: Personal blog", + description: `<b>This is a RSS feed</b> for content agreagator.<br>\nAs a human being, you are certainly looking for <a href="https://ache.one/en/">my website</a><br>\n<br>\nThis RSS flux contains everything I write. If you only want to follow my main articles which are of certain quality, there is a <a href="https://ache.one/en/rss.xml">RSS flux with only articles.</a>`, + }, rss: { title: "ache: Personal blog", - description: `<b>This is a RSS feed</b> for content agreagator.<br>\nAs a human being, you are certainly looking for <a href="https://ache.one/en/">my website</a>.`, + description: `<b>This is a RSS feed</b> for content agreagator.<br>\nAs a human being, you are certainly looking for <a href="https://ache.one/en/">my website</a><br>\n<br>\nThis RSS flux contains only my articles, if you want to follow also my personnal notes, there is a <a href="https://ache.one/en/rss-full.xml">RSS flux with everything I write..</a>`, }, toc_keyword: "Table of contents", tag_desc: "List of articles with the tag", diff --git a/src/build/index.mjs b/src/build/index.mjs index e589101..26d2067 100644 --- a/src/build/index.mjs +++ b/src/build/index.mjs @@ -50,7 +50,9 @@ for (const lang in i18n) { // Same for notes const notes = notesAll.filter((note) => note.metaData.lang == lang); - for (const post of [...articles, ...notes]) { + const material = [...articles, ...notes]; + + for (const post of material) { const context = { svg, page_title: `${post.title} - ache`, @@ -138,7 +140,7 @@ for (const lang in i18n) { { console.log(`Create RSS Flux: ${lang}/rss-full.xml`); - const xmlFeed = getRSS(material, baseUrl, lang); + const xmlFeed = getRSS(material, baseUrl, lang, "rss_full"); fs.writeFileSync(`${lang}/rss-full.xml`, xmlFeed); links.push({ url: `${baseUrl}${lang}/rss-full.xml`, diff --git a/src/build/rss.mjs b/src/build/rss.mjs index 73b7803..ceca954 100644 --- a/src/build/rss.mjs +++ b/src/build/rss.mjs @@ -1,14 +1,14 @@ import RSS from "rss"; import i18n from "./i18n.mjs"; -const getRSS = (articles, baseUrl, lang) => { +const getRSS = (articles, baseUrl, lang, rssName) => { console.log(i18n[lang]["rss"]["title"]); const rssFeed = new RSS({ - title: i18n[lang]["rss"]["title"], - description: i18n[lang]["rss"]["description"], + title: i18n[lang][rssName || "rss"]["title"], + description: i18n[lang][rssName || "rss"]["description"], // eslint-disable-next-line camelcase custom_namespaces: { - visible_description: i18n[lang]["rss"]["description"], + visible_description: i18n[lang][rssName || "rss"]["description"], }, site_url: "https://ache.one", feed_url: `${baseUrl}rss.xml`, |