getzola/zola · error
Found path collisions:
Error message
Found path collisions:
What it means
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.
Source
Thrown at components/site/src/lib.rs:336
if is_invalid {
bail!(
"We can't have a page called `index.md` in the same folder as an index section in {:?}",
page.file.parent
);
}
}
self.add_page(page, false)?;
}
let collisions = self.library.find_path_collisions(&self.config);
if !collisions.is_empty() {
let mut msg = String::from("Found path collisions:\n");
for c in collisions {
let row = format!("- {c}");
msg.push_str(&row);
}
return Err(anyhow!(msg));
}
self.cache = Arc::new(RenderCache::new(&self.config));
// Sections need to be populated first to handle the `hidden` visibility so the `populate_taxonomies`
// call below can use it to exclude pages.
self.populate_sections();
// taxonomy Tera fns are loaded in `register_early_global_fns`
// so we do need to populate it first.
self.populate_taxonomies()?;
tpls::register_early_global_fns(self);
self.render_markdown()?;
Arc::make_mut(&mut self.library).fill_backlinks();
Arc::make_mut(&mut self.cache).build(&self.library, &self.taxonomies, &self.tera);
tpls::register_tera_global_fns(self);
// Needs to be done after rendering markdown as we only get the anchors at that point
let internal_link_messages = link_checking::check_internal_links_with_anchors(self);
View on GitHub (pinned to 61d3082821)
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
Example fix
// before: content/posts/my-post.md AND content/posts/My Post.md // after: rename to unique names, e.g. content/posts/my-post.md and content/posts/my-post-2.md
Defensive patterns
Strategy: validation
Validate before calling
// Before building, ensure unique output paths by checking your content tree
// shell pre-check for duplicate filenames that slugify identically:
// find content -name '*.md' | awk -F/ '{print tolower($NF)}' | sort | uniq -d Try / catch
// Rust
match site.load() {
Err(e) if e.to_string().starts_with("Found path collisions") => {
eprintln!("Fix duplicate output paths:\n{e}");
}
Err(e) => return Err(e),
Ok(_) => {}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- SASS path conflict: "{}" and "{}" both compile to "{}"
- could not parse domain `{}` from link
- could not parse domain `{}` from link: `{}`
- Failed to convert bytes to string : {}
- {:?} is not inside the base site directory {:?}
AI-assisted analysis of getzola/zola@61d3082821 (2026-09-03).
Data as JSON: /api/errors/fd5b4449204b208c.
Report an issue: GitHub.