Generate OpenGraph metadata for social previews and cards
See original GitHub issueContent authors can add schema.org, OpenGraph, and Twitter Cards metadata
- Book-level metadata (defaults?)
- Page/Chapter/Section-level metadata (overrides?)
Describe alternatives you’ve considered
is it already possible to include raw HTML? Front-matter metadata would be more user-friendly
Additional context
- This PR links to specs and demos how to add metadata to raw HTML pages: “DAT: Schema.org, OpenGraph, Twitter Cards” https://github.com/CodeForAntarctica/codeforantarctica.github.io/pull/3
- Here’s one way to hackishly add “Book-level” metadata to Sphinx docs: https://github.com/wrdrd/docs/blob/master/docs/conf.py#L305
def configure_meta_tags()
- Thing > CreativeWork > Book
- Thing > CreativeWork > ScholarlyArticle
- Thing > CreativeWork > LearningResource
- https://schema.org/partOf
- https://github.com/westurner/sphinxcontrib-rdf/wiki/Roadmap
- “List relevant [nbgrader] exercises by associating concept URIs with books/pages/headings and exercises” https://github.com/executablebooks/jupyter-book/issues/881
To complete this
This should be completed by deciding how to add support for the sphinxext-opengraph extension. This Sphinx extension will include opengraph metadata on all pages.
Two options:
-
Natively support it via a config section like:
opengraph: title: image: ...
-
Document how to manually enable this via Sphinx configuration in
_config.yml
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13 (7 by maintainers)
Top Results From Across the Web
OpenGraph - Preview Social Media Share and Generate ...
The Easiest Way to Preview and Generate Open Graph Meta Tags. Try the Free Meta Tag Generator and preview all Open Graph meta...
Read more >Open Graph: How to create sharable social media previews
Open Graph is all about meta tags — specifically, adding meta tags to an HTML page to explicitly define pieces of standardized information....
Read more >Open Graph - Preview or Generate Social Media Meta Tags
For SEO, use our free online og tags generator tool to preview or generate open graph meta tags for websites or blogs.
Read more >How To Add Twitter Card and Open Graph Social Metadata to ...
There are a few tools you can use to preview how your meta tags would display on a website. The Open Graph Debugger...
Read more >12 Essential Open Graph Meta Tags for Facebook and Twitter
Open graph meta tags provide more control over how social media sites display your links. Here's why they matter -- and how to...
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 couldn’t find mentions of open graph social previews in the documentation.
I just enabled this with sphinxext.opengraph and a config like this
But that doesn’t provide page-level metadata.
https://myst-parser.readthedocs.io/en/latest/using/syntax.html#setting-html-metadata :
<meta>
tags within<head>
doc.body
that will be rendered as<script type="application/ld+json" id="abstract hypothesis premise conclusion further study">