How do you structure your project?

I’ve been working with Zola for about a year and it’s been great!

I’m mostly just curious about how people structure their content? I’ve set up the folder structure so it has URLs that look like:

mysite.com/2024/07/my-blog-post

So my actual structure looks like:

content/
| blog/
|    | _index.md
|    | 2024/
|    |    | _index.md
|    |    | 07/
|    |    |    | _index.md
|    |    |    | my-blog-post1/
|    |    |    |    | _index.md
|    |    |    |    | some-image1.png
|    |    |    | my-blog-post2/
|    |    |    |    | _index.md
|    |    |    |    | some-image2.png
|    |    |    | my-blog-post3/
|    |    |    |    | _index.md
|    |    |    |    | some-image3.png
|    |    |    | 2024-07-14-my-blog-post1.md
|    |    |    | 2024-07-15-my-blog-post2.md
|    |    |    | 2024-07-16-my-blog-post3.md

Every _index.md is just:

+++
render = false
transparent = true
+++

I’ve found though that due to needing the _index.md in each folder is fairly tedious and I feel like a recursive = true would be a nice option here, this way I could just define that every folder is transparent and don’t render at the root of content assuming that I don’t want any of the individual paths to render, but that’s maybe just me.

Since my posts tend to only contain 2-5 images, I’ve considered just putting all the content in a content folder and using ../content/some-image1.png instead of ./some-image.png for images.

content/
| blog/
|    | _index.md
|    | 2024/
|    |    | _index.md
|    |    | 07/
|    |    |    | _index.md
|    |    |    | content/
|    |    |    |    | _index.md
|    |    |    |    | some-image1.png
|    |    |    |    | some-image2.png
|    |    |    |    | some-image3.png
|    |    |    | 2024-07-14-my-blog-post1.md
|    |    |    | 2024-07-15-my-blog-post2.md
|    |    |    | 2024-07-16-my-blog-post3.md

But yeah I’m basically just curious about other people’s structures! I’d love to see how people structure their content to see if there’s a better solution. I’m totally open to other ideas if it makes things easier

I create a directory per article inside content/blog/. I don’t have that many articles, but even if I did, I feel I’ll always find this structure more manageable than a nested date-based structure.

What’s the best way to organise a series of articles posts with 1-2 pictures per post?
If I use a subfolder per article then the filename of the article should always be index.md, right?
That would be a bit inconvenient in an editor when every article has the same filename and only the path is different.
Is there a way to avoid this ?

My editor shows the parent dir name when there are files with the same name open. I think it’s pretty standard?

Yes. I had the same reservations, but I think the trade-off is worth it.

I use VSCode as my editor, which can easily open the right file by typing the directory name.

1 Like