mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Added warning for social plugin when site_url is not defined
This commit is contained in:
parent
ed6f0b1b57
commit
b8161e0179
@ -77,6 +77,13 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]):
|
|||||||
)
|
)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
# Check if site URL is defined
|
||||||
|
if not config.site_url:
|
||||||
|
log.warning(
|
||||||
|
"The \"social\" plugin needs the \"site_url\" configuration "
|
||||||
|
"option to be defined. It will likely not work correctly."
|
||||||
|
)
|
||||||
|
|
||||||
# Ensure presence of cache directory
|
# Ensure presence of cache directory
|
||||||
self.cache = self.config.cache_dir
|
self.cache = self.config.cache_dir
|
||||||
if not os.path.isdir(self.cache):
|
if not os.path.isdir(self.cache):
|
||||||
@ -262,7 +269,7 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]):
|
|||||||
|
|
||||||
# Resolve image URL
|
# Resolve image URL
|
||||||
url = "{}.png".format(posixpath.join(
|
url = "{}.png".format(posixpath.join(
|
||||||
config.site_url,
|
config.site_url or ".",
|
||||||
directory,
|
directory,
|
||||||
file
|
file
|
||||||
))
|
))
|
||||||
|
@ -77,6 +77,13 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]):
|
|||||||
)
|
)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
# Check if site URL is defined
|
||||||
|
if not config.site_url:
|
||||||
|
log.warning(
|
||||||
|
"The \"social\" plugin needs the \"site_url\" configuration "
|
||||||
|
"option to be defined. It will likely not work correctly."
|
||||||
|
)
|
||||||
|
|
||||||
# Ensure presence of cache directory
|
# Ensure presence of cache directory
|
||||||
self.cache = self.config.cache_dir
|
self.cache = self.config.cache_dir
|
||||||
if not os.path.isdir(self.cache):
|
if not os.path.isdir(self.cache):
|
||||||
@ -262,7 +269,7 @@ class SocialPlugin(BasePlugin[SocialPluginConfig]):
|
|||||||
|
|
||||||
# Resolve image URL
|
# Resolve image URL
|
||||||
url = "{}.png".format(posixpath.join(
|
url = "{}.png".format(posixpath.join(
|
||||||
config.site_url,
|
config.site_url or ".",
|
||||||
directory,
|
directory,
|
||||||
file
|
file
|
||||||
))
|
))
|
||||||
|
Loading…
Reference in New Issue
Block a user