page: add plausible script enabled by env variable

This commit is contained in:
wukko 2024-03-16 22:03:54 +06:00
parent 1fdc25e2ad
commit 3c18b76d3c

View file

@ -74,6 +74,14 @@ export default function(obj) {
<link rel="preload" href="fonts/notosansmono.css" as="style">
<link rel="preload" href="assets/meowbalt/error.png" as="image">
<link rel="preload" href="assets/meowbalt/question.png" as="image">
${process.env.PLAUSIBLE_HOSTNAME ?
`<script
defer
data-domain="${new URL(process.env.WEB_URL).hostname}"
src="https://${process.env.PLAUSIBLE_HOSTNAME}/js/script.js"
></script>`
: ''}
</head>
<body id="cobalt-body" ${platform === "d" ? 'class="desktop"' : ''}>
<noscript>