-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for social media cards #8441
Conversation
Confirmed: Jermolene has already signed the Contributor License Agreement (see contributing.md) |
The next release of TiddlyWiki will include a $:/core/templates/social-metadata tiddler that will produce metadata used by social media link previews. Provide some tiddler content to make that work for TW5 sites on Tiddlyhost. See TiddlyWiki/TiddlyWiki5#8441
Tangentially related question: To inject tiddlers I'm inserting something like this into the dom:
Is there a way to do something like and create a shadowTiddler? In the past it was possible to add a tiddler div to the |
In TiddlyWiki Classic shadow tiddlers were stored in a single hashmap. In TiddlyWiki 5 shadows are automatically created at startup from the tiddlers within the loaded plugins. So, the approach for TW5 would be to pack your tiddlers into a plugin, and then inject that. You'd be injecting a single tiddler with the usual plugin fields, with its content being a JSON hashmap of the constituent tiddlers. The info mechanism in the core works similarly by dynamically creating a plugin at startup on the browser side. It uses the title |
Thanks for the info re shadow tiddlers. |
Lgtm. |
The next release of TiddlyWiki will include a $:/core/templates/social-metadata tiddler that will produce metadata used by social media link previews. Provide some tiddler content to make that work for TW5 sites on Tiddlyhost. See TiddlyWiki/TiddlyWiki5#8441
Great, thank you @simonbaird – I'll add the new system tiddlers to the control panel and then this can be merged. |
In 213a786 I've added a control panel user interface for setting the social media card information. |
The control panel name and the name in the template don't match. I figured the shorter name is better, but let me know if you like the longer name. This is a small fix for recently merged PR TiddlyWiki#8441.
I noticed a mismatch in one of the names:
Create the #8496 PR to fix it, assuming the shorter name is preferred. |
I think there's a problem with a space being eaten in the meta tag. I'm seeing this:
(which gets even more garbled when parsed and rendered by Tiddlyhost.) |
Perhaps |
The control panel name and the name in the template don't match. I figured the shorter name is better, but let me know if you like the longer name. This is a small fix for recently merged PR #8441.
Apologies @simonbaird this is the belated fix to the issue you mentioned in #8441 (comment)
As discussed in #8433, this PR adds a new raw markup template that conditionally creates Facebook/Twitter social card meta tags. The tiddlers used (alongside the existing
$:/SiteTitle
and$:/SiteSubtitle
) are:$:/SiteDomain
- plain domain of the site$:/SitePreviewUrl
- full URL of thumbnail (relative URLs do not work)$:/SiteUrl
- full URL of the site