diff --git a/build.js b/build.js index 15d298cc5217a073ab8117812fa21fd909a8f555..a675f9f6ec648e21dbb310aaf4ceb5190197eb96 100644 --- a/build.js +++ b/build.js @@ -2,7 +2,6 @@ "use strict"; - const fs = require("fs"); const browserify = require("browserify"); const config = require("./config"); @@ -100,20 +99,34 @@ function getPageHtml(pageName, pageMeta) { const { key, defaultValue } = entry; html = html.replace( html.match(getOgMetaSearchRegex(key)), - `<meta property="og:${key}" content="${pageOgMeta[key] || defaultValue}" />` + `<meta property="og:${key}" content="${ + pageOgMeta[key] || defaultValue + }" name="${key}"/>` ); }); - // TODO handle addition og meta + const additionalOgMeta = Object.keys(pageMeta.open_graph).filter( + k => !requiredOgMeta.map(rom => rom.key).includes(k) + ); + + if (additionalOgMeta.length > 0) { + html = html.replace( + "</head>", + `${additionalOgMeta + .map( + k => + `<meta property="og:${k}" content="${pageMeta.open_graph[k]}" name="${k}"/>` + ) + .join("\n")}</head>` + ); + } }; setMeta("description", pageMeta.description); setTitle(); setStyleSheet(); setJs(); setAdditionalMeta( - Object.entries(pageMeta).filter( - kv => !build_conf.default_meta_keys.includes(kv[0]) - ) + Object.entries(pageMeta).filter(kv => !build_conf.default_meta_keys.includes(kv[0])) ); setOgMeta(); return html; diff --git a/public/education/index.html b/public/education/index.html index 660916db0a66ac811e709050940b13057055e47f..3d0de7d554e194156723d082450b6aa79ac2406d 100644 --- a/public/education/index.html +++ b/public/education/index.html @@ -6,16 +6,15 @@ <meta name="description" content="Animations autour de la création de jeux vidéos, vulgarisation numérique. Découvrez nos initiatives pédagogiques."/> <!-- Open Graph Protocol meta data --> - <meta property="og:title" content="Kuadrado Software | Pédagogie" /> - <meta property="og:description" content="Animations autour de la création de jeux vidéos, vulgarisation numérique. Découvrez nos initiatives pédagogiques." /> - <meta property="og:type" content="website" /> - <meta property="og:url" content="https://kuadrado-software.fr/education" /> - <meta property="og:image" content="https://kuadrado-software.fr/assets/images/brain.svg" /> - <meta property="og:locale" content="fr_FR" /> + <meta property="og:title" content="Kuadrado Software | Pédagogie" name="title"/> + <meta property="og:description" content="Animations autour de la création de jeux vidéos, vulgarisation numérique. Découvrez nos initiatives pédagogiques." name="description"/> + <meta property="og:type" content="website" name="type"/> + <meta property="og:url" content="https://kuadrado-software.fr name=url/education" name="url"/> + <meta property="og:image" content="https://kuadrado-software.fr/assets/images/brain.svg" name="image"/> + <meta property="og:locale" content="fr_FR name=locale" name="locale"/> <!-- English translation not ready yet --> <!-- <meta property="og:locale:alternate" content="en_GB" /> --> - <!-- END OGP --> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> diff --git a/public/games/index.html b/public/games/index.html index eb16d90df4b2b05bf4d1ba0c26c8895efa38a232..c4b3946a8a91a1a4cc87ae2af8b52d81a4b956ba 100644 --- a/public/games/index.html +++ b/public/games/index.html @@ -6,16 +6,15 @@ <meta name="description" content="Création de jeux vidéos indépendants. Jeux web, PC et projets en cours de développement"/> <!-- Open Graph Protocol meta data --> - <meta property="og:title" content="Kuadrado Software | Jeux" /> - <meta property="og:description" content="Création de jeux vidéos indépendants. Jeux web, PC et projets en cours de développement" /> - <meta property="og:type" content="website" /> - <meta property="og:url" content="https://kuadrado-software.fr/games" /> - <meta property="og:image" content="https://kuadrado-software.fr/assets/images/game_controller.svg" /> - <meta property="og:locale" content="fr_FR" /> + <meta property="og:title" content="Kuadrado Software | Jeux" name="title"/> + <meta property="og:description" content="Création de jeux vidéos indépendants. Jeux web, PC et projets en cours de développement" name="description"/> + <meta property="og:type" content="website" name="type"/> + <meta property="og:url" content="https://kuadrado-software.fr name=url/games" name="url"/> + <meta property="og:image" content="https://kuadrado-software.fr/assets/images/game_controller.svg" name="image"/> + <meta property="og:locale" content="fr_FR name=locale" name="locale"/> <!-- English translation not ready yet --> <!-- <meta property="og:locale:alternate" content="en_GB" /> --> - <!-- END OGP --> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> diff --git a/public/index.html b/public/index.html index 76d6135a6db33aacd96a973dd3a7171344119015..31d4521a207d3691bd1f466801c2f05046af49f6 100644 --- a/public/index.html +++ b/public/index.html @@ -9,22 +9,23 @@ /> <!-- Open Graph Protocol meta data --> - <meta property="og:title" content="Kuadrado Software" /> + <meta property="og:title" content="Kuadrado Software" name="title"/> <meta property="og:description" content="Créations numériques, jeu vidéo, web, software et pédagogie. Made in Ardèche, Vernoux en Vivarais." + name="description" /> - <meta property="og:type" content="website" /> - <meta property="og:url" content="https://kuadrado-software.fr" /> + <meta property="og:type" content="website" name="type"/> + <meta property="og:url" content="https://kuadrado-software.fr" name="url"/> <meta property="og:image" content="https://kuadrado-software.fr/assets/images/logo_kuadrado.svg" + name="image" /> - <meta property="og:locale" content="fr_FR" /> + <meta property="og:locale" content="fr_FR" name="locale"/> <!-- English translation not ready yet --> <!-- <meta property="og:locale:alternate" content="en_GB" /> --> - <!-- END OGP --> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> diff --git a/public/software-development/index.html b/public/software-development/index.html index e2c3f8d070ee490ea64551ae323cae459af3a866..dc086856ece0593645a5b2ceb1336aaecd4cc81c 100644 --- a/public/software-development/index.html +++ b/public/software-development/index.html @@ -6,16 +6,15 @@ <meta name="description" content="Développement web, moteur de jeux, outillage logiciel, retrouvez nos projets en détail."/> <!-- Open Graph Protocol meta data --> - <meta property="og:title" content="Kuadrado Software | Software" /> - <meta property="og:description" content="Développement web, moteur de jeux, outillage logiciel, retrouvez nos projets en détail." /> - <meta property="og:type" content="website" /> - <meta property="og:url" content="https://kuadrado-software.fr/software-development" /> - <meta property="og:image" content="https://kuadrado-software.fr/assets/images/meca_proc.svg" /> - <meta property="og:locale" content="fr_FR" /> + <meta property="og:title" content="Kuadrado Software | Software" name="title"/> + <meta property="og:description" content="Développement web, moteur de jeux, outillage logiciel, retrouvez nos projets en détail." name="description"/> + <meta property="og:type" content="website" name="type"/> + <meta property="og:url" content="https://kuadrado-software.fr name=url/software-development" name="url"/> + <meta property="og:image" content="https://kuadrado-software.fr/assets/images/meca_proc.svg" name="image"/> + <meta property="og:locale" content="fr_FR name=locale" name="locale"/> <!-- English translation not ready yet --> <!-- <meta property="og:locale:alternate" content="en_GB" /> --> - <!-- END OGP --> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> diff --git a/src/pages/games/meta.json b/src/pages/games/meta.json index ae505b3e689b95aa25ba51e21509fe32f2c8a1f4..5651a6f30aee7f08c72bb757498ec449a824ec5b 100644 --- a/src/pages/games/meta.json +++ b/src/pages/games/meta.json @@ -6,4 +6,4 @@ "description": "Création de jeux vidéos indépendants. Jeux web, PC et projets en cours de développement", "image": "https://kuadrado-software.fr/assets/images/game_controller.svg" } -} \ No newline at end of file +}