diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index 8eb8c111..e0be8d6f 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -69,6 +69,23 @@ jobs: mkdir -p _site/playground cp -a playground/dist/. _site/playground/ test -f _site/CNAME || echo "diagrams.mingrammer.com" > _site/CNAME + # Docusaurus only lists its own pages, so add the playground to the + # sitemap it generated. + python3 - <<'PY' + from pathlib import Path + + sitemap = Path("_site/sitemap.xml") + entry = ( + "https://diagrams.mingrammer.com/playground/" + "weekly0.8" + ) + xml = sitemap.read_text() + if "/playground/" not in xml: + sitemap.write_text(xml.replace("", entry + "")) + print("added playground to sitemap") + else: + print("playground already in sitemap") + PY - name: Deploy to gh-pages uses: peaceiris/actions-gh-pages@v4 diff --git a/playground/.gitignore b/playground/.gitignore index 309652bb..c7f06306 100644 --- a/playground/.gitignore +++ b/playground/.gitignore @@ -9,3 +9,4 @@ playwright-report/ vite.config.js vite.config.d.ts .omc/ +.vite/ diff --git a/playground/index.html b/playground/index.html index ce335507..a8530da6 100644 --- a/playground/index.html +++ b/playground/index.html @@ -3,9 +3,41 @@ - Diagrams Playground + Diagrams Playground — Diagram as Code in your browser + + + + + + + + + + + + + + + + + + -
+ +
+
+

Diagrams Playground

+

+ Write diagrams code in Python and see the rendered cloud architecture diagram + instantly — right in your browser, with nothing to install. +

+

+ Loading the playground… +

+ +

+ Documentation + · + GitHub +

+
+
diff --git a/playground/public/og-image.png b/playground/public/og-image.png new file mode 100644 index 00000000..ddb61afd Binary files /dev/null and b/playground/public/og-image.png differ diff --git a/playground/src/components/Toolbar.tsx b/playground/src/components/Toolbar.tsx index f29de8cb..e733e1c0 100644 --- a/playground/src/components/Toolbar.tsx +++ b/playground/src/components/Toolbar.tsx @@ -101,7 +101,9 @@ export default function Toolbar({ status, onShare, shared }: Props) { - Diagrams Playground + {/* The page's only h1 — the app is a single tool, and crawlers that do + run JS should still find a real heading. */} +

Diagrams Playground