diff --git a/jwebsite/content.py b/jwebsite/content.py index 00c0936..f67b64c 100644 --- a/jwebsite/content.py +++ b/jwebsite/content.py @@ -33,10 +33,12 @@ class ContentDirectory(Content): for item in self.path.glob(pattern): yield self.load(str(item.relative_to(self.path))) - @cache # noqa: B019 def __load_children(self, name: str) -> Content: child_path = self.__get_localized_path(self.path / name) + return self.__load_path(child_path) + @cache # noqa: B019 + def __load_path(self, child_path: Path) -> Content: if not child_path.exists(): raise FileNotFoundError(child_path) @@ -56,6 +58,7 @@ class ContentDirectory(Content): if Content.current_language is None: return path localized_path = path.with_name(f"{path.stem}-{Content.current_language}{path.suffix}") + print(localized_path) if not localized_path.exists(): return path