@mel000000/weweb-dynamic-metadata 1.0.16 → 1.0.18
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/src/core/file-processor.js +4 -12
package/package.json
CHANGED
|
@@ -186,10 +186,10 @@ export async function processFiles() {
|
|
|
186
186
|
await fs.copyFile(metadataJsPath, path.join(paramDir, 'metadata.js'));
|
|
187
187
|
|
|
188
188
|
|
|
189
|
-
// Create reference files
|
|
189
|
+
// Create reference files
|
|
190
190
|
const relativeTemplatePath = '../_param/index.html';
|
|
191
191
|
let referencesCreated = 0;
|
|
192
|
-
|
|
192
|
+
|
|
193
193
|
for (const [id, metadata] of metadataMap.entries()) {
|
|
194
194
|
try {
|
|
195
195
|
const contentDir = path.join(baseDir, routeName, id);
|
|
@@ -197,20 +197,12 @@ export async function processFiles() {
|
|
|
197
197
|
|
|
198
198
|
await fs.writeFile(
|
|
199
199
|
path.join(contentDir, 'index.html'),
|
|
200
|
-
generateReferenceHtml(id, metadata.title, relativeTemplatePath)
|
|
200
|
+
generateReferenceHtml(id, metadata.title, relativeTemplatePath, routeName),
|
|
201
201
|
);
|
|
202
202
|
|
|
203
|
-
// Create a small metadata.js reference
|
|
204
|
-
const contentMetadataJsPath = path.join(contentRootDir, 'metadata.js');
|
|
205
|
-
const metadataReference = `// Reference to central metadata file
|
|
206
|
-
// This file points to the main metadata.js
|
|
207
|
-
// The actual metadata is loaded from /article/metadata.js`;
|
|
208
|
-
|
|
209
|
-
await fs.writeFile(contentMetadataJsPath, metadataReference, 'utf-8');
|
|
210
|
-
|
|
211
203
|
referencesCreated++;
|
|
212
204
|
} catch (error) {
|
|
213
|
-
|
|
205
|
+
console.error(`Failed to create reference for ID ${id}:`, error.message);
|
|
214
206
|
}
|
|
215
207
|
}
|
|
216
208
|
|