Use html_extra_template_renderer to replace the current robots.txt rendering script

This commit is contained in:
Kamil Śliwak
2021-07-15 13:29:27 +02:00
parent 2bebc2f822
commit 8c5ae508f9
3 changed files with 5 additions and 29 deletions
+5 -1
View File
@@ -161,7 +161,7 @@ html_js_files = ["js/toggle.js"]
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
html_extra_path = ["_static/css", "_static/robots.txt"]
html_extra_path = ["_static/css"]
# List of templates of static files to be included in the HTML output.
# Keys represent paths to input files and values are dicts containing:
@@ -170,6 +170,10 @@ html_extra_path = ["_static/css", "_static/robots.txt"]
# All paths must be absolute.
# Rendered templates are automatically added to html_extra_path setting.
html_extra_templates = {
os.path.join(ROOT_PATH, "robots.txt.template"): {
'target': os.path.join(ROOT_PATH, "_static/robots.txt"),
'context': {'LATEST_VERSION': version},
}
}
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,