From 688872a0354d6b0e5cf9d08866bb88f46e11c5ba Mon Sep 17 00:00:00 2001 From: mrkrk <61203964+grey-cat-1908@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:08:10 +0300 Subject: [PATCH] disable minification for old blog posts --- build.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/build.py b/build.py index ceb39b3..e0001db 100644 --- a/build.py +++ b/build.py @@ -61,15 +61,18 @@ def generate_html_content(directory, filename, is_blog=False): meta_data = parse_meta(meta) - template_to_use = blog_template_text if is_blog else template_text - - return minify_html.minify( - template_to_use.replace("{{%CONTENT%}}", markdown_renderer(md_text)) + if is_blog: + return blog_template_text.replace("{{%CONTENT%}}", markdown_renderer(md_text)) .replace("{{%TITLE%}}", meta.get("title", "")) - .replace("{{%META%}}", meta_data), - minify_js=True, - remove_processing_instructions=True, - ) + .replace("{{%META%}}", meta_data) + else: + return minify_html.minify( + template_text.replace("{{%CONTENT%}}", markdown_renderer(md_text)) + .replace("{{%TITLE%}}", meta.get("title", "")) + .replace("{{%META%}}", meta_data), + minify_js=True, + remove_processing_instructions=True, + ) def copy_static_files(static_dir, build_dir="build"):