Skip to content

Commit 9eda09c

Browse files
committed
add OpenGraph Tags extension
This auto generates :og: tags in the html These are used by browsers to display previews for links
1 parent 970f681 commit 9eda09c

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

conf.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def tagged_commit():
8989
"sphinx.ext.intersphinx",
9090
# 'sphinx.ext.autosectionlabel'
9191
"myst_parser",
92+
"sphinxext.opengraph",
9293
]
9394

9495
myst_enable_extensions = [
@@ -388,5 +389,15 @@ def tagged_commit():
388389
intersphinx_mapping["ammr"] = ("https://anyscript.org/ammr-doc/", None)
389390

390391

392+
# -- Options for OpenGraph Ext. ----------------------------------------------
393+
# settings to control how the OpenGraph extension generates meta tags
394+
ogp_site_url = "https://anyscript.org/"
395+
ogp_site_name = "AnyScript Tutorials"
396+
ogp_image = "https://anyscript.org/tutorials/_static/anybody_tutorials_logo.png"
397+
ogp_use_first_image = True # if not found defaults to 'ogp_image'
398+
399+
400+
401+
391402
def setup(app):
392403
app.add_css_file("custom.css")

environment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ channels:
44
- conda-forge
55
dependencies:
66
- python=3.9
7+
- pip
78
- sphinx
89
- myst-parser
910
- linkify-it-py
1011
- make
1112
- cloud_sptheme
1213
- pygments_anyscript
1314
- ipython
15+
- jinja2=3.0.3
16+
- pip:
17+
- sphinxext-opengraph

0 commit comments

Comments
 (0)