Skip to content

Commit

Permalink
docs: update 404 page for new doc site and bug link
Browse files Browse the repository at this point in the history
When someone receives a 404, the splash page should no longer
point to https://canonical-cloud-init.readthedocs-hosted.com
as Canonical now has a CNAME docs.cloud-init.io available.

Add a documentation bug link for broken references which
allow users to quickly report a bug with a failed link if
necessary.
  • Loading branch information
blackboxsw committed Mar 2, 2024
1 parent b538549 commit bb9eed4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions doc/rtd/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,22 @@
r"https://github.com/canonical/ubuntu-pro-client.*",
)

new_doc_issue_link = (
"https://github.com/canonical/cloud-init/issues/new?"
"labels=documentation%2C+new&projects=&template=documentation.md&"
"title=%5Bdocs%5D%3A+missing+redirect"
)
docs_url = "https://docs.cloud-init.io"

# Sphinx-copybutton config options:
notfound_body = (
"<h1>Page not found</h1><p>Sorry we missed you! Our docs have had a"
" remodel and some deprecated links have changed.</p><p>"
"<a href='https://canonical-cloud-init.readthedocs-hosted.com'>Back to our"
" homepage now hosted at"
" https://canonical-cloud-init.readthedocs-hosted.com</a></p>"
" remodel and some deprecated links have changed. Please"
f" <a href='{new_doc_issue_link}'>file a documentation bug</a> and"
" we'll fix this redirect.</p><p>"
f"<a href='{docs_url}'>Back to our homepage hosted at {docs_url}</a></p>"
)

notfound_context = {
"title": "Page not found",
"body": notfound_body,
Expand Down

0 comments on commit bb9eed4

Please sign in to comment.