Skip to content

Commit 83ed9b1

Browse files
committed
conf.py: Fall back to default locations for _templates and _static.
1 parent 52ce962 commit 83ed9b1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

conf.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,13 @@
4343
]
4444

4545
# Add any paths that contain templates here, relative to this directory.
46-
if os.environ["templates_path"]:
46+
if os.environ.get("templates_path"):
4747
templates_path = [os.environ["templates_path"]]
4848
if not all(os.path.isdir(x) for x in templates_path):
4949
raise RuntimeError(f"Some member of templates_path does not exist: {templates_path}")
50+
else:
51+
# Fallback: Assume next to conf.py
52+
templates_path = ["_templates"]
5053

5154
# The suffix(es) of source filenames.
5255
# You can specify multiple suffix as a list of string:
@@ -104,7 +107,11 @@
104107
# Add any paths that contain custom static files (such as style sheets) here,
105108
# relative to this directory. They are copied after the builtin static files,
106109
# so a file named "default.css" will overwrite the builtin "default.css".
107-
html_static_path = [os.environ["html_static_path"]]
110+
if os.environ.get("html_static_path"):
111+
html_static_path = [os.environ.get("html_static_path")]
112+
else:
113+
# Fallback: Assume next to conf.py
114+
html_static_path = ["_static"]
108115

109116

110117
# -- Options for HTMLHelp output ------------------------------------------

0 commit comments

Comments
 (0)