quartz icon indicating copy to clipboard operation
quartz copied to clipboard

feat: per-folder RSS feeds, cont'd

Open bfahrenfort opened this issue 1 year ago • 25 comments

Follow-up on #529 and accidental #865. @aarnphm

bfahrenfort avatar Feb 14 '24 03:02 bfahrenfort

Suggestions added. I'm upset that the idiomatic way to concatenate in-place is to expand the second array in a push call, but that can't be helped.

bfahrenfort avatar Feb 14 '24 16:02 bfahrenfort

I think the lint config is broken, it's wanting to add trailing commas to arguments of single-argument functions.

bfahrenfort avatar Feb 14 '24 19:02 bfahrenfort

we should generate an RSS feed per directory UNLESS that directory has an index.md to has noFeed: true in the frontmatter

I worry about build times, doing this recursively could get clunky for large gardens. The main reason I wanted to retain the initial functionality and then opt-in to my new feature is because the current type is what's expected from effectively any other RSS integration on any site/SSG. We also don't have the dynamicity to do caching like Mastodon does for their per-tag and per-user feeds. Can maybe add a plugin option for this behavior? global-recursive: "disabled" | "directories" | "content" | "all" that ignores includeDirectories and instead watches excludeDirectories when set?

I definitely think just adding .xml to the link to the folder/file you're watching would be really cool UX but I only see it on projects that require webservers for a reason.

imo, we should do content-level config within frontmatter wherever possible but I'm curious but what you think here

Can absolutely add this! Would an rss: true in frontmatter work? Then I just filter the root contentindex with that

bfahrenfort avatar Mar 10 '24 04:03 bfahrenfort

i think it shouldn't be too chunky, the processing for rss feeds is really light compared to what the rest of Quartz does so it would be dominated by the disk write speed (i.e. Hugo has this behaviour)

we can also reuse nestings, e.g. if we have

[content]

  • a
    • b
    • c
  • d
    • e
    • f

the rss feed for content would just be the feed of a + d

jackyzha0 avatar Mar 10 '24 06:03 jackyzha0

Reuse is fascinating because that basically just needs a DFS for generation then. Can I safely do recursion here?

bfahrenfort avatar Mar 10 '24 13:03 bfahrenfort

you could use memoization here for the mapping of directory to rss feed and only compute if it hasnt already been computed (i think we shouldnt need recursion here)

jackyzha0 avatar Mar 10 '24 16:03 jackyzha0

Ooh, any resources on that? I'll add it when I get time.

bfahrenfort avatar Mar 10 '24 21:03 bfahrenfort