From 1411216aad945ac7c99c63c25b51bf5b8d75bded Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Thu, 15 Feb 2024 16:35:49 -0500 Subject: [PATCH] Don't use relative URLs when deploying See https://docs.getpelican.com/en/latest/settings.html?highlight=RELATIVE_URLS#url-settings. This should be used when developing locally only. Closes https://github.com/readthedocs/website/issues/226 --- pelicanconf.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pelicanconf.py b/pelicanconf.py index 48fc0961..3585fdf7 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -4,15 +4,15 @@ AUTHOR = 'Read the Docs, Inc' SITENAME = 'Read the Docs' -RELATIVE_URLS = True - -if os.environ.get("READTHEDOCS_VERSION_TYPE") == "external": - # Make all URLs "domainless" in the RTD PR preview - # https://docs.readthedocs.io/en/stable/reference/environment-variables.html - SITEURL = "" -else: - # This setting is needed to make the RSS/Atom feeds generate correctly - SITEURL = "https://about.readthedocs.com" + +# Use relavitve URLs for local development only. +if not os.environ.get("READTHEDOCS"): + RELATIVE_URLS = True + +# Use the correct domain for the site URL (canonical or PR preview), +# this setting is needed to make the RSS/Atom feeds generate correctly +# https://docs.readthedocs.io/en/stable/reference/environment-variables.html. +SITEURL = os.environ.get("READTHEDOCS_CANONICAL_URL", "") TIMEZONE = 'US/Pacific' DEFAULT_LANG = 'en'