Skip to content

Commit cb5eb31

Browse files
committed
Update conf.py for new theme
1 parent 79e77be commit cb5eb31

File tree

2 files changed

+104
-71
lines changed

2 files changed

+104
-71
lines changed

docs/conf.py

Lines changed: 103 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
project = "Plone Documentation"
2121
copyright = "Plone Foundation"
22-
author = "the Plone community"
22+
author = "Plone Community"
2323
trademark_name = "Plone"
2424
now = datetime.now()
2525
year = str(now.year)
@@ -43,10 +43,14 @@
4343
# or your custom ones.
4444
extensions = [
4545
"myst_parser",
46+
"notfound.extension",
4647
"sphinx.ext.autodoc",
48+
"sphinx.ext.autosummary", # plone.api
49+
"sphinx.ext.graphviz",
4750
"sphinx.ext.ifconfig",
4851
"sphinx.ext.intersphinx",
4952
"sphinx.ext.todo",
53+
"sphinx.ext.viewcode", # plone.api
5054
"sphinx_copybutton",
5155
"sphinx_design",
5256
"sphinx_examples",
@@ -56,10 +60,6 @@
5660
"sphinxcontrib.httpexample", # plone.restapi
5761
"sphinxcontrib.video",
5862
"sphinxext.opengraph",
59-
"sphinx.ext.viewcode", # plone.api
60-
"sphinx.ext.autosummary", # plone.api
61-
"sphinx.ext.graphviz",
62-
"notfound.extension",
6363
]
6464

6565
# If true, the Docutils Smart Quotes transform, originally based on SmartyPants
@@ -101,7 +101,7 @@
101101
r"https://www.youtube.com/playlist", # volto, TODO remove after installing sphinxcontrib.youtube
102102
]
103103
linkcheck_anchors = True
104-
linkcheck_timeout = 10
104+
linkcheck_timeout = 5
105105
linkcheck_retries = 1
106106

107107
# The suffix of source filenames.
@@ -144,18 +144,106 @@
144144
"toc.not_readable", # Suppress `WARNING: toctree contains reference to nonexisting document 'news*'`
145145
]
146146

147-
html_js_files = ["patch_scrollToActive.js", "search_shortcut.js"]
148147

