Add Rybbit analytics

This commit is contained in:
Neeldhara Misra 2026-07-06 02:01:47 +05:30
parent 0e8f8ab0dd
commit 8c774cb245
2 changed files with 8 additions and 0 deletions

View file

@ -16,3 +16,8 @@ npm run build
```
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`.

View file

@ -44,6 +44,8 @@ const defaultNavItems: NavItem[] = [
const navItems = suppliedNavItems ?? defaultNavItems;
const navVariant = suppliedNavItems ? "standard" : "toggle";
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 isCurrent = (href: string) => pathname === href;
const getMenuGroups = (items: NavLink[]) => {
@ -90,6 +92,7 @@ const getMenuLayout = (item: Extract<NavItem, { items: NavLink[] }>) => {
<meta name="description" content={description} />
<title>{pageTitle}</title>
<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>
<body>
<a class="skip-link" href="#content">Skip to content</a>