radiant-docs 0.1.34 → 0.1.38
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 +27 -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/Footer.astro +1 -1
- package/template/src/components/Header.astro +9 -9
- package/template/src/components/LogoLink.astro +2 -1
- package/template/src/components/OpenApiPage.astro +18 -18
- package/template/src/components/Search.astro +18 -18
- package/template/src/components/Sidebar.astro +4 -2
- package/template/src/components/SidebarDropdown.astro +82 -79
- package/template/src/components/SidebarGroup.astro +3 -0
- package/template/src/components/SidebarMenu.astro +14 -1
- package/template/src/components/SidebarSegmented.astro +5 -5
- package/template/src/components/SidebarSubgroup.astro +35 -12
- package/template/src/components/TableOfContents.astro +24 -15
- package/template/src/components/ThemeSwitcher.astro +15 -8
- package/template/src/components/chat/AskAiWidget.tsx +10 -5
- package/template/src/components/endpoint/PlaygroundBar.astro +3 -3
- package/template/src/components/endpoint/PlaygroundButton.astro +3 -3
- package/template/src/components/endpoint/PlaygroundField.astro +53 -53
- package/template/src/components/endpoint/PlaygroundForm.astro +51 -37
- package/template/src/components/endpoint/RequestSnippets.astro +54 -21
- package/template/src/components/endpoint/ResponseDisplay.astro +24 -24
- package/template/src/components/endpoint/ResponseFieldTree.astro +12 -12
- package/template/src/components/endpoint/ResponseFields.astro +19 -19
- package/template/src/components/endpoint/ResponseSnippets.astro +66 -29
- package/template/src/components/sidebar/SidebarEndpointLink.astro +18 -15
- package/template/src/components/sidebar/SidebarOpenApiPageLink.astro +56 -0
- package/template/src/components/ui/CodeTabEdge.astro +6 -4
- package/template/src/components/ui/Field.astro +7 -7
- package/template/src/components/ui/Icon.astro +2 -1
- package/template/src/components/ui/demo/Demo.astro +1 -1
- package/template/src/components/user/Accordion.astro +3 -3
- package/template/src/components/user/Callout.astro +8 -8
- package/template/src/components/user/CodeBlock.astro +57 -22
- package/template/src/components/user/CodeGroup.astro +14 -10
- package/template/src/components/user/ComponentPreviewBlock.astro +38 -12
- package/template/src/components/user/Image.astro +6 -2
- package/template/src/components/user/Step.astro +4 -4
- package/template/src/components/user/Tab.astro +1 -1
- package/template/src/components/user/Tabs.astro +15 -20
- package/template/src/layouts/Layout.astro +9 -4
- package/template/src/lib/code/code-block.ts +150 -15
- package/template/src/lib/mdx/remark-resolve-internal-links.ts +639 -0
- 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/src/pages/404.astro +44 -0
- package/template/src/styles/global.css +28 -19
- 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";
|
|
@@ -10,6 +11,7 @@ import path from "path";
|
|
|
10
11
|
import { getConfig, validateMdxContent } from "./src/lib/validation";
|
|
11
12
|
import remarkCodeBlockComponent from "./src/lib/mdx/remark-code-block-component";
|
|
12
13
|
import remarkDemoteH1 from "./src/lib/mdx/remark-demote-h1";
|
|
14
|
+
import remarkResolveInternalLinks from "./src/lib/mdx/remark-resolve-internal-links";
|
|
13
15
|
import remarkStandaloneImageComponent from "./src/lib/mdx/remark-standalone-image-component";
|
|
14
16
|
import rehypeExternalLinks from "./src/lib/mdx/rehype-external-links";
|
|
15
17
|
import remarkGfm from "remark-gfm";
|
|
@@ -258,6 +260,28 @@ const configuredSite =
|
|
|
258
260
|
? process.env.DOCS_SITE_URL.trim()
|
|
259
261
|
: undefined;
|
|
260
262
|
|
|
263
|
+
const configuredStaticAssetHost =
|
|
264
|
+
typeof process.env.STATIC_ASSET_HOST === "string" &&
|
|
265
|
+
process.env.STATIC_ASSET_HOST.trim().length > 0
|
|
266
|
+
? process.env.STATIC_ASSET_HOST.trim().replace(/\/+$/, "")
|
|
267
|
+
: undefined;
|
|
268
|
+
|
|
269
|
+
const configuredStaticAssetPrefix =
|
|
270
|
+
typeof process.env.R2_BUCKET_PREFIX === "string" &&
|
|
271
|
+
process.env.R2_BUCKET_PREFIX.trim().length > 0
|
|
272
|
+
? process.env.R2_BUCKET_PREFIX.trim().replace(/^\/+|\/+$/g, "")
|
|
273
|
+
: undefined;
|
|
274
|
+
|
|
275
|
+
const configuredAssetsPrefix =
|
|
276
|
+
configuredStaticAssetHost && configuredStaticAssetPrefix
|
|
277
|
+
? (() => {
|
|
278
|
+
const withScheme = /^https?:\/\//i.test(configuredStaticAssetHost)
|
|
279
|
+
? configuredStaticAssetHost
|
|
280
|
+
: `https://${configuredStaticAssetHost}`;
|
|
281
|
+
return `${withScheme}/${configuredStaticAssetPrefix}`;
|
|
282
|
+
})()
|
|
283
|
+
: undefined;
|
|
284
|
+
|
|
261
285
|
// https://astro.build/config
|
|
262
286
|
export default defineConfig({
|
|
263
287
|
site: configuredSite,
|
|
@@ -270,14 +294,17 @@ export default defineConfig({
|
|
|
270
294
|
output: "static",
|
|
271
295
|
build: {
|
|
272
296
|
format: "directory",
|
|
297
|
+
assetsPrefix: configuredAssetsPrefix,
|
|
273
298
|
},
|
|
274
299
|
integrations: [
|
|
300
|
+
sitemap(),
|
|
275
301
|
preact({
|
|
276
302
|
compat: true,
|
|
277
303
|
}),
|
|
278
304
|
mdx({
|
|
279
305
|
remarkPlugins: [
|
|
280
306
|
remarkGfm,
|
|
307
|
+
remarkResolveInternalLinks,
|
|
281
308
|
remarkDemoteH1,
|
|
282
309
|
remarkStandaloneImageComponent,
|
|
283
310
|
remarkCodeBlockComponent,
|