Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,30 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import sitemap from '@astrojs/sitemap';
import { googleAnalyticsInlineScript, googleAnalyticsScriptSrc } from './site.config.mjs';

export default defineConfig({
site: 'https://simfile.org',
integrations: [
sitemap(),
sitemap({
filter: (page) => !page.endsWith('/city-lab/'),
}),
starlight({
title: 'Simfile',
description: 'Deterministic simulation worlds for agentic organizations.',
head: [
{
tag: 'script',
attrs: {
async: true,
src: googleAnalyticsScriptSrc(),
},
},
{
tag: 'script',
content: googleAnalyticsInlineScript(),
},
],
components: {
Header: './src/components/DocsHeader.astro',
ThemeSelect: './src/components/EmptyThemeSelect.astro',
Expand Down
14 changes: 14 additions & 0 deletions website/site.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const googleTagId = 'G-LZQ6G6JGJE';

export function googleAnalyticsScriptSrc() {
return `https://www.googletagmanager.com/gtag/js?id=${googleTagId}`;
}

export function googleAnalyticsInlineScript() {
return [
'window.dataLayer = window.dataLayer || [];',
'function gtag(){dataLayer.push(arguments);}',
"gtag('js', new Date());",
`gtag('config', ${JSON.stringify(googleTagId)});`,
].join('\n');
}
9 changes: 9 additions & 0 deletions website/src/components/GoogleAnalytics.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
import { googleAnalyticsInlineScript, googleAnalyticsScriptSrc } from '../../site.config.mjs';

const scriptSrc = googleAnalyticsScriptSrc();
const inlineScript = googleAnalyticsInlineScript();
---

<script async src={scriptSrc}></script>
<script is:inline set:html={inlineScript}></script>
2 changes: 2 additions & 0 deletions website/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import GlyphCity from '../components/GlyphCity.astro';
import GoogleAnalytics from '../components/GoogleAnalytics.astro';
import LandingWorldSection from '../components/LandingWorldSection.astro';
import SiteHeader from '../components/SiteHeader.astro';
import '../styles/landing.css';
Expand Down Expand Up @@ -30,6 +31,7 @@ import '../styles/landing.css';
<meta property="og:image:alt" content="The Simfile viewer showing a seeded idea reaching a second AI agent." />
<meta property="og:locale" content="en_US" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<GoogleAnalytics />
</head>
<body>
<SiteHeader />
Expand Down
Loading