From 3c8266edb08da56e4abfb58dd44576494ef3f2b0 Mon Sep 17 00:00:00 2001 From: blissful Date: Sat, 22 Jun 2024 23:27:32 -0400 Subject: [PATCH] add analytics b/c evil --- scripts/build.py | 5 +++-- src/head.jinja | 5 +++++ src/index.jinja | 7 ++----- src/posts/template.jinja | 6 ++---- 4 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 src/head.jinja 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" %} sunset glow +
diff --git a/src/posts/template.jinja b/src/posts/template.jinja index 95f020f..8d4e220 100644 --- a/src/posts/template.jinja +++ b/src/posts/template.jinja @@ -1,11 +1,9 @@ - - - - + {% include "head.jinja" %} {{ meta.title }} +