summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorache <ache@ache.one>2023-07-05 07:34:37 +0200
committerache <ache@ache.one>2023-07-05 07:34:37 +0200
commitd8f3be76af854acb58ea6ef9521dd90424117461 (patch)
tree0d9a6dec0d610a35f153b9361280dd821f4e4034 /src
parentFix table of contents (diff)
i18n for RSS
Diffstat (limited to 'src')
-rw-r--r--src/build/i18n.mjs14
-rw-r--r--src/build/index.mjs2
-rw-r--r--src/build/rss.mjs14
3 files changed, 23 insertions, 7 deletions
diff --git a/src/build/i18n.mjs b/src/build/i18n.mjs
index 7ecb2e1..25a6318 100644
--- a/src/build/i18n.mjs
+++ b/src/build/i18n.mjs
@@ -4,7 +4,7 @@ const i18n = {
intro: {
'description': 'Éternel étudiant en Math-Info.',
'about': 'Autodidacte passionné,<br><span class="type_wrap"><span class="type">désormais ingénieur.</span></span>',
- 'about_tags': 'GNU\Linux, C, C++, Python, Math, autohébergement, décentralisation, P2P, commun, ... <br> ',
+ 'about_tags': 'GNU\\Linux, C, C++, Python, Math, autohébergement, décentralisation, P2P, commun, ... <br> ',
},
title: {
'main': 'ache: Blog personnel',
@@ -18,13 +18,19 @@ const i18n = {
'2FA-discord-sur-pc.md',
'duckduckgo-google-en-mieux.md',
],
+ 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/>En tant qu'être humain vous cherchez certainement mon site <a href="https://ache.one">mon site web</a>.`
+ },
toc_keyword: "Sommaire"
},
en: {
intro: {
'description': 'Eternal student in computer science.',
+ 'quick_description': 'Programmation, Algorithmique, Système, *pick you poison*',
'about': 'Passionated self-taught person,<br><span class="type_wrap"><span class="type">now engineer.</span></span>',
- 'about_tags': 'GNU\Linux, C, C++, Python, Math, self-hosted, dececntralisation, P2P, ... <br>',
+ 'about_tags': 'GNU\\Linux, C, C++, Python, Math, self-hosted, dececntralisation, P2P, ... <br>',
},
title: {
'main': 'ache: Personnel blog',
@@ -35,6 +41,10 @@ const i18n = {
articles: [
'c-language-quirks.md',
],
+ rss: {
+ title: 'ache: Personal blog',
+ description: `<b>This is a RSS feed</b> for content agreagator.<br/>As an humain you may looking for my website <a href="https://ache.one">mon site web</a>.`
+ },
toc_keyword: "Table of contents"
}
}
diff --git a/src/build/index.mjs b/src/build/index.mjs
index 852eb8d..ad126a8 100644
--- a/src/build/index.mjs
+++ b/src/build/index.mjs
@@ -88,7 +88,7 @@ for (const lang in i18n) {
}
console.log(`Create RSS Flux: ${lang}/rss.xml`);
- const xmlFeed = getRSS(articles, baseUrl);
+ const xmlFeed = getRSS(articles, baseUrl, lang);
fs.writeFileSync(`${lang}/rss.xml`, xmlFeed);
{
diff --git a/src/build/rss.mjs b/src/build/rss.mjs
index 04b0393..4eec634 100644
--- a/src/build/rss.mjs
+++ b/src/build/rss.mjs
@@ -1,17 +1,23 @@
import RSS from 'rss';
+import i18n from './i18n.mjs';
-const getRSS = (articles, baseUrl) => {
+const getRSS = (articles, baseUrl, lang) => {
+ console.log(i18n[lang]['rss']['title']);
const rssFeed = new RSS({
- title: 'ache: Blog personnel',
- description: 'Programmation, Algorithmique, Système, *pick you poison*',
+ title: i18n[lang]['rss']['title'],
+ description: i18n[lang]['rss']['description'],
// eslint-disable-next-line camelcase
+ custom_namespaces: {
+ 'visible_description': i18n[lang]['rss']['description']
+ },
+ site_url: "https://ache.one",
feed_url: `${baseUrl}rss.xml`,
canonical: `${baseUrl}rss.xml`,
// eslint-disable-next-line camelcase
site_url: baseUrl,
// eslint-disable-next-line camelcase
image_url: `${baseUrl}ache.svg`,
- language: 'fr',
+ language: lang,
pubDate: (new Date().toLocaleString()),
ttl: '1440',
});