Live video on the AT Protocol

Merge pull request #840 from streamplace/natb/workers-docs

feat: wrangler.toml for static docs deployment

authored by

natalie and committed by
GitHub
734fadda b24ba4a3

+51 -2
+2
js/docs/_redirects
··· 1 + / /docs 301 2 + /docs/favicon.ico https://stream.place/favicon.ico 301
+5 -2
js/docs/astro.config.mjs
··· 1 1 // @ts-check 2 2 import starlight from "@astrojs/starlight"; 3 - import { defineConfig } from "astro/config"; 3 + import { defineConfig, passthroughImageService } from "astro/config"; 4 4 import starlightOpenAPI, { openAPISidebarGroups } from "starlight-openapi"; 5 5 6 6 // https://astro.build/config 7 7 export default defineConfig({ 8 8 base: "/docs", 9 + image: { 10 + service: passthroughImageService(), 11 + }, 9 12 integrations: [ 10 13 starlight({ 11 14 title: "Streamplace Docs", ··· 44 47 ]), 45 48 ], 46 49 sidebar: [ 47 - { label: "← Back to Streamplace", link: "/../" }, 50 + { label: "← Back to Streamplace", link: "/back-to-home" }, 48 51 { 49 52 label: "How Streamplace Works (Blog)", 50 53 link: "https://blog.stream.place/",
+22
js/docs/src/pages/back-to-home.astro
··· 1 + --- 2 + import "../styles/custom-font-face.css" 3 + import "@fontsource/atkinson-hyperlegible-next/400.css" 4 + import "@fontsource/atkinson-hyperlegible-next/600.css" 5 + --- 6 + <style> 7 + * { 8 + font-family: "Atkinson Hyperlegible Next"; 9 + } 10 + </style> 11 + 12 + <script is:inline> 13 + let hostname = window.location.host 14 + const redirectUrl = hostname.endsWith('.stream.place') 15 + ? 'https://stream.place' 16 + : '/'; 17 + window.location.href = redirectUrl; 18 + </script> 19 + <body style="display: flex; color: white; justify-content: center; align-items: center; height: 100vh; background-color: #181818; flex: 1; flex-direction: column;"> 20 + <h1>Redirecting to Streamplace...</h1> 21 + <a href="https://stream.place" style="color: lightskyblue">Click here if you are not redirected automatically</a> 22 + </body>
+13
pkg/config/git/git.go
··· 82 82 homebrew := flag.Bool("homebrew", false, "print homebrew formula") 83 83 84 84 flag.Parse() 85 + 86 + // handle CF_PAGES environment fallback 87 + if os.Getenv("CF_PAGES") != "" && *javascript { 88 + out := `export const version = "unknown"; export const buildTime = 0; export const uuid = "00000000-0000-0000-0000-000000000000";` 89 + if *output != "" { 90 + if err := os.WriteFile(*output, []byte(out), 0644); err != nil { 91 + return err 92 + } 93 + } else { 94 + fmt.Print(out) 95 + } 96 + return nil 97 + } 85 98 r, err := git.PlainOpenWithOptions(".", &git.PlainOpenOptions{DetectDotGit: true}) 86 99 if err != nil { 87 100 return err
+9
wrangler.toml
··· 1 + name = "streamplace-docs" 2 + compatibility_date = "2025-04-01" 3 + 4 + [assets] 5 + directory = "./js/docs/dist/" 6 + not_found_handling = "404-page" 7 + 8 + [build] 9 + command = "pnpm install --filter=streamplace-docs... && cd js/docs && astro build --outDir ./dist/docs && cp ./_redirects ./dist/_redirects && cp ./src/assets/cube.png ./dist/favicon.ico"