diff --git a/src/core/markdown.ts b/src/core/markdown.ts index 18c9befae..28b8e5aee 100644 --- a/src/core/markdown.ts +++ b/src/core/markdown.ts @@ -168,6 +168,13 @@ function inferType(filePath?: string): PageType { if (lower.includes('/projects/') || lower.includes('/project/')) return 'project'; if (lower.includes('/sources/') || lower.includes('/source/')) return 'source'; if (lower.includes('/media/')) return 'media'; + // Wiki subdirectory types — checked after generic types so /wiki/projects/ still + // resolves to 'project' via the generic rule above, but wiki-specific subtypes win. + if (lower.includes('/wiki/analysis/')) return 'analysis'; + if (lower.includes('/wiki/guides/') || lower.includes('/wiki/guide/')) return 'guide'; + if (lower.includes('/wiki/hardware/')) return 'hardware'; + if (lower.includes('/wiki/architecture/')) return 'architecture'; + if (lower.includes('/wiki/concepts/') || lower.includes('/wiki/concept/')) return 'concept'; return 'concept'; } diff --git a/test/markdown.test.ts b/test/markdown.test.ts index d80d02478..4318f14b1 100644 --- a/test/markdown.test.ts +++ b/test/markdown.test.ts @@ -267,4 +267,14 @@ Some content.`; expect(parseMarkdown('', 'concepts/thing.md').type).toBe('concept'); expect(parseMarkdown('', 'companies/acme.md').type).toBe('company'); }); + + test('infers type from wiki subdirectory paths', () => { + expect(parseMarkdown('', 'tech/wiki/concepts/longevity-science.md').type).toBe('concept'); + expect(parseMarkdown('', 'tech/wiki/guides/team-os-claude-code.md').type).toBe('guide'); + expect(parseMarkdown('', 'tech/wiki/analysis/agi-timeline-debate.md').type).toBe('analysis'); + expect(parseMarkdown('', 'tech/wiki/hardware/h100-vs-gb200-training-benchmarks.md').type).toBe('hardware'); + expect(parseMarkdown('', 'tech/wiki/architecture/kb-infrastructure.md').type).toBe('architecture'); + expect(parseMarkdown('', 'finance/wiki/analysis/polymarket-bot-automation-thesis.md').type).toBe('analysis'); + expect(parseMarkdown('', 'personal/wiki/concepts/career-regrets-2026-framework.md').type).toBe('concept'); + }); });