mirror of
https://github.com/zensical/zensical.git
synced 2026-05-03 17:40:31 +00:00
zensical:fix - edit_uri doesn't use docs_dir for default
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
This commit is contained in:
@@ -161,16 +161,17 @@ def _apply_defaults(config: dict, path: str) -> dict:
|
||||
# Set defaults for repository name settings
|
||||
repo_url = config.get("repo_url")
|
||||
if repo_url and not config.get("repo_name"):
|
||||
docs_dir = config.get("docs_dir")
|
||||
host = urlparse(repo_url).hostname or ""
|
||||
if host == "github.com":
|
||||
set_default(config, "repo_name", "GitHub", str)
|
||||
set_default(config, "edit_uri", "edit/master/docs", str)
|
||||
set_default(config, "edit_uri", f"edit/master/{docs_dir}", str)
|
||||
elif host == "gitlab.com":
|
||||
set_default(config, "repo_name", "GitLab", str)
|
||||
set_default(config, "edit_uri", "edit/master/docs", str)
|
||||
set_default(config, "edit_uri", f"edit/master/{docs_dir}", str)
|
||||
elif host == "bitbucket.org":
|
||||
set_default(config, "repo_name", "Bitbucket", str)
|
||||
set_default(config, "edit_uri", "src/default/docs", str)
|
||||
set_default(config, "edit_uri", f"src/default/{docs_dir}", str)
|
||||
elif host:
|
||||
config["repo_name"] = host.split(".")[0].title()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user