{"record":{"id":"fd5b4449204b208c","repo":"getzola/zola","slug":"found-path-collisions","errorCode":null,"errorMessage":"Found path collisions:\n","messagePattern":"Found path collisions:\n","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"components/site/src/lib.rs","lineNumber":336,"sourceCode":"                if is_invalid {\n                    bail!(\n                        \"We can't have a page called `index.md` in the same folder as an index section in {:?}\",\n                        page.file.parent\n                    );\n                }\n            }\n\n            self.add_page(page, false)?;\n        }\n\n        let collisions = self.library.find_path_collisions(&self.config);\n        if !collisions.is_empty() {\n            let mut msg = String::from(\"Found path collisions:\\n\");\n            for c in collisions {\n                let row = format!(\"- {c}\");\n                msg.push_str(&row);\n            }\n            return Err(anyhow!(msg));\n        }\n\n        self.cache = Arc::new(RenderCache::new(&self.config));\n        // Sections need to be populated first to handle the `hidden` visibility so the `populate_taxonomies`\n        // call below can use it to exclude pages.\n        self.populate_sections();\n        // taxonomy Tera fns are loaded in `register_early_global_fns`\n        // so we do need to populate it first.\n        self.populate_taxonomies()?;\n        tpls::register_early_global_fns(self);\n        self.render_markdown()?;\n        Arc::make_mut(&mut self.library).fill_backlinks();\n        Arc::make_mut(&mut self.cache).build(&self.library, &self.taxonomies, &self.tera);\n        tpls::register_tera_global_fns(self);\n\n        // Needs to be done after rendering markdown as we only get the anchors at that point\n        let internal_link_messages = link_checking::check_internal_links_with_anchors(self);\n","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/getzola/zola/blob/61d30828217957120309db657950224edf9707e2/components/site/src/lib.rs#L318-L354","documentation":"Zola's Site::load builds an internal map of page/section output paths; when two different content files would render to the same output path (a 'collision'), load aborts before building. This catches ambiguous routing early instead of silently overwriting one page with another.","triggerScenarios":"Two content files resolve to the same slug/output path — e.g. two pages named the same in the same directory, path config overrides colliding, a page and section producing identical permalinks, or slugification (slugify = true or a slugify strategy) merging two distinct filenames into the same slug.","commonSituations":"Migrating content from another static site generator that allowed duplicate URLs; enabling slugification so 'My Post.md' and 'my-post.md' both become my-post; copying a page into a directory without renaming it.","solutions":["Run the build and read the collision list; rename or move one of the listed content files so each has a unique output path","Check config.toml slugify settings — if slugification merges distinct filenames, rename the source files rather than relying on slugs","Audit `path`/`slug` front-matter overrides; two files explicitly setting the same path collide even with different filenames"],"exampleFix":"// before: content/posts/my-post.md AND content/posts/My Post.md\n// after: rename to unique names, e.g. content/posts/my-post.md and content/posts/my-post-2.md","handlingStrategy":"validation","validationCode":"// Before building, ensure unique output paths by checking your content tree\n// shell pre-check for duplicate filenames that slugify identically:\n// find content -name '*.md' | awk -F/ '{print tolower($NF)}' | sort | uniq -d","typeGuard":null,"tryCatchPattern":"// Rust\nmatch site.load() {\n    Err(e) if e.to_string().starts_with(\"Found path collisions\") => {\n        eprintln!(\"Fix duplicate output paths:\\n{e}\");\n    }\n    Err(e) => return Err(e),\n    Ok(_) => {}\n}","preventionTips":["Keep page filenames unique within each content directory","Avoid relying on slugification to disambiguate similarly named files","Review any explicit `path`/`slug` front-matter overrides for duplicates"],"tags":["rust","static-site","path-collision"],"backgroundTag":"duplicate-output-path","analyzedSha":"61d30828217957120309db657950224edf9707e2","analyzedAt":"2026-09-03T14:39:09.727Z","contentChangedAt":"2026-09-03T14:39:09.727Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}