My Zola site now has atom.xml and rss.xml.
I copied the index.html from my theme into my main Zola directory's templates file, then made the changes that allowed the RSS feeds to build.
[#]zola #ssg #blogging
=> More informations about this toot | More toots from passthejoe@ruby.social
Here are the changes in the index.html file I copied from the theme into my templates directory:
Before:
{% if config.generate_feed %}
<link rel="alternate" type="application/atom+xml" title="Feed" href="{{ get_url(path=config.feed_filename, trailing_slash=false) }}">
{% endif %}
After:
{% if config.generate_feeds %}
<link rel="alternate" type="application/atom+xml" title="Feed" href="{{ get_url(path='atom.xml') | safe }}"
/>
{% endif %}
=> More informations about this toot | More toots from passthejoe@ruby.social
I will work on getting references to both atom.xml and rss.xml into index.html, but I'll have to figure out how to code an if statement that looks into an array.
But for now the RSS is flowing, and the site is building.
It's one of the nice features of Zola. If there's a template in your theme that you want to modify, you just move it from the theme's templates directory to your main Zola directory's templates directory. Then you can modify it without touching the theme.
=> More informations about this toot | More toots from passthejoe@ruby.social
I copied /zola/themes/zola-hook/templates/index.html (and also page.html) into /zola/templates, and I'm editing the files in the latter.
And if I want to either refer to the original index.html and page.html — or copy them over again — I can.
Do any current Zola themes dynamically create index.html with RSS code based on the choices in config.toml? I think I can figure it out, just not today.
=> More informations about this toot | More toots from passthejoe@ruby.social
I forgot to write that this is what I have in config.toml for RSS. It's standard, right out of the docs:
generate_feeds = true
feed_filenames = ["atom.xml", "rss.xml"]
feed_limit = 100
The Zola docs' Configuration section shows what it should look like if you choose one of the feed options but not both, so this post isn't a complete waste.
https://www.getzola.org/documentation/getting-started/configuration/
=> More informations about this toot | More toots from passthejoe@ruby.social
I am closer to figuring out the Tera templates in Zola. This documentation will get me there https://keats.github.io/tera/docs/
=> More informations about this toot | More toots from passthejoe@ruby.social
I always put a limit on the number of items in the RSS feed because I used to run a site with a lot of very large entries, and it was full-text RSS. It would build fine on my laptop, but when I automated it to build on shared hosting, it would run out of memory every time trying to build a single-page RSS with hundreds of text-packed entries.
Setting the RSS limit to 10 fixed it.
Luckily both Hugo and Zola have a configuration option for this.
=> More informations about this toot | More toots from passthejoe@ruby.social
@passthejoe this looks like what you're looking for: https://codeberg.org/daudix/duckquill/src/commit/4f8e8786fad9b9ce64d548d975189b8d7e36c05a/templates/partials/head.html#L23-L33
{%- if config.generate_feeds and config.feed_filenames %} {% for feed in config.feed_filenames %} {% if feed == "atom.xml" %} {% elif feed == "rss.xml" %} {% else %} {% endif %} {% endfor %} {% endif %}
=> More informations about this toot | More toots from stepan@f.cz
@stepan That is is, exactly. Thanks!
=> More informations about this toot | More toots from passthejoe@ruby.social
@stepan Actually, that's about 80% of the way there. I can get the last bit, no problem
=> More informations about this toot | More toots from passthejoe@ruby.social
@stepan This is what I ended up with. You can have both rss.xml and atom.xml, either one of those, or none in the area ... and if your config.toml says to build a feed but doesn't specify which one, you get a line pointing to the atom feed, which is what Zola builds in that situation:
https://codeberg.org/passthejoe/zola_code/src/branch/main/feed_fix.html
=> More informations about this toot | More toots from passthejoe@ruby.social
@passthejoe so, do you like Zola?
For the last 8 years I've been just OK with #Hugo, but the fact that's a #GoLang app that depends on some measure of how/when Google want to support their programming language makes me very uncomfortable - same with situation than #restic, which I love profoundly.
I want to be as far from what Google if I possible, and Zola might be yet another step in the way out of that dependency of go.
=> More informations about this toot | More toots from esparta@ruby.social
@esparta So far I'm enjoying the process of figuring it out.
I'm also a Hugo user. At this point I'm not saying that Zola is better than Hugo. I don't think I know either system well enough to definitively rank them.
Both build a site really quickly, and both are extremely flexible and extensible.
Hugo for sure has more features, more users, more developers, more releases, and more themes.
But sometimes less is OK. Simple can be better.
I'm still in the kicking-the-tires phase.
=> More informations about this toot | More toots from passthejoe@ruby.social
@esparta The things I'm looking at right now:
=> More informations about this toot | More toots from passthejoe@ruby.social
@passthejoe thanks Steven for all the insights. I'm not very hardcore user of Hugo, usually take stock and a very old template so I should be fine.
I recall starting with Hugo when they have so few user base and nothing major came along, so I'm hoping would be the se with Zola if I jump boats.
For starters I'll be trying to migrate my website this weekend and see what's going on.
Thanks again!
=> More informations about this toot | More toots from esparta@ruby.social
@esparta The hardest part for me is always finding a template that works for what I want to do.
=> More informations about this toot | More toots from passthejoe@ruby.social This content has been proxied by September (3851b).Proxy Information
text/gemini