@techninja/clearstack 0.3.36 → 0.3.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/lib/build-og.js +8 -3
- package/package.json +1 -1
package/lib/build-og.js
CHANGED
|
@@ -136,9 +136,14 @@ function resolveMeta(config, data, baseUrl, path) {
|
|
|
136
136
|
* @param {import('./og-template.js').OGMeta} meta
|
|
137
137
|
*/
|
|
138
138
|
function writePage(outDir, routePath, shell, meta) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
let filePath;
|
|
140
|
+
if (routePath === '/') {
|
|
141
|
+
filePath = resolve(outDir, 'index.html');
|
|
142
|
+
} else {
|
|
143
|
+
// Write as flat file (e.g. /dna-sources → dna-sources.html)
|
|
144
|
+
// Cloudflare Pages serves dna-sources.html for /dna-sources without redirect
|
|
145
|
+
filePath = resolve(outDir, routePath.slice(1) + '.html');
|
|
146
|
+
}
|
|
142
147
|
mkdirSync(dirname(filePath), { recursive: true });
|
|
143
148
|
writeFileSync(filePath, injectMeta(shell, meta));
|
|
144
149
|
}
|
package/package.json
CHANGED