Zola "Couldn't find template" in CI
Zola resolves each page to a template by its template frontmatter, section type, or theme. When the named template file is absent from the templates directory (or theme), the build fails.
What this error means
zola build fails with "Reason: Couldn't find template 'X.html'", usually after setting a custom template = in frontmatter or using a theme that lacks it.
zola
Error: Failed to build the site
Reason: Couldn't find template 'custom-page.html'Common causes
The referenced template file does not exist
Frontmatter sets template = "custom-page.html" but no such file is in templates/ (or the theme's templates/).
The theme was not initialized in CI
A theme provides the template but the theme directory (often a submodule) was not checked out, so the file is missing.
How to fix it
Create or correct the template reference
- Confirm the template name in frontmatter matches a real file in templates/.
- Create the missing template or fix the name.
- Re-run
zola build.
content/about.md
+++
template = "page.html"
+++Initialize the theme submodule
Check out the theme so its templates are present during the build.
.github/workflows/ci.yml
- run: git submodule update --init --recursive
- run: zola buildHow to prevent it
- Reference only template files that exist in templates/ or the theme.
- Initialize theme submodules before building.
- Keep custom
template =frontmatter in sync with real files.
Related guides
Zola "Failed to build the site" in CIFix Zola "Error: Failed to build the site" in CI - the top-level build failure whose real reason (a render, l…
Zola "Failed to render" Tera template error in CIFix Zola "Reason: Failed to render" Tera errors in CI - a template references a variable, filter, or block th…
Middleman ERb / template error on build in CIFix Middleman build failures from an ERb or template error in CI - `middleman build` raises a Ruby error (Nam…