Skip to content

Docs: Add opengraph #10066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/_static/img/logo-opengraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 18 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@

sys.path.append(os.path.abspath("_ext"))
extensions = [
"hoverxref.extension",
"multiproject",
"sphinx.ext.autosectionlabel",
"myst_parser",
"notfound.extension",
"sphinx_design",
"sphinx_search.extension",
"sphinx_tabs.tabs",
"sphinx-prompt",
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinxcontrib.httpdomain",
"sphinxcontrib.video",
"sphinx_tabs.tabs",
"sphinx-prompt",
"notfound.extension",
"hoverxref.extension",
"sphinx_search.extension",
"sphinxemoji.sphinxemoji",
"sphinx_design",
"myst_parser",
"sphinxext.opengraph",
]

multiproject_projects = {
Expand All @@ -52,6 +53,15 @@

docset = get_project(multiproject_projects)

ogp_site_name = "Read the Docs Documentation"
ogp_use_first_image = True # https://github.com/readthedocs/blog/pull/118
ogp_image = "https://docs.readthedocs.io/en/stable/_static/img/logo-opengraph.png"
# Inspired by https://github.com/executablebooks/MyST-Parser/pull/404/
ogp_custom_meta_tags = [
'<meta name="twitter:card" content="summary_large_image" />',
]
ogp_enable_meta_description = True
ogp_description_length = 300

templates_path = ["_templates"]

Expand Down
1 change: 1 addition & 0 deletions requirements/docs.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ sphinxemoji
sphinxcontrib-httpdomain
sphinx-prompt
sphinx-autobuild
sphinxext-opengraph

# Markdown
myst_parser
Expand Down
28 changes: 27 additions & 1 deletion requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ click==8.1.3
# via sphinx-intl
colorama==0.4.6
# via sphinx-autobuild
contourpy==1.0.7
# via matplotlib
cycler==0.11.0
# via matplotlib
docutils==0.18.1
# via
# myst-parser
# sphinx
# sphinx-rtd-theme
# sphinx-tabs
fonttools==4.38.0
# via matplotlib
idna==3.4
# via requests
imagesize==1.4.1
Expand All @@ -32,6 +38,8 @@ jinja2==3.1.2
# via
# myst-parser
# sphinx
kiwisolver==1.4.4
# via matplotlib
livereload==2.6.3
# via sphinx-autobuild
markdown-it-py==2.1.0
Expand All @@ -40,21 +48,35 @@ markdown-it-py==2.1.0
# myst-parser
markupsafe==2.1.2
# via jinja2
matplotlib==3.7.0
# via sphinxext-opengraph
mdit-py-plugins==0.3.4
# via myst-parser
mdurl==0.1.2
# via markdown-it-py
myst-parser==0.18.1
# via -r requirements/docs.in
numpy==1.24.2
# via
# contourpy
# matplotlib
packaging==23.0
# via sphinx
# via
# matplotlib
# sphinx
pbr==5.11.1
# via sphinxcontrib-video
pillow==9.4.0
# via matplotlib
pygments==2.14.0
# via
# sphinx
# sphinx-prompt
# sphinx-tabs
pyparsing==3.0.9
# via matplotlib
python-dateutil==2.8.2
# via matplotlib
pytz==2022.7.1
# via babel
pyyaml==6.0
Expand All @@ -66,6 +88,7 @@ requests==2.28.2
six==1.16.0
# via
# livereload
# python-dateutil
# sphinxcontrib-httpdomain
snowballstemmer==2.2.0
# via sphinx
Expand All @@ -83,6 +106,7 @@ sphinx==5.3.0
# sphinx-tabs
# sphinxcontrib-httpdomain
# sphinxemoji
# sphinxext-opengraph
sphinx-autobuild==2021.3.14
# via -r requirements/docs.in
sphinx-design==0.3.0
Expand Down Expand Up @@ -123,6 +147,8 @@ sphinxcontrib-video @ git+https://github.com/readthedocs/sphinxcontrib-video/
# via -r requirements/docs.in
sphinxemoji==0.2.0
# via -r requirements/docs.in
sphinxext-opengraph==0.8.1
# via -r requirements/docs.in
tornado==6.2
# via livereload
typing-extensions==4.5.0
Expand Down