From 7d0d4e2e0df6a344c20dd6d204f9257b8e5175bc Mon Sep 17 00:00:00 2001 From: ache Date: Wed, 4 May 2022 20:39:27 +0200 Subject: Implement Canonical --- src/build/index.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/build/index.mjs') diff --git a/src/build/index.mjs b/src/build/index.mjs index d96eca3..7b8c8dc 100644 --- a/src/build/index.mjs +++ b/src/build/index.mjs @@ -41,7 +41,6 @@ const loadMD = (listFile, suffix) => { const readMore = h('a', 'Lire plus...'); readMore.properties.href = `${suffix}/${file.slice(0, -3)}`; - readMore.properties.role = 'expend'; readMore.properties.for = domTitle; listContent.push({ @@ -63,6 +62,7 @@ const leftPanelTmpl = fs.readFileSync('src/templates/left.tmpl', 'utf8'); const headerTmpl = fs.readFileSync('src/templates/header.tmpl', 'utf8'); const articleTmpl = fs.readFileSync('src/templates/article.tmpl', 'utf8'); const indexTmpl = fs.readFileSync('src/templates/index.tmpl', 'utf8'); +const baseUrl = 'https://ache.one/'; const partials = { header: headerTmpl, @@ -77,6 +77,7 @@ for (const article of articles) { const context = { svg, title: `${article.title} - ache`, + canonical: article.canonical, content: article.content, domTitle: article.domTitle, }; @@ -87,12 +88,13 @@ for (const article of articles) { } console.log('Create : rss.xml'); -const xmlFeed = getRSS(articles); +const xmlFeed = getRSS(articles, baseUrl); fs.writeFileSync('rss.xml', xmlFeed); { const context = { title: 'ache: Blog personnel', + canonical: baseUrl, svg, articles, }; -- cgit v1.2.3