tiddlyhost icon indicating copy to clipboard operation
tiddlyhost copied to clipboard

oEmbed / OpenGraph tags ?

Open twMat opened this issue 3 years ago • 5 comments

On talk.tiddlywiki.com I was going to post a link to a TH wiki by inserting the url on a separate row. There's some board feature that apparently fetches data from the linked to site but for my attempt I got this:

image

Considering that it is used on talk.tiddlywiki.com , is this something that could be resolved from TiddlyHost? Or is it something about the very wiki being fetched?

twMat avatar Oct 08 '22 20:10 twMat

Looks like the solution involves adding some meta tags, something like this:

<meta property="og:title" content="Colby Fayock - A UX Designer &amp; Front-end Developer Blog" />
<meta property="og:type" content="website" />
<meta property="og:image" content="/static/website-social-card-44070c4a901df708aa1563ac4bbe595a.jpg" />
<meta property="og:url" content="https://www.colbyfayock.com" />

(Example via https://www.freecodecamp.org/news/what-is-open-graph-and-how-can-i-use-it-for-my-website/ .)

The idea of having Tiddlyhost inject those is interesting, and I think reasonably easy to achieve.

I think you could also add them yourself using TiddlyWiki's own mechanism for adding content to the head tag, which is to use the $:/tags/RawMarkup tag. Let me see if I can do it.

simonbaird avatar Oct 09 '22 17:10 simonbaird

OK, so in the end it is a wiki-local matter and not a server matter, good to know. As you propose though, to have Tiddlyhost inject it is probably a good idea so that arbitrary "talk" forum users can link to arbitrary TH hosted wikis.

Thank you

twMat avatar Oct 10 '22 04:10 twMat

Here's an experiment to demonstrate how you can do it:

  • https://simon.tiddlyhost.com/#OpenGraph%20Tags%20Test
  • https://www.opengraph.xyz/url/https%3A%2F%2Fsimon.tiddlyhost.com

Obviously the thumbnail image would be a nice choice for the image, but currently the thumbnail url changes everytime the site is saved. I'll make a new issue to suggest a static url for public site thumbnails.

simonbaird avatar Oct 10 '22 12:10 simonbaird

I've implemented #251 - there's now a static url for thumbnails, e.g. https://tiddlygoo.tiddlyhost.com/thumb.png . It's a little low-res, so it doesn't look great, but you can use it for an opengraph image if you wish. See https://www.opengraph.xyz/url/https%3A%2F%2Fsimon.tiddlyhost.com which now uses the thumbnail image.

simonbaird avatar Oct 10 '22 22:10 simonbaird

For the record, I've posted an issue on this in the TW repo: link

twMat avatar Jul 27 '24 14:07 twMat

This is coming soon in the next TW release. I'd still like to to #255, but this can close I think.

simonbaird avatar Sep 09 '24 15:09 simonbaird