From f170d2ca9036bf67a467fd59045f14fb3a461dcd Mon Sep 17 00:00:00 2001 From: Nora Goodman Date: Tue, 27 May 2025 16:21:15 -0400 Subject: [PATCH] Fix some directory issues --- style.css => assets/style.css | 0 builder.py | 12 ++++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) rename style.css => assets/style.css (100%) diff --git a/style.css b/assets/style.css similarity index 100% rename from style.css rename to assets/style.css diff --git a/builder.py b/builder.py index d1b4909..ffcb0a1 100644 --- a/builder.py +++ b/builder.py @@ -5,6 +5,7 @@ import re from pytz import timezone from datetime import datetime import bisect +import shutil from jinja2 import Environment, PackageLoader, select_autoescape scraper_path = 'scraper/' @@ -60,13 +61,16 @@ for folder in os.listdir(scraper_path): post['caption'] = file.read() if ('timestamp' in post.keys()): - with open(output_path + 'posts/' + str(post['timestamp']) +'.html', 'w+') as output_file: + with open('posts/' + str(post['timestamp']) +'.html', 'w+') as output_file: output_file.write(post_template.render(post=post)) homepage_template = env.get_template("index.html") -with open(output_path + 'index.html', "w+") as output_file: +with open(output_path + '/index.html', "w+") as output_file: output_file.write(homepage_template.render()) -with open(output_path + 'blog.html', "w+") as output_file: - output_file.write(blog_template.render(posts=posts)) \ No newline at end of file +with open(output_path + '/blog.html', "w+") as output_file: + output_file.write(blog_template.render(posts=posts)) + +# copy all assets to be in the output +shutil.copytree('assets/', 'static/', dirs_exist_ok=True) \ No newline at end of file