diff --git a/scripts/build.py b/scripts/build.py index 9d8d402..ad3ce6f 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -17,8 +17,9 @@ import jinja2 # type: ignore import pytz # type: ignore +PROJECT_DIR = os.environ["PROJECT_ROOT"] -je = jinja2.Environment() +je = jinja2.Environment(loader=jinja2.FileSystemLoader(f"{PROJECT_DIR}/src")) # DATA @@ -165,7 +166,7 @@ def compile_feed(posts: PostIndex): def main(): - os.chdir(os.environ["PROJECT_ROOT"]) + os.chdir(PROJECT_DIR) with Path("src/posts/index.json").open("r") as fp: posts = {k: PostMeta.parse(v) for k, v in json.load(fp).items()} diff --git a/src/head.jinja b/src/head.jinja new file mode 100644 index 0000000..d5217ef --- /dev/null +++ b/src/head.jinja @@ -0,0 +1,5 @@ + + + + + diff --git a/src/index.jinja b/src/index.jinja index b2db182..6cd38be 100644 --- a/src/index.jinja +++ b/src/index.jinja @@ -1,12 +1,9 @@
- - - - - + {% include "head.jinja" %}