| | |
| | | } else if (cfg.analytics?.provider === "umami") { |
| | | componentResources.afterDOMLoaded.push(` |
| | | const umamiScript = document.createElement("script") |
| | | umamiScript.src = ${cfg.analytics.host} ?? "https://analytics.umami.is/script.js" |
| | | umamiScript.src = "${cfg.analytics.host}" ?? "https://analytics.umami.is/script.js" |
| | | umamiScript.setAttribute("data-website-id", "${cfg.analytics.websiteId}") |
| | | umamiScript.async = true |
| | | |
| | |
| | | const cfg = ctx.cfg.configuration |
| | | // component specific scripts and styles |
| | | const componentResources = getComponentResources(ctx) |
| | | // important that this goes *after* component scripts |
| | | // as the "nav" event gets triggered here and we should make sure |
| | | // that everyone else had the chance to register a listener for it |
| | | |
| | | let googleFontsStyleSheet = "" |
| | | if (fontOrigin === "local") { |
| | | // let the user do it themselves in css |
| | |
| | | } |
| | | } |
| | | |
| | | // important that this goes *after* component scripts |
| | | // as the "nav" event gets triggered here and we should make sure |
| | | // that everyone else had the chance to register a listener for it |
| | | addGlobalPageResources(ctx, resources, componentResources) |
| | | |
| | | const stylesheet = joinStyles( |
| | | ctx.cfg.configuration.theme, |
| | | ...componentResources.css, |
| | | googleFontsStyleSheet, |
| | | ...componentResources.css, |
| | | styles, |
| | | ) |
| | | const [prescript, postscript] = await Promise.all([ |