Skip to content

Commit b2fc000

Browse files
committed
add open graph metadata to docs
1 parent 6ccf994 commit b2fc000

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

docs/source/conf.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
# -- Project information -----------------------------------------------------
2727

2828
project = "IDOM"
29+
title = "IDOM Docs"
30+
description = (
31+
"IDOM is a Python web framework for building interactive websites without needing "
32+
"a single line of Javascript. It can be run standalone, in a Jupyter Notebook, or "
33+
"as part of an existing application."
34+
)
2935
copyright = "2020, Ryan Morshead"
3036
author = "Ryan Morshead"
3137

@@ -74,6 +80,7 @@
7480
"sphinx_copybutton",
7581
"sphinx_reredirects",
7682
"sphinx_design",
83+
"sphinxext.opengraph",
7784
# custom extensions
7885
"async_doctest",
7986
"autogen_api_docs",
@@ -126,10 +133,12 @@
126133

127134
# -- Extension Configuration ------------------------------------------------------
128135

136+
129137
# -- sphinx.ext.autosectionlabel ---
130138

131139
autosectionlabel_skip_docs = ["_auto/apis"]
132140

141+
133142
# -- sphinx.ext.autodoc --
134143

135144
# show base classes for autodoc
@@ -140,6 +149,7 @@
140149
# order autodoc members by their order in the source
141150
autodoc_member_order = "bysource"
142151

152+
143153
# -- sphinx_reredirects --
144154

145155
redirects = {
@@ -148,10 +158,29 @@
148158
"examples": "creating-interfaces/index.html",
149159
}
150160

161+
162+
# -- sphinxext.opengraph --
163+
164+
ogp_site_url = "https://idom-docs.herokuapp.com/"
165+
ogp_image = "https://raw.githubusercontent.com/idom-team/idom/main/branding/png/idom-logo-black.png"
166+
# We manually specify this below
167+
# ogp_description_length = 200
168+
ogp_type = "website"
169+
ogp_custom_meta_tags = [
170+
# Open Graph Meta Tags
171+
f'<meta property="og:title" content="{title}">',
172+
f'<meta property="og:description" content="{description}">',
173+
# Twitter Meta Tags
174+
f'<meta name="twitter:card" content="summary_large_image">',
175+
f'<meta name="twitter:creator" content="@rmorshea">',
176+
f'<meta name="twitter:site" content="@rmorshea">',
177+
]
178+
179+
151180
# -- Options for HTML output -------------------------------------------------
152181

153182
# Set the page title
154-
html_title = "IDOM Docs"
183+
html_title = title
155184

156185
# The theme to use for HTML and HTML Help pages. See the documentation for
157186
# a list of builtin themes.

requirements/build-docs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ sphinx-autobuild ==2020.9.1
77
sphinx-reredirects ==0.0.1
88
sphinx-design ==0.0.13
99
sphinx-resolve-py-references ==0.1.0
10+
sphinxext-opengraph ==0.5.1

0 commit comments

Comments
 (0)