radiant-docs 0.1.58 → 0.1.60
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 +24 -2
- package/template/package-lock.json +216 -513
- package/template/package.json +13 -3
- package/template/scripts/generate-og-images.mjs +338 -6
- package/template/scripts/generate-og-metadata.mjs +29 -0
- package/template/src/components/Footer.astro +1 -1
- package/template/src/components/Header.astro +6 -13
- package/template/src/components/MdxPage.astro +3 -1
- package/template/src/components/OpenApiPage.astro +26 -832
- package/template/src/components/Sidebar.astro +1 -1
- package/template/src/components/SidebarGroup.astro +1 -1
- package/template/src/components/ThemeSwitcher.astro +5 -15
- package/template/src/components/chat/AssistantEmbedPanel.tsx +1 -1
- package/template/src/components/chat/AssistantEmbedPanelPage.astro +15 -2
- package/template/src/components/endpoint/PlaygroundButton.astro +1 -1
- package/template/src/components/endpoint/PlaygroundField.astro +1 -1
- package/template/src/components/endpoint/PlaygroundForm.astro +9 -5
- package/template/src/components/endpoint/ResponseFields.astro +3 -3
- package/template/src/components/ui/Field.astro +4 -4
- package/template/src/components/user/Callout.astro +2 -2
- package/template/src/components/user/Card.astro +2 -2
- package/template/src/components/user/Step.astro +3 -1
- package/template/src/layouts/Layout.astro +21 -46
- package/template/src/lib/ai-artifacts.ts +792 -0
- package/template/src/lib/font-css.ts +376 -0
- package/template/src/lib/mdx/remark-resolve-internal-links.ts +22 -8
- package/template/src/lib/oas.ts +5 -1
- package/template/src/lib/openapi/operation-doc.ts +1150 -0
- package/template/src/lib/page-description.ts +20 -0
- package/template/src/lib/routes.ts +73 -18
- package/template/src/pages/-/fonts/[...font].ts +50 -0
- package/template/src/pages/404.astro +2 -2
- package/template/src/pages/[...slug]/index.md.ts +35 -0
- package/template/src/pages/[...spec].json.ts +33 -0
- package/template/src/pages/[...spec].yaml.ts +33 -0
- package/template/src/pages/[...spec].yml.ts +33 -0
- package/template/src/pages/index.md.ts +17 -0
- package/template/src/pages/llms-full.txt.ts +11 -0
- package/template/src/pages/llms.txt.ts +11 -0
- package/template/src/styles/global.css +32 -7
- package/template/src/assets/fonts/geist-mono/cyrillic.woff2 +0 -0
- package/template/src/assets/fonts/geist-mono/latin-ext.woff2 +0 -0
- package/template/src/assets/fonts/geist-mono/latin.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/canadian-aboriginal.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/cherokee.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/latin-ext.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/latin.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/math.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/nushu.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/symbols.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/syriac.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/tifinagh.woff2 +0 -0
- package/template/src/assets/fonts/google-sans-flex/vietnamese.woff2 +0 -0
- package/template/src/styles/geist-mono.css +0 -33
- package/template/src/styles/google-sans-flex.css +0 -143
- package/template/src/styles/vaul.css +0 -255
package/package.json
CHANGED
|
@@ -92,11 +92,20 @@ function copyContentAssets() {
|
|
|
92
92
|
const CWD = process.cwd();
|
|
93
93
|
const DOCS_DIR = path.join(CWD, "src/content/docs");
|
|
94
94
|
const PUBLIC_DIR = path.join(CWD, "public");
|
|
95
|
+
const RESERVED_AI_ARTIFACT_PATHS = new Set(["llms.txt", "llms-full.txt"]);
|
|
95
96
|
|
|
96
97
|
function shouldCopyFile(filePath) {
|
|
97
98
|
return isPublishableStaticAssetPath(filePath);
|
|
98
99
|
}
|
|
99
100
|
|
|
101
|
+
function toPosixRelativePath(baseDir, filePath) {
|
|
102
|
+
return path.relative(baseDir, filePath).replace(/\\/g, "/");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function isReservedAiArtifactPath(relativePath) {
|
|
106
|
+
return RESERVED_AI_ARTIFACT_PATHS.has(relativePath.replace(/^\/+/, ""));
|
|
107
|
+
}
|
|
108
|
+
|
|
100
109
|
// Build a set of all publishable asset paths in src/content/docs
|
|
101
110
|
function collectAssetPaths(dir, baseDir, pathSet) {
|
|
102
111
|
if (!fs.existsSync(dir)) return;
|
|
@@ -113,8 +122,9 @@ function copyContentAssets() {
|
|
|
113
122
|
collectAssetPaths(entryPath, baseDir, pathSet);
|
|
114
123
|
} else if (entry.isFile() && shouldCopyFile(entryPath)) {
|
|
115
124
|
// Store relative path from baseDir
|
|
116
|
-
const relativePath =
|
|
117
|
-
|
|
125
|
+
const relativePath = toPosixRelativePath(baseDir, entryPath);
|
|
126
|
+
if (isReservedAiArtifactPath(relativePath)) continue;
|
|
127
|
+
pathSet.add(relativePath); // Normalize path separators
|
|
118
128
|
}
|
|
119
129
|
}
|
|
120
130
|
}
|
|
@@ -144,6 +154,9 @@ function copyContentAssets() {
|
|
|
144
154
|
}
|
|
145
155
|
}
|
|
146
156
|
} else if (entry.isFile() && shouldCopyFile(srcPath)) {
|
|
157
|
+
const relativePath = toPosixRelativePath(DOCS_DIR, srcPath);
|
|
158
|
+
if (isReservedAiArtifactPath(relativePath)) continue;
|
|
159
|
+
|
|
147
160
|
// Ensure destination directory exists before copying
|
|
148
161
|
if (!fs.existsSync(destDir)) {
|
|
149
162
|
fs.mkdirSync(destDir, { recursive: true });
|
|
@@ -215,6 +228,13 @@ function copyContentAssets() {
|
|
|
215
228
|
|
|
216
229
|
// Step 4: Clean up empty directories
|
|
217
230
|
cleanupEmptyDirs(PUBLIC_DIR, PUBLIC_DIR);
|
|
231
|
+
|
|
232
|
+
for (const reservedPath of RESERVED_AI_ARTIFACT_PATHS) {
|
|
233
|
+
const publicPath = path.join(PUBLIC_DIR, reservedPath);
|
|
234
|
+
if (fs.existsSync(publicPath)) {
|
|
235
|
+
fs.unlinkSync(publicPath);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
218
238
|
}
|
|
219
239
|
|
|
220
240
|
return {
|
|
@@ -239,6 +259,8 @@ function copyContentAssets() {
|
|
|
239
259
|
path.join(CWD, "src/content/docs"),
|
|
240
260
|
file,
|
|
241
261
|
);
|
|
262
|
+
if (isReservedAiArtifactPath(relativePath)) return;
|
|
263
|
+
|
|
242
264
|
const destPath = path.join(PUBLIC_DIR, relativePath);
|
|
243
265
|
const destDir = path.dirname(destPath);
|
|
244
266
|
|