(2022-08-28) Twitter Cards for FluxGarden

If I'm continuing to lean into Twitter as the broadcast channel of Webs Of Thinkers And Thoughts, then it's probably a good idea to improve the Preview of my pages: Twitter Cards.

My posts in Telegram give an OK preview (used to show a way-oversized headshot, I'm glad that's shrunk!)

Twitter doesn't give much

Looking at source/MetaTags - oh jeez, I'm not even filling in the title?!?

OK, changed title to node.title in template. Now filling that in:

Did it help? Yep.

Next: put the first-line into the description tag.

  • try using node.short_body|safe → empty
  • try node.short_body → empty
  • add short_body to the route, etc → realize existing logic doesn't work because I want to render Markdown to clean plaintext, not to HTML.
  • realize commonmark.py library doesn't have an option to render to clean plaintext. I found snippets that render to HTML and then use Beautiful Soup to convert HTML to plaintext! But eventually I'll probably just write a direct function.

I think I'm going to stop here for now.

Possible futures

  • update: I just realized I don't have any actual twitter:card tags! Just classic-meta, OG, and DC. So should try that first to see if it matters.
  • do that 1st-line-plaintext, per above
  • add an image? I don't usually do that, but

Edited:    |       |    Search Twitter for discussion