social-dist0rtion-protocol / www-data

webSite DIst0rtion Protocol
0 stars 0 forks source link

Post preview for Twitter #6

Open vrde opened 4 years ago

vrde commented 4 years ago

I don't see any Twitter card metadata in the blog post HTML. I guess we have to install a plugin, but I don't find any in the Hexo Plugin page.

Ideas?

TimDaub commented 4 years ago

I found: https://www.npmjs.com/package/hexo-plugin-social

Additionally, any hexo .md file also supports full HTML. So if Twitter e.g. as an <embed tag, we could use that too.

vrde commented 4 years ago

Oh I want to do the opposite. When sharing a blog post on Twitter I'd like to see the card preview in the tweet.

TimDaub commented 4 years ago
Screen Shot 2020-05-06 at 12 10 41

Apparently my blog has some way to generate previews. I'm not sure what addon it is. We could try:

TimDaub commented 3 years ago

Hexo allows adding open graph protocol tags to templates using the open_graph function.

<%- open_graph({title: page.title, image: page.image}) %>

Can be added to the post template. The yml section on top of every .md post allows adding properties to the page object.

TimDaub commented 3 years ago

Using twitter_card: "summary_large_image", the following can be achieved:

Screen Shot 2021-02-14 at 17 02 06