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
42 changes: 42 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy site

on:
push:
branches: [main]
paths: ["site/**", ".github/workflows/site.yml"]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: deploy-site
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: site/package-lock.json

- name: Install
working-directory: site
run: npm ci

- name: Build
working-directory: site
env:
PUBLIC_POSTHOG_KEY: ${{ vars.PUBLIC_POSTHOG_KEY }}
run: npm run build

- name: Deploy
working-directory: site
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: npx wrangler deploy
2 changes: 2 additions & 0 deletions site/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export default defineConfig({
"Write an AI coding skill once, run it in every AI coding assistant.",
logo: { src: "./src/assets/logo-mark.svg", alt: "adeptability" },
favicon: "/favicon.svg",
// Head override adds the bundled PostHog script to every docs page.
components: { Head: "./src/components/Head.astro" },
// Gold accent retheme, matching the landing page + neon-gold logo.
customCss: ["./src/styles/starlight-gold.css"],
// Social preview image on every docs page. Starlight already emits
Expand Down
129 changes: 129 additions & 0 deletions site/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@fontsource/jetbrains-mono": "^5.3.0",
"@fontsource/space-grotesk": "^5.3.0",
"astro": "^7.1.3",
"posthog-js": "^1.407.2",
"sharp": "^0.33.5"
},
"devDependencies": {
Expand Down
10 changes: 10 additions & 0 deletions site/src/components/Head.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
// Starlight Head override: default head plus the bundled PostHog script,
// so every docs page ships analytics without an external snippet.
import Default from '@astrojs/starlight/components/Head.astro';
---

<Default><slot /></Default>
<script>
import '../scripts/analytics';
</script>
5 changes: 5 additions & 0 deletions site/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ const jsonLd = {

<!-- Structured data (JSON-LD) -->
<script type="application/ld+json" set:html={JSON.stringify(jsonLd)} />

<!-- PostHog analytics (bundled from npm; key injected at build time) -->
<script>
import '../scripts/analytics';
</script>
</head>
<body>
<a class="skip-link" href="#main">Skip to content</a>
Expand Down
12 changes: 12 additions & 0 deletions site/src/scripts/analytics.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// PostHog analytics, bundled from npm (no external script load).
// The key is injected at build time from PUBLIC_POSTHOG_KEY (site/.env
// locally, a GitHub Actions variable in CI). No key = analytics off.
import posthog from 'posthog-js';

const key = import.meta.env.PUBLIC_POSTHOG_KEY;
if (key) {
posthog.init(key, {
api_host: 'https://us.i.posthog.com',
defaults: '2025-05-24',
});
}
Loading