Compare commits

...

1 Commits

Author SHA1 Message Date
Martin Trigaux
8a018f8de7 [IMP] conf: add sitemap generation
Use sphinx-sitemap library to generate the sitemap
Requires at least sphinx-sitemap 1.1.0
2020-08-06 14:57:33 +02:00
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -1,2 +1,3 @@
Sphinx>=2.4.0
sphinx_sitemap
Werkzeug==0.14.1