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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "radiant-docs",
3
- "version": "0.1.33",
3
+ "version": "0.1.37",
4
4
  "description": "CLI tool for previewing Radiant documentation locally",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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
  }),