From 70d344c4f2e78c62f48c78aa3d46143dba79680d Mon Sep 17 00:00:00 2001 From: Szymon Halski Date: Thu, 20 Aug 2026 11:44:24 +0200 Subject: [PATCH 1/4] Add JSON-LD and a build-time llms.txt for the docs An Astro integration writes llms.txt from the pages just built, and the same module supplies Organization and SoftwareSourceCode structured data using the same @id as swmansion.com. The workflow fails if the file is missing or empty. --- .github/workflows/landing-publish.yml | 13 +++ landing/astro.config.mjs | 4 +- landing/src/layouts/Layout.astro | 2 + landing/swm-geo.mjs | 119 ++++++++++++++++++++++++++ 4 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 landing/swm-geo.mjs diff --git a/.github/workflows/landing-publish.yml b/.github/workflows/landing-publish.yml index 14b014344..152391b5d 100644 --- a/.github/workflows/landing-publish.yml +++ b/.github/workflows/landing-publish.yml @@ -32,6 +32,19 @@ jobs: YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY || '' }} run: npm run build + - name: Check docs llms.txt + run: | + file=landing/dist/llms.txt + if [ ! -s "$file" ]; then + echo "::error::$file is missing or empty" + exit 1 + fi + count=$(grep -cE '^- \[[^]]+\]\(https://docs\.swmansion\.com/live-debugger/[^)]+\)' "$file" || true) + if [ "$count" -eq 0 ]; then + echo "::error::$file lists no pages" + exit 1 + fi + echo "llms.txt lists $count pages" - name: Publish generated content to GitHub Pages uses: JamesIves/github-pages-deploy-action@releases/v3 with: diff --git a/landing/astro.config.mjs b/landing/astro.config.mjs index 79e648f78..116d60448 100644 --- a/landing/astro.config.mjs +++ b/landing/astro.config.mjs @@ -1,11 +1,13 @@ // @ts-check import { defineConfig, envField, fontProviders } from "astro/config"; +import swmGeo, { structuredData } from "./swm-geo.mjs"; import react from "@astrojs/react"; import tailwindcss from "@tailwindcss/vite"; // https://astro.build/config export default defineConfig({ - integrations: [react()], + integrations: [ + swmGeo({ name: "LiveDebugger", description: "LiveView debugging made simple", repository: "live-debugger" }),react()], env: { schema: { ENABLE_ANALYTICS: envField.string({ diff --git a/landing/src/layouts/Layout.astro b/landing/src/layouts/Layout.astro index 290f87b23..a8cced5ac 100644 --- a/landing/src/layouts/Layout.astro +++ b/landing/src/layouts/Layout.astro @@ -1,4 +1,5 @@ --- +import { structuredData } from '../../swm-geo.mjs'; import "../styles/global.css"; import { Font } from "astro:assets"; import { Header } from "@/components/ui/Header"; @@ -64,6 +65,7 @@ const enableAnalytics = ) } +