Skip to content

Commit db36a40

Browse files
committed
add redirect template for SEO purposes
1 parent c4e44b4 commit db36a40

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<html><head><meta name="robots" content="noindex"><noscript><meta http-equiv="refresh" content="0; url=${to_uri}" /></noscript><script>var target = "${to_uri}";if (window.location.hash) {window.location.replace(target + window.location.hash);} else {window.location.replace(target);}</script></head></html>

docs/docsite/rst/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,10 @@ def setup(app: Sphinx) -> dict[str, bool | str]:
404404

405405
redirects_config_path = DOCS_ROOT_DIR.parent / "declarative-configs" / "ansible_redirects.toml"
406406
redirects = tomllib.loads(redirects_config_path.read_text())
407+
redirect_template = DOCS_ROOT_DIR.parent / ".templates" / "redirect_template.html"
407408

408409
app.config.redirects = redirects
410+
app.config.redirect_html_template_file = redirect_template
409411
app.setup_extension('sphinx_reredirects') # redirect pages that have been restructured or removed
410412

411413
return {

0 commit comments

Comments
 (0)