diff --git a/build.js b/build.js index 6bdbd9a8f3adaee57db3f74f2b4a4f801bc42d02..cda3ae56ac215fcf2f789c0f3077824ebd52f365 100644 --- a/build.js +++ b/build.js @@ -22,7 +22,7 @@ function getPageHtml(pageName, pageMeta) { const setMeta = function (metaName, value) { return html.replace( html.match(new RegExp(`<meta.+name="${metaName}".+>`, "g")), - `<meta name="${metaName}" content="${value}">` + `<meta name="${metaName}" content="${value}"/>` ); }; const setTitle = function (value) { @@ -43,10 +43,25 @@ function getPageHtml(pageName, pageMeta) { `<script type="text/javascript" src="./${pageName}.js"></script>` ); }; + const setAdditionalMeta = function (metas) { + return html.replace( + "</head>", + `${metas + .map(kv => { + const [name, content] = kv; + return `<meta name="${name}" content="${content}"/>`; + }) + .join("\n")}</head>` + ); + }; html = setMeta("description", pageMeta.description); html = setTitle(pageMeta.title); html = setStyleSheet(); html = setJs(); + html = setAdditionalMeta( + Object.entries(pageMeta).filter(kv => kv[0] !== "description" && kv[0] !== "title") + ); + return html; } diff --git a/public/education/index.html b/public/education/index.html index 23ca44075947475b3cf1bd64afa36b789753c766..51e755d5417028a4626333480957198d75d3c796 100644 --- a/public/education/index.html +++ b/public/education/index.html @@ -3,7 +3,7 @@ <head> <meta charset="utf-8" /> <title>Kuadrado Software | Pédagogie</title> - <meta name="description" content="Animations autour de la création de jeux vidéos, vulgarisation numérique. Découvrez nos initiatives pédagogiques."> + <meta name="description" content="Animations autour de la création de jeux vidéos, vulgarisation numérique. Découvrez nos initiatives pédagogiques."/> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg"> <link href="/style/style.css" rel="stylesheet" /> diff --git a/public/games/index.html b/public/games/index.html index e68f86fcf0feaecf73a39109338dfc8b28a23fa0..5fbf110cf908957e8fe2678af6573187595ae8fb 100644 --- a/public/games/index.html +++ b/public/games/index.html @@ -3,7 +3,7 @@ <head> <meta charset="utf-8" /> <title>Kuadrado Software | Jeux</title> - <meta name="description" content="Création de jeux vidéos indépendants. Jeux web, PC et projets en cours de développement"> + <meta name="description" content="Création de jeux vidéos indépendants. Jeux web, PC et projets en cours de développement"/> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg"> <link href="/style/style.css" rel="stylesheet" /> diff --git a/public/software-development/index.html b/public/software-development/index.html index 431e009c095e74640fe12867f63250b997add5c4..593f1fb7b23587c6076a6e566a514f609a90d791 100644 --- a/public/software-development/index.html +++ b/public/software-development/index.html @@ -3,7 +3,7 @@ <head> <meta charset="utf-8" /> <title>Kuadrado Software | Software</title> - <meta name="description" content="Développement web, moteur de jeux, outillage logiciel, retrouvez nos projets en détail."> + <meta name="description" content="Développement web, moteur de jeux, outillage logiciel, retrouvez nos projets en détail."/> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg"> <link href="/style/style.css" rel="stylesheet" />