Skip to content

Commit d9ab6b9

Browse files
committed
Do not crash if site_url is missing but fallback and log
1 parent 579fd6b commit d9ab6b9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mkdocs_rss_plugin/util.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ def build_url(self, base_url: str, path: str, args_dict: dict = None) -> str:
8787
:return: complete and valid URL
8888
:rtype: str
8989
"""
90+
if not base_url:
91+
logger.error(
92+
"[rss-plugin] Base url not set, probably because 'site_url' is not set "
93+
"in Mkdocs configuration file. Using an empty string instead."
94+
)
95+
base_url = ""
96+
9097
# Returns a list in the structure of urlparse.ParseResult
9198
url_parts = list(urlparse(base_url))
9299
url_parts[2] += path

0 commit comments

Comments
 (0)