diff --git a/stsg/build.py b/stsg/build.py index 6fa8d8d..4615eb7 100644 --- a/stsg/build.py +++ b/stsg/build.py @@ -48,8 +48,9 @@ class ArticleTranslation: if self.file.suffix == ".md": self.article_content = markdown.markdown(self.article_content) - self.url = "/" + self.language_code + self.article_overview.url - self.dist_path = Path(DIST_DIRECTORY, self.url.strip("/")) + self.location_in_tree = [self.language_code, *self.article_overview.location_in_tree] + self.url = "/" + "/".join(self.location_in_tree) + self.dist_path = Path(DIST_DIRECTORY, *self.location_in_tree) _language_info = DEFAULT_LANGUAGE parsed_language_code = self.language_code.lower().replace("-", "_") @@ -97,7 +98,6 @@ class ArticleOverview: self.location_in_tree: List[str] = location_in_tree or [] self.location_in_tree.append(self.slug) - self.url = "/" + "/".join(self.location_in_tree) self.dist_path = Path(DIST_DIRECTORY, *self.location_in_tree)