Ancestors

Written by Steven Rosenberg on 2025-01-31 at 15:36

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

Written by Steven Rosenberg on 2025-01-31 at 15:37

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

Written by Steven Rosenberg on 2025-01-31 at 15:39

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

Written by Steven Rosenberg on 2025-01-31 at 15:45

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

Written by Steven Rosenberg on 2025-01-31 at 15:49

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

Toot

Written by Steven Rosenberg on 2025-02-01 at 20:01

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

Descendants

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113930409415372020
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
275.803402 milliseconds
Gemini-to-HTML Time
2.083808 milliseconds

This content has been proxied by September (3851b).