Skip to content

Commit

Permalink
Don't use relative URLs when deploying (#263)
Browse files Browse the repository at this point in the history
See https://docs.getpelican.com/en/latest/settings.html?highlight=RELATIVE_URLS#url-settings.

This should be used when developing locally only.

Closes #226
  • Loading branch information
stsewd authored Feb 19, 2024
1 parent bf31e93 commit ce66288
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pelicanconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit ce66288

Please sign in to comment.