@@ -52,7 +52,7 @@ autosummary_generate = True
5252autosummary_imported_members = False
5353
5454project = 'TRIQS DFTTools'
55- version = '@PROJECT_VERSION @'
55+ version = '@BRANCH_FOR_DOC @'
5656
5757# this makes the current project version available as var in every rst file
5858rst_epilog = """
@@ -71,6 +71,12 @@ html_theme = 'sphinx_rtd_theme'
7171# this loads the custom css file to change the page width
7272html_style = 'css/custom.css'
7373
74+ # Point search engines at the evergreen "latest" build of each page via a
75+ # rel="canonical" link. Setting this in *every* version build (unstable, X.Y.x,
76+ # ...) consolidates ranking signals onto the latest/ docs so they are preferred
77+ # over older versions in search results.
78+ html_baseurl = 'https://triqs.github.io/@PROJECT_NAME@/latest/'
79+
7480html_favicon = '@CMAKE_CURRENT_SOURCE_DIR@/_static/triqs_logo/triqs_favicon.ico'
7581#html_logo = '@CMAKE_CURRENT_SOURCE_DIR@/logos/logo.png'
7682
@@ -92,7 +98,18 @@ html_theme_options = {
9298
9399html_show_sphinx = False
94100
95- html_context = {'header_title': 'TRIQS DFTTools'}
101+ html_context = {
102+ 'header_title': 'TRIQS DFTTools',
103+ # Version switcher flyout (rendered by _templates/versions.html, which
104+ # overrides the empty versions.html shipped by sphinx_rtd_theme 3.x). The
105+ # list is static -- update it when a new release line is published.
106+ 'current_version': version,
107+ 'versions': [
108+ ['unstable', 'https://triqs.github.io/@PROJECT_NAME@/unstable/'],
109+ ['4.0.x', 'https://triqs.github.io/@PROJECT_NAME@/4.0.x/'],
110+ ['3.3.x', 'https://triqs.github.io/@PROJECT_NAME@/3.3.x/'],
111+ ],
112+ }
96113
97114html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_static']
98115html_sidebars = {'index': ['sideb.html', 'searchbox.html']}
0 commit comments