pawroman / zola-theme-terminimal

A simple, minimal retro theme for Zola
https://pawroman.github.io/zola-theme-terminimal/
Other
346 stars 76 forks source link

Automatically set link to RSS or ATOM feed #35

Closed heitorPB closed 1 year ago

heitorPB commented 1 year ago

When generating the HTML for the feed, set the <link > type to either application/rss+xml or application/atom+xml according to the feed_filename from config.toml. Currently, the theme assumes the user uses RSS, without an option to change to ATOM.

I don't think this is the "bestest" approach, but I prefer guessing default feed filenames than adding another configuration option. Unless I am missing something, which is totally possible. Suggestions are very welcome.

@pawroman should I also add a note in the README.md about this?

Based on the Zola docs for feeds.

Closes #48

pawroman commented 1 year ago

Hey, thanks for the contribution, much appreciated, and sorry it took so long for me to respond.

I think it makes sense to lean onto the Zola defaults and to also support both feed formats. I only used RSS because I didn't know any better :sweat_smile:

@pawroman should I also add a note in the README.md about this?

If you want, please go ahead. Personally, I would primarily consider adding it to config.toml, e.g.

# The theme supports feeds
generate_feed = false

# use `atom.xml` (default) for atom feeds, or `rss.xml` for RSS
feed_filename = "atom.xml"
heitorPB commented 1 year ago

Hey, no need to apologize :)

Hmm, I think we are talking about the same thing? This PR proposes to use config.feed_filename to generate the link to the feed, instead of hardcoding to rss.xml. I also added some trickery to find out the application/type of the feed (RSS or ATOM).

I think my initial words on this PR were not ideal to clearly state what was going on.

I have this branch working "live" on my site if you want to see the result there (https://heitorpb.github.io/).

pawroman commented 1 year ago

Hey, yeah, your changes are definitely OK, and you made it all clear.

I just wanted the theme config.toml file to mention that we support both feed types, officially. In my mind, it's good to have a good reference to the supported features in the config example.

heitorPB commented 1 year ago

Ah, got it! And I totally agree with you :)

If there's something else you want me to address here, I'll be happy to do it.

pawroman commented 1 year ago

Good stuff, thanks!