Skip to content

Commit 3b3238b

Browse files
committed
fix: raise an exception if site_url is not set
1 parent 39d459a commit 3b3238b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mkdocs_embed_file_plugins/src/links_correction.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ def convert_links_if_markdown(quote_str, base):
2020
# search for links
2121
links = re.findall(r"\[([^\]]*)\]\(([^\)]*)\)", quote_str)
2222
base_data, url_blog, md_link_path = base
23+
if not url_blog:
24+
# generate a fake url for the links
25+
raise Exception("site_url is not defined in mkdocs.yml")
26+
2327
url_blog_path = [x for x in url_blog.split("/") if len(x) > 0]
2428
url_blog_path = url_blog_path[len(url_blog_path) - 1]
2529
for link in links:

0 commit comments

Comments
 (0)