generated from nhcarrigan/template
feat: track domain, path, title
This commit is contained in:
@ -4,6 +4,10 @@ import { Icon } from "@astrojs/starlight/components";
|
||||
|
||||
{/* This is intentionally inlined to avoid FOUC. */}
|
||||
<script is:inline>
|
||||
const analytics = document.getElementById('analytics');
|
||||
const title = document.querySelector('title');
|
||||
analytics.setAttribute('event-page', title.innerText ?? "NHCarrigan Docs");
|
||||
analytics.setAttribute('event-path', window.location.pathname);
|
||||
window.StarlightThemeProvider = (() => {
|
||||
const storedTheme =
|
||||
typeof localStorage !== 'undefined' && localStorage.getItem('starlight-theme');
|
||||
|
Reference in New Issue
Block a user