diff --git a/build.js b/build.js index 3a551ec..8c8b477 100644 --- a/build.js +++ b/build.js @@ -41,6 +41,15 @@ data.languages.forEach(lang => { // SEO Dynamic Tags const canonicalUrl = `${fullDomain}${fullBasePath}/${lang}/index.html`; html = html.replace(/{{canonicalUrl}}/g, canonicalUrl); + + // Generate hreflang tags + const hreflangTags = data.languages.map(l => { + return ``; + }).join('\n '); + // Add x-default (usually English) + const xDefault = ``; + html = html.replace(/{{hreflangTags}}/g, hreflangTags + '\n ' + xDefault); + // Use a default OG image or generate one (placeholder for now) html = html.replace(/{{ogImage}}/g, `${fullDomain}${fullBasePath}/assets/og-shared.jpg`); @@ -195,7 +204,7 @@ const homeHtml = `