Add Rybbit analytics
This commit is contained in:
parent
0e8f8ab0dd
commit
8c774cb245
2 changed files with 8 additions and 0 deletions
|
|
@ -16,3 +16,8 @@ npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
The site is static and builds to `dist/`.
|
The site is static and builds to `dist/`.
|
||||||
|
|
||||||
|
## Analytics
|
||||||
|
|
||||||
|
Production builds include Rybbit analytics through `https://analytics.neeldhara.cloud/`.
|
||||||
|
The site is registered as `events.neeldhara.com` in the `Websites` organization with site id `12`.
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ const defaultNavItems: NavItem[] = [
|
||||||
const navItems = suppliedNavItems ?? defaultNavItems;
|
const navItems = suppliedNavItems ?? defaultNavItems;
|
||||||
const navVariant = suppliedNavItems ? "standard" : "toggle";
|
const navVariant = suppliedNavItems ? "standard" : "toggle";
|
||||||
const pathname = Astro.url.pathname;
|
const pathname = Astro.url.pathname;
|
||||||
|
const rybbitScriptSrc = "https://analytics.neeldhara.cloud/api/script.js";
|
||||||
|
const rybbitSiteId = "12";
|
||||||
const isMenu = (item: NavItem): item is Extract<NavItem, { items: NavLink[] }> => "items" in item;
|
const isMenu = (item: NavItem): item is Extract<NavItem, { items: NavLink[] }> => "items" in item;
|
||||||
const isCurrent = (href: string) => pathname === href;
|
const isCurrent = (href: string) => pathname === href;
|
||||||
const getMenuGroups = (items: NavLink[]) => {
|
const getMenuGroups = (items: NavLink[]) => {
|
||||||
|
|
@ -90,6 +92,7 @@ const getMenuLayout = (item: Extract<NavItem, { items: NavLink[] }>) => {
|
||||||
<meta name="description" content={description} />
|
<meta name="description" content={description} />
|
||||||
<title>{pageTitle}</title>
|
<title>{pageTitle}</title>
|
||||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
||||||
|
{import.meta.env.PROD && <script is:inline src={rybbitScriptSrc} data-site-id={rybbitSiteId} defer></script>}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a class="skip-link" href="#content">Skip to content</a>
|
<a class="skip-link" href="#content">Skip to content</a>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue