feat(pipeline): per-wing sources, shared concepts/entities, one slug one page (#208)
With Config.Wing a source goes to wiki/<wing>/sources/ (wing/hall frontmatter); concepts and entities stay in the shared wiki/concepts and wiki/entities, so an entity cited from two wings is ONE page with both sources (the per-wing facts/ layout duplicated it). A source slug already used anywhere but its own wing's sources/ is refused (slug is the graph identity). wiki.FindSlug added. Mutation-checked: collision guard, shared inventory, per-wing source path. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -56,17 +56,12 @@ func normalizeTitle(s string) string {
|
||||
}
|
||||
|
||||
// pageTypeOf is the page's type: from its directory in the retired layout, or
|
||||
// from `kind:` for a wing-layout facts page (concepts and entities share facts/).
|
||||
// "sources" for wiki/<wing>/sources/<slug>.md. Concepts and entities are always
|
||||
// in their shared directories.
|
||||
func pageTypeOf(p wiki.Page) wiki.PageType {
|
||||
parts := strings.Split(filepath.ToSlash(p.Path), "/")
|
||||
if len(parts) >= 4 && parts[0] == "wiki" {
|
||||
switch parts[2] {
|
||||
case "sources":
|
||||
return wiki.PageTypeSource
|
||||
case "facts":
|
||||
pt, _ := wiki.KindFromContent(p.Content)
|
||||
return pt
|
||||
}
|
||||
if len(parts) == 4 && parts[0] == "wiki" && parts[2] == "sources" {
|
||||
return wiki.PageTypeSource
|
||||
}
|
||||
return pageTypeFromPath(p.Path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user