From d933c63c5ecb50b50ca19708b712d065107126f8 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 12 Jun 2023 09:12:59 +0200 Subject: Filter generated articles --- src/build/index.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/build/index.mjs b/src/build/index.mjs index 7a47c8e..852eb8d 100644 --- a/src/build/index.mjs +++ b/src/build/index.mjs @@ -1,3 +1,4 @@ +import process from 'node:process'; import fs from 'node:fs'; import mustache from 'mustache'; import loadSVG from './load-svg.mjs'; @@ -28,7 +29,9 @@ const svg = loadSVG(); for (const lang in i18n) { const tagsArticle = new Map(); - const articles = loadMD(i18n[lang].articles, 'articles', lang); + const filter = process.argv.slice(2); + const listArticle = (filter.length > 0) ? i18n[lang].articles.filter((article) => filter.includes(article.name)) : i18n[lang].articles; + const articles = loadMD(listArticle, 'articles', lang); for (const article of articles) { const context = { -- cgit v1.2.3