Add minimal default theme to zola init#3139
Open
nooscraft wants to merge 2 commits intogetzola:nextfrom
Open
Conversation
- Introduced .gitignore, README.md, and initial content files. - Added base, index, page, and section templates for rendering. - Included a default style.css for basic styling. - Updated tests to verify the creation of new files and directories.
Keats
requested changes
Apr 10, 2026
- Replaced hardcoded content in init.rs with includes for default theme files. - Added .gitignore, README.md, and initial content files for the default theme. - Introduced base, index, page, and section templates for rendering. - Included a default style.css for basic styling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3137
Summary
This PR adds a minimal default theme that is automatically generated when running
zola init, providing new users with a working site out of the box.Motivation
Currently,
zola initcreates empty directories, which results in errors when users try to runzola serveimmediately. This creates a rough first experience compared to other SSGs like Jekyll, 11ty, and Hugo (with themes).Approach
Following the maintainer's guidance to use an 11ty-style minimal approach, this implementation:
Changes
Files Generated by
zola init.gitignore- Ignorespublic/and.DS_StoreREADME.md- Basic getting started guide withzola serveandzola buildcommandscontent/_index.md- Homepage content with TOML front mattertemplates/base.html- Base HTML5 template with semantic structuretemplates/index.html- Homepage template extending basetemplates/page.html- Single page templatetemplates/section.html- Section list template with page iterationstatic/style.css- Minimal stylesheet (~150 lines)CSS Features
Testing
All existing tests pass, plus updated test assertions for the new generated files.
Manual Testing
The site now works immediately without any additional setup or configuration.
Design Philosophy
Backward Compatibility
✅ Fully backward compatible:
--forceflag works as expectedScreenshots
Before (Current Behavior)
After (This PR)
Site displays immediately with clean, minimal styling.
Future Enhancements (Not in this PR)
Potential additions for future consideration:
--minimalflag to skip theme generationRelated Discussion