tiddlyhost / tiddlyhost-com

Rails application for creating and hosting TiddlyWiki sites, plus resources for deploying it to https://tiddlyhost.com/
Other
184 stars 17 forks source link

oEmbed / OpenGraph tags ? #250

Closed twMat closed 3 weeks ago

twMat commented 1 year ago

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?

simonbaird commented 1 year ago

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.

twMat commented 1 year ago

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

simonbaird commented 1 year ago

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

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 commented 1 year ago

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.

twMat commented 2 months ago

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

simonbaird commented 3 weeks ago

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