diff options
author | Nguyễn Gia Phong <cnx@loang.net> | 2024-08-03 03:24:27 +0900 |
---|---|---|
committer | Nguyễn Gia Phong <cnx@loang.net> | 2024-08-03 03:26:38 +0900 |
commit | 0205043946e5991275c7b3bcb6c7150033ebfe83 (patch) | |
tree | 09186e6d3448f7e7bdd5c2ef8693cc00d4cd778b | |
parent | cfe4bc9832b74c9cffa8c5687f684bcce4c43752 (diff) | |
download | site-0205043946e5991275c7b3bcb6c7150033ebfe83.tar.gz |
Stop minifying HTML and CSS
Web server already compresses them.
-rwxr-xr-x | _libs/postprocess | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/_libs/postprocess b/_libs/postprocess index 8416d3b..a031a9f 100755 --- a/_libs/postprocess +++ b/_libs/postprocess @@ -20,10 +20,8 @@ from contextlib import suppress from pathlib import Path from shutil import rmtree -from css_html_js_minify import html_minify, process_single_css_file - -FOOTNOTES_START = re.compile('(<p>)?\s*<table') -FOOTNOTES_END = re.compile('</table>\s*(</p>)?') +FOOTNOTES_START = re.compile(r'(<p>)?\s*<table') +FOOTNOTES_END = re.compile(r'</table>\s*(</p>)?') def fix_footnotes(html): @@ -32,10 +30,9 @@ def fix_footnotes(html): site = Path(__file__).parent.parent / '__site' -process_single_css_file(site/'css'/'style.css', overwrite=True) for html in site.rglob('*.html'): - print('Minifying and fixing up', html) - html.write_text(fix_footnotes(html_minify(html.read_text()))) + print('Fixing up', html) + html.write_text(fix_footnotes(html.read_text())) for rss in site.rglob('feed.xml'): print('Fixing up', rss) rss.write_text(fix_footnotes(rss.read_text())) |