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 This content has been proxied by September (3851b).Proxy Information
text/gemini