DavidDarnes,
@DavidDarnes@mastodon.design avatar

I've been using these “bookmark cards" in Ghost https://ghost.org/help/cards/#bookmark. They expand links into a rich format, like on Slack etc. Great for making links more engaging, however they come with some caveats.

For one they look like a complete mess in RSS readers (see screenshot). Secondly this must be really annoying for screen readers as I presume all of this is announced when focusing the link.

Tempted to move this to client JS, which removes it from my RSS and allows me to control markup more 🤔

lewis,
@lewis@social.lol avatar

@DavidDarnes Could you do some preprocessing that generates an image of it and serves that instead (or as a placeholder & then if JS is present, populate it with something richer?), provided there’s a way to make the alt text into something that’s not equally terrible?

DavidDarnes,
@DavidDarnes@mastodon.design avatar

@lewis hmm an image wouldn’t be very responsive?

eleventy,
@eleventy@fosstodon.org avatar

@DavidDarnes and you don’t want to filter content out of your RSS feed?

DavidDarnes,
@DavidDarnes@mastodon.design avatar

@eleventy I guess I could take that approach?

eleventy,
@eleventy@fosstodon.org avatar

@DavidDarnes just another idea 🥹

DavidDarnes,
@DavidDarnes@mastodon.design avatar

@eleventy just to check, are you referring to filtering specific elements from and RSS feed? Like RSS specific CSS?

tomhazledine,
@tomhazledine@mastodon.social avatar

@DavidDarnes @eleventy I do something like that at the template level. So certain things never get rendered when the RSS feed is built.

Useful to be able to replace a crazy CSS illustration or interactive JS thingamajigger with a note that says “This content is best enjoyed on the original URL” 🤷‍♂️

DavidDarnes,
@DavidDarnes@mastodon.design avatar

@tomhazledine @eleventy wish I had that fine tuning control right now. Currently Ghost is just giving me all the content as one big html string 🫣

tomhazledine,
@tomhazledine@mastodon.social avatar

@DavidDarnes @eleventy That fine-grained control is one of the (sadly very few!) benefits of having built your own SSG 😂

IMO client-side is the way to go for your link previews. But maybe embed the preview data as a json blob in your html template at build-time (does Ghost have a build time? I’m still thinking in terms of SSGs…). Avoids having that stuff in the RSS content, but also avoids a separate fetch for every link 🤷‍♂️

Either way, it’s a neat feature! I’ll enjoy seeing how you tackle it

DavidDarnes,
@DavidDarnes@mastodon.design avatar

@tomhazledine @eleventy I really need to rethink my whole setup, it’s a bit of a daisy chain of tooling and I’d like to simplify it drastically. Thanks for sharing your thoughts!

DavidDarnes,
@DavidDarnes@mastodon.design avatar

Ideally I’d turn this into a Web Component that turns a regular anchor link into a rich “card”, however you quickly bump into CORS issues. Alternative is to naively setup a whole server function to retrieve website metadata 🥴

westbrook,
@westbrook@mastodon.social avatar

@DavidDarnes You wouldn't happen to use a static site generator, something like ? I've seen some great approaches to gathering all that data as part of the build that could be attractive in your situation.

DavidDarnes,
@DavidDarnes@mastodon.design avatar

@westbrook yep! However that causes the issue I mentioned earlier in the thread, with all that extra unwanted content appearing in my RSS feed. Also it would be nice to create something more universal

westbrook,
@westbrook@mastodon.social avatar

@DavidDarnes what if the custom element API was to receive a <template> element that it then cloned into the page/shadow DOM on interaction?

DavidDarnes,
@DavidDarnes@mastodon.design avatar

@westbrook yea! Something like that would be good, better what I was thinking with slotted elements that are still floating around in the content. Would be more consistent too

DavidDarnes,
@DavidDarnes@mastodon.design avatar

Ok so how about a Web Component that pings an API with the containing links URL, it’ll then return the metadata which populates the component. Options would be the template of the rich result and the API endpoint it uses

westbrook,
@westbrook@mastodon.social avatar

@DavidDarnes Will it be a persistent card or something on hover like Wikipedia links? Might match well with https://github.com/webcomponents-cg/community-protocols/pull/45 so that consumers can then customize how the displayed card looks when projected onto the top layer with [popover], etc. 😉

DavidDarnes,
@DavidDarnes@mastodon.design avatar

@westbrook well I guess you could do that with CSS and your own template!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • mdbf
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • thenastyranch
  • Youngstown
  • InstantRegret
  • slotface
  • osvaldo12
  • kavyap
  • khanakhh
  • Durango
  • megavids
  • everett
  • cisconetworking
  • normalnudes
  • tester
  • ngwrru68w68
  • cubers
  • modclub
  • tacticalgear
  • provamag3
  • Leos
  • anitta
  • JUstTest
  • lostlight
  • All magazines