Move relative path check from Site.build to SiteConfig

This commit is contained in:
2026-09-08 04:02:17 +02:00
parent 4351ea8e0d
commit ea14de6200
2 changed files with 3 additions and 2 deletions
+3
View File
@@ -42,6 +42,9 @@ class SiteConfig:
else: else:
path = Path("/") path = Path("/")
if not path.is_absolute():
raise ConfigError("base_url config property must not be a relative path")
return (origin, path) return (origin, path)
@staticmethod @staticmethod
-2
View File
@@ -183,8 +183,6 @@ class Site:
"base_url config value is missing a domain name, " "base_url config value is missing a domain name, "
"can't add canonical url to content" "can't add canonical url to content"
) )
if not self.config.base_dir.is_absolute():
raise ConfigError("base_url config value must be an absolute path")
self.discover() self.discover()
outputs: list[Output] = [*self.directories, *self.content] outputs: list[Output] = [*self.directories, *self.content]
for output in sorted(outputs, key=lambda o: o.destination.as_posix()): for output in sorted(outputs, key=lambda o: o.destination.as_posix()):