question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Open Graph protocol and link sharing

See original GitHub issue

It would be cool if there was a configuration option to support Open Graph protocol or Twitter cards when sharing examples:

  • Open Graph protocol: “enables any web page to become a rich object in a social graph.
  • Twitter Cards: “… you can attach rich photos, videos and media experiences to Tweets.

I think this could be accomplished by adding relevant meta tags to the head when generating pages.

Some examples for how this might look

Current version

Using scikit-learn as an example, sharing the linear_model and plot_comparison pages on Slack results in the following:

image

But the generated image, description, and a few other things could also be part of this.

Possible version

Now using this web page as an example, sharing a link results in:

image

… because of the following meta tags:

<!-- Open Graph -->
<meta property="og:locale" content="en">
<meta property="og:type" content="article">
<meta property="og:title" content="LaTeX Finite Automata and State Diagrams with Tikz">
<meta property="og:description" content="This short guide collects some examples of drawing finite state machines using the Tikz LaTeX library.">
<meta property="og:url" content="https://hayesall.com/blog/latex-automata/">

Other notes

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
rowanc1commented, Jun 16, 2020

I believe that the meta tags have to be in the head (at least last time I did this) as well as in the static server rendered html. There is a nice way to check that they are working across sites here:

If helpful, this is what I use on my sites: https://github.com/iooxa/iooxa-dev/blob/master/src/partials/meta.tpl

2reactions
choldgrafcommented, Jun 11, 2020

I think the one thing we should double-check is that meta tags for opengraph work outside of the <head> of a page. If they do, then I think this is a good idea. If they don’t, then it might be trickier to get this working across different themes

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Open Graph and how can I use it for my website?
Open Graph is an internet protocol that was originally created by Facebook to standardize the use of metadata within a webpage to represent...
Read more >
Open Graph: How to create sharable social media previews
The Open Graph protocol and sharing ... Sharing a link automagically generates a preview card at the bottom of the tweet.
Read more >
Webmasters - Sharing - Meta for Developers - Facebook
Most content is shared to Facebook as a URL, so it's important that you mark up your website with Open Graph tags to...
Read more >
Open Graph Protocol for Facebook Explained with Examples
Through the Open Graph protocol, you can tell Facebook how your shared content should be displayed on Facebook. This protocol tells Facebook ...
Read more >
Open Graph: Create Eye-Catching Social Media Snippets
Open Graphs tags are one way to earn more views on social media. These useful tags determine how your link previews appear on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found