Consider a website that has the following structure:
❯ tree
.
├── about
│ ├── contact.md
│ ├── _index.md
│ ├── org.md
│ ├── team.md
│ └── website.md
├── blog
│ ├── _index.md
│ ├── post-1.md
│ └── post-2.md
├── events
│ ├── event-1.md
│ ├── event-2.md
│ └── _index.md
├── _index.md
└── press
├── _index.md
├── release-1.md
└── release-2.md
Currently there is no way (as far as I can tell at least) to create a feed of the sections except about
and order and paginate them correctly. I myself have a need for this and I know some other people that have asked me for this as well. This is especially tricky if you need the feed to be recursive. (i.e. if you make subsections in blog for a series that needs to be paginated along with the rest). I’ll be working on an implementation of this on my fork, and I wanted to gauge whether there would be possibility/interest to merge this into the main repo.
As for implementation, there are three ways I could see this happen (In my order of preference):
- add a
feeds
option to the parent section. e.g. in the root_index.md
of the example above add something like
title = "example"
[feeds]
main = ["blog","press","events"]
- Add something like a
feeds
field/section toconfig.toml
detailing the name of the feed and which sections it should include. I’m imagining something like:
feeds = [
{ name="main", sections = ["blog","press","events"]}
]
- expose a tera function that can concat sections and paginate those correctly. i.e. something like
{% set feed = concat_sections(["blog/_index.md","press/_index.md","events.md"]) %}
(the naming and exact syntax of this example would probably need some workshopping)
Anyone here got thoughts?