[IMP] conf: add sitemap generation
Use sphinx-sitemap library to generate the sitemap Requires at least sphinx-sitemap 1.1.0
This commit is contained in:
parent
40f1536166
commit
8a018f8de7
7
conf.py
7
conf.py
@ -33,6 +33,7 @@ extensions = [
|
||||
'odoo',
|
||||
'demo_link',
|
||||
'embedded_video',
|
||||
'sphinx_sitemap'
|
||||
'github_link',
|
||||
'html_domain',
|
||||
'redirects',
|
||||
@ -308,6 +309,8 @@ github_project = 'documentation-user'
|
||||
# Where are stored the localisations files
|
||||
locale_dirs = ['locale/']
|
||||
|
||||
i18n_url_scheme = "/{version}/{lang}/{link}"
|
||||
|
||||
LANGUAGES = {
|
||||
'de': 'German',
|
||||
'en': 'English',
|
||||
@ -412,6 +415,10 @@ def localize(app, pagename, templatename, context, doctree):
|
||||
(la.split('_')[0] if la != 'en' else 'x-default', _build_url(app.config.canonical_root, (la != 'en' and la or ''), pagename))
|
||||
for la in app.config.languages.split(',')
|
||||
]
|
||||
if not app.config.html_baseurl:
|
||||
# remove last fragment containing the version
|
||||
root = '/'.join(app.config.canonical_root.rstrip('/').split('/')[:-1])
|
||||
app.config["html_baseurl"] = root
|
||||
|
||||
def canonicalize(app, pagename, templatename, context, doctree):
|
||||
""" Adds a 'canonical' URL for the current document in the rendering
|
||||
|
@ -1,2 +1,3 @@
|
||||
Sphinx>=2.4.0
|
||||
Werkzeug==0.14.1
|
||||
sphinx_sitemap
|
||||
Werkzeug==0.14.1
|
||||
|
Loading…
Reference in New Issue
Block a user