diff --git a/jwebsite/content.py b/jwebsite/content.py index a40e801..ba79f03 100644 --- a/jwebsite/content.py +++ b/jwebsite/content.py @@ -1,6 +1,6 @@ from functools import cache from pathlib import Path -from typing import Any, Iterator +from typing import Any, Iterable, Iterator from markdown import Markdown from yaml import Loader, load @@ -27,6 +27,10 @@ class ContentDirectory(Content): return current + def glob(self, pattern: str) -> Iterable[Content]: + for item in self.path.glob(pattern): + yield self.load(str(item)) + @cache # noqa: B019 def __load_children(self, name: str) -> Content: child_path = self.path / name