148+
# -- Options for HTML output -------------------------------------------------
149+
150+
# The theme to use for HTML and HTML Help pages. See the documentation for
151+
# a list of builtin themes.
152+
html_theme = "plone_sphinx_theme"
153+
html_logo = "_static/logo.svg"
154+
html_favicon = "_static/favicon.ico"
155+
html_theme_options = {
156+
"article_header_start": ["toggle-primary-sidebar"],
157+
"extra_footer": """<p>The text and illustrations in this website are licensed by the Plone Foundation under a Creative Commons Attribution 4.0 International license. Plone and the Plone® logo are registered trademarks of the Plone Foundation, registered in the United States and other countries. For guidelines on the permitted uses of the Plone trademarks, see <a href="https://plone.org/foundation/logo">https://plone.org/foundation/logo</a>. All other trademarks are owned by their respective owners.</p>
158+
<p>Pull request previews by <a href="https://readthedocs.org/">Read the Docs</a></p>""",
159+
"footer_end": ["version.html"],
160+
"icon_links": [
161+
{
162+
"name": "GitHub",
163+
"url": "https://github.com/plone/documentation",
164+
"icon": "fa-brands fa-square-github",
165+
"type": "fontawesome",
166+
"attributes": {
167+
"target": "_blank",
168+
"rel": "noopener me",
169+
"class": "nav-link custom-fancy-css"
170+
}
171+
},
172+
{
173+
"name": "Twitter",
174+
"url": "https://twitter.com/plone",
175+
"icon": "fa-brands fa-square-twitter",
176+
"type": "fontawesome",
177+
"attributes": {
178+
"target": "_blank",
179+
"rel": "noopener me",
180+
"class": "nav-link custom-fancy-css"
181+
}
182+
},
183+
{
184+
"name": "Mastodon",
185+
"url": "https://plone.social/@plone",
186+
"icon": "fa-brands fa-mastodon",
187+
"type": "fontawesome",
188+
"attributes": {
189+
"target": "_blank",
190+
"rel": "noopener me",
191+
"class": "nav-link custom-fancy-css"
192+
}
193+
},
194+
],
195+
"logo": {
196+
"text": "Plone Sphinx Theme",
197+
},
198+
"navigation_with_keys": True,
199+
"path_to_docs": "docs",
200+
"repository_branch": "6.0",
201+
"repository_url": "https://github.com/plone/documentation",
202+
"search_bar_text": "Search", # TODO: Confirm usage of search_bar_text in plone-sphinx-theme
203+
"switcher": {
204+
"json_url": "/_static/switcher.json",
205+
"version_match": version,
206+
},
207+
"use_edit_page_button": True,
208+
"use_issues_button": True,
209+
"use_repository_button": True,
210+
}
211+
212+
html_context = { # TODO: verify html_context usage in plone-sphinx-theme
213+
"edit_page_url_template": "https://6.docs.plone.org/contributing/index.html?{{ file_name }}#making-contributions-on-github",
214+
}
215+
216+
# Announce that we have an opensearch plugin
217+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_use_opensearch
218+
html_use_opensearch = "https://6.docs.plone.org" # TODO: Confirm usage of opensearch in theme
219+
220+
# The name for this set of Sphinx documents. If None, it defaults to
221+
# "<project> v<release> documentation".
222+
html_title = "%(project)s v%(release)s" % {"project": project, "release": release}
223+
224+
# If false, no index is generated.
225+
html_use_index = True
226+
227+
html_css_files = ["custom.css", ("print.css", {"media": "print"})]
228+
# html_js_files = ["patch_scrollToActive.js", "search_shortcut.js"] ## TODO: Remove patches
149229
html_extra_path = [
150230
"robots.txt",
151231
]
152-
153232
html_static_path = [
154233
"volto/_static",
155234
"_static", # Last path wins. See https://github.com/plone/documentation/pull/1442
156235
]
157236

158-
# -- Options for myST markdown conversion to html -----------------------------
237+
238+
# -- Options for sphinx_sitemap to html -----------------------------
239+
240+
# Used by sphinx_sitemap to generate a sitemap
241+
html_baseurl = "https://6.docs.plone.org/"
242+
# https://sphinx-sitemap.readthedocs.io/en/latest/advanced-configuration.html#customizing-the-url-scheme
243+
sitemap_url_scheme = "{link}"
244+
245+
246+
# -- Options for MyST markdown conversion to HTML -----------------------------
159247

160248
# For more information see:
161249
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
@@ -179,6 +267,7 @@
179267
"fawrench": '<span class="fa fa-wrench" style="font-size: 1.6em;"></span>',
180268
}
181269

270+
182271
# -- Intersphinx configuration ----------------------------------
183272

184273
# This extension can generate automatic links to the documentation of objects
@@ -220,6 +309,11 @@
220309
]
221310

222311

312+
# -- sphinx.ext.todo -----------------------
313+
# See http://sphinx-doc.org/ext/todo.html#confval-todo_include_todos
314+
todo_include_todos = True
315+
316+
223317
# -- sphinx-notfound-page configuration ----------------------------------
224318

225319
notfound_urls_prefix = ""
@@ -236,68 +330,6 @@
236330
}
237331

238332

239-
# -- Options for HTML output -------------------------------------------------
240-
241-
# The theme to use for HTML and HTML Help pages. See the documentation for
242-
# a list of builtin themes.
243-
#
244-
html_theme = "sphinx_book_theme"
245-
246-
html_logo = "_static/logo.svg"
247-
html_favicon = "_static/favicon.ico"
248-
249-
html_css_files = ["custom.css", ("print.css", {"media": "print"})]
250-
251-
# See http://sphinx-doc.org/ext/todo.html#confval-todo_include_todos
252-
todo_include_todos = True
253-
254-
# Announce that we have an opensearch plugin
255-
# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_use_opensearch
256-
html_use_opensearch = "https://6.docs.plone.org"
257-
258-
html_sidebars = {
259-
"**": [
260-
"sidebar-logo.html",
261-
"search-field.html",
262-
"sbt-sidebar-nav.html",
263-
]
264-
}
265-
266-
html_theme_options = {
267-
"path_to_docs": "docs",
268-
"repository_url": "https://github.com/plone/documentation",
269-
"repository_branch": "main",
270-
"use_repository_button": True,
271-
"use_issues_button": True,
272-
"use_edit_page_button": True,
273-
"search_bar_text": "Search",
274-
"switcher": {
275-
"json_url": "/_static/switcher.json",
276-
"version_match": version,
277-
},
278-
"extra_navbar": """
279-
<p class="ploneorglink">
280-
<a href="https://plone.org">
281-
<img src="/_static/logo.svg" alt="plone.org" /> plone.org</a>
282-
</p>""",
283-
"extra_footer": """<p>The text and illustrations in this website are licensed by the Plone Foundation under a Creative Commons Attribution 4.0 International license. Plone and the Plone® logo are registered trademarks of the Plone Foundation, registered in the United States and other countries. For guidelines on the permitted uses of the Plone trademarks, see <a href="https://plone.org/foundation/logo">https://plone.org/foundation/logo</a>. All other trademarks are owned by their respective owners.</p>
284-
<p><a href="https://www.netlify.com">
285-
<img src="https://www.netlify.com/img/global/badges/netlify-color-bg.svg" alt="Deploys by Netlify" />
286-
</a></p>""",
287-
}
288-
289-
# The name for this set of Sphinx documents. If None, it defaults to
290-
# "<project> v<release> documentation".
291-
html_title = "%(project)s v%(release)s" % {"project": project, "release": release}
292-
293-
# If false, no index is generated.
294-
html_use_index = True
295-
296-
# Used by sphinx_sitemap to generate a sitemap
297-
html_baseurl = "https://6.docs.plone.org/"
298-
# https://sphinx-sitemap.readthedocs.io/en/latest/advanced-configuration.html#customizing-the-url-scheme
299-
sitemap_url_scheme = "{link}"
300-
301333
# -- Options for HTML help output -------------------------------------------------
302334

303335
# Output file base name for HTML help builder.

docs/contributing/documentation/admins.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ The following are example files that you can use to configure your project for p
9898
This is the command to use to build documentation previews on Read the Docs.
9999
- [Plone Sphinx Theme `requirements-initial.txt`](https://github.com/plone/plone-sphinx-theme/blob/main/requirements-initial.txt) specifies the initial Python packaging tool requirements to set up a virtual environment.
100100
- [Plone Sphinx Theme `requirements-docs.txt`](https://github.com/plone/plone-sphinx-theme/blob/main/requirements-docs.txt) specifies the requirements to use Plone Sphinx Theme and build the docs.
101+
- [Plone Sphinx Theme `conf.py`](https://github.com/plone/plone-sphinx-theme/blob/main/docs/conf.py) the Sphinx configuration file to build the docs.
101102
- [Plone Sphinx Theme `.readthedocs.yaml`](https://github.com/plone/plone-sphinx-theme/blob/main/readthedocs.yaml) specifies the configuration and command to build the docs.
102103
- [Plone Sphinx Theme `.github/workflows/rtd-pr-preview.yml`](https://github.com/plone/plone-sphinx-theme/blob/main/.github/workflows/rtd-pr-preview.yml) specifies when to build the docs, specifically only when a pull request is opened against the `main` branch and there are changes to documentation files.
103104
You might need to adjust the branch name, paths, and files to check for changes.

0 commit comments

Comments
 (0)