Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: easily customisable jinja2 templates per-feed? #297

Open
toomanybrians opened this issue Jun 16, 2024 · 2 comments
Open

New feature: easily customisable jinja2 templates per-feed? #297

toomanybrians opened this issue Jun 16, 2024 · 2 comments
Assignees
Labels
compliance Compliance with the RSS standard and its extensions enhancement New feature or request

Comments

@toomanybrians
Copy link
Contributor

toomanybrians commented Jun 16, 2024

I'm just now getting my site and feed setup, and it seems like there are an infinite number RSS feed configuration options in the world. (Custom icons, metadata, etc.) I would like to be able to have more control of the generated feed from this plugin, and it seems like the easiest way to do this would be similar to how Material for MkDocs handles it, with the ability to add a jinja2 template to a project, based on templates/rss.xml.jinja2 as a starting point.

I would envision this could be enabled with an additional config option, such as rss_feed_template:, since I would want to be able to use different templates when multiple feeds are used.

I would be happy to write this feature. It's something I need to do for myself anyway, and it would be easy to make it universal. But I wanted to see if this was a feature that would be valuable here, and, if you have any thoughts or suggestions on what I consider before I create it.

Thanks!
Brian

@Guts
Copy link
Owner

Guts commented Jun 17, 2024

Thank you for the interest in this project and the dynamic contribution. I really appreciate.

Concerning the evolution proposal, it is clearly on the path of evolution of the plugin. Moreover, from the initial design, I had varied the path of the template to facilitate customization.

Some remarks to move forward:

  • compliance is essential (despite some deviations, notably on the formalism of the authors). RSS being old mature, there are indeed a bunch of extensions starting with those pushed by Yahoo and Feedly. If possible, it is preferable to push the variability of the "core" template.
  • Now maybe it's time to also use a template for the JSON Feed so that you can handle things the same way?
  • the codebase is growing and I think it's the a good opportunity to continue on refactoring as I do for last versions. This evolution would imply a lot of new code and complexity. Let's take our time to make it sustainable please.

@Guts Guts added enhancement New feature or request compliance Compliance with the RSS standard and its extensions labels Jun 17, 2024
@toomanybrians
Copy link
Contributor Author

Everything you're saying makes sense to me. At this point, I don't have a lot of time to offer as I'm trying to get my site launched. But I'll keep this open and keep watching this project and maybe I can come back around to do a proper implementation of this once my crunch time is over?

For now I might just fork it and make this change for myself since I need to get something done ASAP, but I'll look more at the code as I'm doing it and think about it.

Just out of curiousity, what is the JSON feed used for in the real world?

Thanks!
Brian

Guts added a commit that referenced this issue Jul 3, 2024
Hello @Guts 

Thanks for the awesome project.

I use this plugin heavily in my [SRE
blog](https://developer-friendly.blog).

I figured it would be nice to allow per page customization of the
`description` field, cause at the moment, there's not a lot one can do
when the description before `<!-- more -->` is short and extra detail is
desired.

With this change, you can have separate contents for RSS description and
your typical content.

An example taken from the [Material for Mkdocs Social
Cards](https://squidfunk.github.io/mkdocs-material/plugins/social/#option.description):

```markdown
---
date: 2024-06-24
description: >-
  This is the SEO description.
social:
  cards_layout_options:
    description: >-
      This is the social cards description.
rss:
  feed_description: >-
    And I want to have customized RSS description.
---

```


This idea, I reckon, can easily be extended for other similar use-cases:
- #297 
- #275 
- #197
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compliance Compliance with the RSS standard and its extensions enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants