radiant-docs 0.1.33 → 0.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/astro.config.mjs +25 -0
- package/template/package-lock.json +1027 -513
- package/template/package.json +3 -2
- package/template/scripts/generate-proxy-allowed-origins.mjs +217 -0
- package/template/scripts/generate-robots-txt.mjs +19 -0
- package/template/scripts/stamp-image-versions.mjs +63 -11
- package/template/src/components/Header.astro +4 -4
- package/template/src/components/LogoLink.astro +2 -1
- package/template/src/components/SidebarDropdown.astro +3 -3
- package/template/src/components/SidebarGroup.astro +3 -0
- package/template/src/components/SidebarMenu.astro +14 -1
- package/template/src/components/SidebarSubgroup.astro +35 -12
- package/template/src/components/chat/AskAiWidget.tsx +7 -3
- package/template/src/components/endpoint/PlaygroundButton.astro +2 -2
- package/template/src/components/endpoint/PlaygroundForm.astro +20 -16
- package/template/src/components/sidebar/SidebarEndpointLink.astro +18 -15
- package/template/src/components/sidebar/SidebarOpenApiPageLink.astro +56 -0
- package/template/src/components/ui/Icon.astro +2 -1
- package/template/src/components/user/Image.astro +4 -0
- package/template/src/layouts/Layout.astro +8 -3
- package/template/src/lib/pagefind.ts +2 -1
- package/template/src/lib/routes.ts +134 -58
- package/template/src/lib/static-asset-url.ts +62 -0
- package/template/src/lib/utils.ts +48 -0
- package/template/src/lib/validation.ts +115 -27
- package/template/scripts/rewrite-static-asset-host.mjs +0 -408
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import { defineConfig } from "astro/config";
|
|
3
|
+
import sitemap from "@astrojs/sitemap";
|
|
3
4
|
import tailwindcss from "@tailwindcss/vite";
|
|
4
5
|
import mdx from "@astrojs/mdx";
|
|
5
6
|
import alpine from "@astrojs/alpinejs";
|
|
@@ -258,6 +259,28 @@ const configuredSite =
|
|
|
258
259
|
? process.env.DOCS_SITE_URL.trim()
|
|
259
260
|
: undefined;
|
|
260
261
|
|
|
262
|
+
const configuredStaticAssetHost =
|
|
263
|
+
typeof process.env.STATIC_ASSET_HOST === "string" &&
|
|
264
|
+
process.env.STATIC_ASSET_HOST.trim().length > 0
|
|
265
|
+
? process.env.STATIC_ASSET_HOST.trim().replace(/\/+$/, "")
|
|
266
|
+
: undefined;
|
|
267
|
+
|
|
268
|
+
const configuredStaticAssetPrefix =
|
|
269
|
+
typeof process.env.R2_BUCKET_PREFIX === "string" &&
|
|
270
|
+
process.env.R2_BUCKET_PREFIX.trim().length > 0
|
|
271
|
+
? process.env.R2_BUCKET_PREFIX.trim().replace(/^\/+|\/+$/g, "")
|
|
272
|
+
: undefined;
|
|
273
|
+
|
|
274
|
+
const configuredAssetsPrefix =
|
|
275
|
+
configuredStaticAssetHost && configuredStaticAssetPrefix
|
|
276
|
+
? (() => {
|
|
277
|
+
const withScheme = /^https?:\/\//i.test(configuredStaticAssetHost)
|
|
278
|
+
? configuredStaticAssetHost
|
|
279
|
+
: `https://${configuredStaticAssetHost}`;
|
|
280
|
+
return `${withScheme}/${configuredStaticAssetPrefix}`;
|
|
281
|
+
})()
|
|
282
|
+
: undefined;
|
|
283
|
+
|
|
261
284
|
// https://astro.build/config
|
|
262
285
|
export default defineConfig({
|
|
263
286
|
site: configuredSite,
|
|
@@ -270,8 +293,10 @@ export default defineConfig({
|
|
|
270
293
|
output: "static",
|
|
271
294
|
build: {
|
|
272
295
|
format: "directory",
|
|
296
|
+
assetsPrefix: configuredAssetsPrefix,
|
|
273
297
|
},
|
|
274
298
|
integrations: [
|
|
299
|
+
sitemap(),
|
|
275
300
|
preact({
|
|
276
301
|
compat: true,
|
|
277
302
|
}),
|