mitydigital / statamic-feedamic

An Atom and RSS feed for Statamic 3, 4 and 5
https://docs.mity.com.au/feedamic
8 stars 9 forks source link

Idea: Full rendering of Bard sets #31

Closed steveparks closed 3 months ago

steveparks commented 3 months ago

At the moment, the Feedamic model deliberately only adds text Bard sets to the summary that will become the description part of the entry in the feed.

There are good reasons for this being the default.

But it would be good to have the option to render all Bard fields (ideally using the standard core augmentation to render them to HTML in a way that matches the web page) so that, for example, images and video embeds created in Bard sets work.

For added fantasticness, supporting the Peak Starter Kit's standard PageBuilder sets would be great.

martyf commented 3 months ago

This is a tricky one as it is too opinionated - some may use Bard and Sets, some may use a Replicator, so many ways to do it - but also some may use Tailwind, some may not, and RSS readers may not handle it appropriately too. What about blocks that have multiple fields? Which ones are to be included vs excluded? It's a hard one to generalise.

However, one idea that I've just thought of would be to allow you to write your own Antlers parsing so that you can output the markup the way you want to do it. This way it would allow you to output more structure markup - be that from Peak, your own setup, Bard and Sets, etc - but not make it my responsibility to assume too much about how you've done things.

Does that sound like the happy medium here? Rather than have Feedamic render out the markup, have Feedamic make it possible to hook in to a template that can render out your markup however you see fit based on your Entry's Blueprint's configuration.

steveparks commented 3 months ago

That's ideal!

martyf commented 3 months ago

Actually this can already be done.

You can make your own FeedEntry class that extends the FeedamicEntry interface that can return the Title and Summary (and therefore your own processing) - added with #25.

See: https://docs.mity.com.au/feedamic/interface

Let me know if you have any queries about how to implement it.

I've mentioned before but do have a full rewrite of Feedamic in store where I want to really tighten up a few areas and this is one, plus a full refactor and test suite. But that'll probably introduce breaking changes... but do wonder if I need to put a survey/call out to existing users - especially advanced use cases like you - to collect feedback, requests, etc, before doing that. But that's a whole other discussion!

steveparks commented 3 months ago

Yes, thanks - I spotted that but haven't had a chance to delve into it yet. Thanks for the kind offer of a steer on it. I'll give you a shout when I get to it if I get stuck.

I think breaking changes won't be such an issue given that Feedamic config is all in one file and is fairly simple (plus maybe some custom views in some cases, and custom interface in very few). It's not like it would be too much work to reconfigure.

But Feedamic does seem to be widely used, so maybe a survey would get you useful feedback and requests, so you know the range of different use cases. I'm sure everyone would be excited about a new version! :)

martyf commented 3 months ago

No worries at all - I'll close this issue for now given there's a solution, but also reach out to me on Discord or here if you need too.