koguma 2.2.2 → 2.2.3
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/cli/content.ts +16 -0
- package/package.json +1 -1
- package/src/admin/_bundle.ts +1 -1
package/cli/content.ts
CHANGED
|
@@ -586,6 +586,11 @@ export function validateContent(
|
|
|
586
586
|
'updated_at'
|
|
587
587
|
]);
|
|
588
588
|
|
|
589
|
+
// Build set of extra markdown field IDs (for sibling file detection)
|
|
590
|
+
const extraMdFieldIds = new Set<string>();
|
|
591
|
+
const mdFields = findMarkdownFields(ctInfo.fieldMeta);
|
|
592
|
+
for (const id of mdFields.slice(1)) extraMdFieldIds.add(id);
|
|
593
|
+
|
|
589
594
|
const files = readdirSync(subdirPath);
|
|
590
595
|
for (const file of files) {
|
|
591
596
|
if (file.startsWith('_')) continue;
|
|
@@ -595,6 +600,17 @@ export function validateContent(
|
|
|
595
600
|
const filePath = resolve(subdirPath, file);
|
|
596
601
|
if (!statSync(filePath).isFile()) continue;
|
|
597
602
|
|
|
603
|
+
const name = basename(file, ext);
|
|
604
|
+
|
|
605
|
+
// Skip sibling markdown field files — they're not full entries
|
|
606
|
+
if (ext === '.md' && extraMdFieldIds.size > 0) {
|
|
607
|
+
// Singleton sibling: fieldId.md (not index.md)
|
|
608
|
+
if (name !== 'index' && extraMdFieldIds.has(name)) continue;
|
|
609
|
+
// Collection sibling: slug.fieldId.md
|
|
610
|
+
const dotIdx = name.lastIndexOf('.');
|
|
611
|
+
if (dotIdx > 0 && extraMdFieldIds.has(name.slice(dotIdx + 1))) continue;
|
|
612
|
+
}
|
|
613
|
+
|
|
598
614
|
const entry = parseContentFile(filePath, subdir);
|
|
599
615
|
const relPath = `${subdir}/${file}`;
|
|
600
616
|
|