Open Graph protocol and link sharing
See original GitHub issueIt 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:
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:
… 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
OPG
support might be incorporated elsewhere (e.g.sphinx-contrib/ogp
).- Here’s a liquid template for generating some of these: https://github.com/hayesall/hayesall.github.io/blob/fee47f82f5cb489f14cbe8018cf812733670138c/_includes/open-graph.html
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
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