I just started using Zola, followed the Getting Started guide, added some content, and then tried to add a theme.
I was quite surprised to see that no matter what theme I cloned into
themes and added to
config.toml, nothing changed.
I kicked off a new repo to debug, and did the theme first, checking through each step of the Getting Started guide. It worked! Right up until creating
which gives you a page that doesn’t import
site.css, and thus only has whatever CSS you manually add to your template (Bulma 0.8 in the case of the example).
How does one create a site that actually uses a theme?
I think the right thing to do here is:
- Configure the theme.
- Do not create a base.html.
- Do not create index.html.
- Instead, create
content/index.md with metadata inside
However, if I do that I don’t actually get main page content — the title shows up, but not the body.
This is a bit of a critical miss for a getting started guide: I’m flailing about in the dark. Can someone suggest what I’m doing wrong and update the Getting Started guide to save the next person?
If you are using a theme and you don’t want to customise it, the
templates folder should be empty basically.
The quickstart should have a section for templates though, you’re right.
The fact that the
templates folder should be empty to use a theme wasn’t obvious to me either after going through the getting started guide. Adding a sentence at the end of the guide saying as much would be helpful.
Sounds more like a bug tbh
in fact this is a bug, they didn’t fixed it yet, and i had the same problem.
i’m lucky that someone noticed and answered this, otherwise i would’nt be able to grasp what was happening.
it’s not obvious.
Looking at it again I wasn’t clear.
The templates folder can contain files if you are overriding some of the themes templates/adding your own shortcodes. If you are not, it can be empty but there’s no specific need to be empty.
yea im having issues as well with themes.
im completely lost and idk what im actually supposed to do. im told here the templates can be empty, but i get errors.
this has honestly been a mess to try to get working and im very close to giving up on it
That’s a regression from 0.17, you can just create an empty
templates folder for now.
I am glad to finally found this thread.
The getting started/overview - Overview | Zola should probably be called “How to create your theme without any CSS” or something.
For me having empty templates folder wasn’t the solution, because the content/_index.md template and page_template were set to blog.html and blog-page.html respectively. So
zola build would fail.
So in my case, I chose theme sam: sam | Zola
I just copied the appropriate template for template and page_template from themes/sam/templates the section.html and page.html respectively and tada all worked as expected.
Does it really have to be that complicated?
The getting started should probably just include some steps to using some default theme unless the devs really want people to see plain HTML at first.
Hours of figuring this silly thing out…
I almost gave up and installed hugo.
I am making an issue on GitHub as well, this is just a horrible first-time experience no matter if you’re silly Linux admin or an experienced web dev.