| | |
| | | import plausibleScript from "../../components/scripts/plausible.inline" |
| | | // @ts-ignore |
| | | import popoverScript from "../../components/scripts/popover.inline" |
| | | import styles from "../../styles/base.scss" |
| | | import styles from "../../styles/custom.scss" |
| | | import popoverStyle from "../../components/styles/popover.scss" |
| | | import { BuildCtx } from "../../util/ctx" |
| | | import { StaticResources } from "../../util/resources" |
| | |
| | | });`) |
| | | } else if (cfg.analytics?.provider === "plausible") { |
| | | componentResources.afterDOMLoaded.push(plausibleScript) |
| | | } else if (cfg.analytics?.provider === "umami") { |
| | | componentResources.afterDOMLoaded.push(` |
| | | const umamiScript = document.createElement("script") |
| | | umamiScript.src = "https://analytics.umami.is/script.js" |
| | | umamiScript.setAttribute("data-website-id", "${cfg.analytics.websiteId}") |
| | | umamiScript.async = true |
| | | |
| | | document.head.appendChild(umamiScript) |
| | | `) |
| | | } |
| | | |
| | | if (cfg.enableSPA) { |
| | |
| | | loadTime: "afterDOMReady", |
| | | contentType: "inline", |
| | | script: ` |
| | | const socket = new WebSocket('${wsUrl}'') |
| | | const socket = new WebSocket('${wsUrl}') |
| | | socket.addEventListener('message', () => document.location.reload()) |
| | | `, |
| | | }) |
| | |
| | | |
| | | addGlobalPageResources(ctx, resources, componentResources) |
| | | |
| | | const stylesheet = joinStyles(ctx.cfg.configuration.theme, styles, ...componentResources.css) |
| | | const stylesheet = joinStyles(ctx.cfg.configuration.theme, ...componentResources.css, styles) |
| | | const prescript = joinScripts(componentResources.beforeDOMLoaded) |
| | | const postscript = joinScripts(componentResources.afterDOMLoaded) |
| | | const fps = await Promise.all([ |