update @ Fri Oct 6 21:56:06 EEST 2023

Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
Ari Archer 2023-10-06 21:56:06 +03:00
parent 31a96d308f
commit 7f0081726a
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: A50D5B4B599AF8A2
6 changed files with 9 additions and 21 deletions

View file

@ -1,5 +1,5 @@
[build]
command = "sh scripts/netlify.sh"
command = "CI=1 NOCLR=1 python3 ./scripts/blog.py static"
[[redirects]]
from = "/git/*"

View file

@ -1,4 +1,4 @@
minify-html-onepass
html-minifer
rcssmin
mistune
typing

View file

@ -1,2 +0,0 @@
[toolchain]
channel = "stable"

View file

@ -24,7 +24,7 @@ from threading import Thread
from timeit import default_timer as code_timer
from warnings import filterwarnings as filter_warnings
import minify_html_onepass
import html_minifier.minify # type: ignore
import mistune
import mistune.core
import mistune.inline_parser
@ -571,6 +571,10 @@ def process_css_file(file: str, out: str) -> None:
css.write(process_css_from_file(file))
def min_html(code: str) -> str:
return html_minifier.minify.Minifier(code).minify() # type: ignore
# markdown
TITLE_LINKS_RE: typing.Final[str] = r"<#:[^>]+?>"
@ -891,7 +895,7 @@ def build(config: dict[str, typing.Any]) -> int:
with open(f"{post_dir}/index.html", "w") as html:
html.write(
minify_html_onepass.minify(
min_html(
POST_TEMPLATE.format(
lang=lang,
keywords=html_escape(
@ -933,7 +937,6 @@ def build(config: dict[str, typing.Any]) -> int:
path=f"{config['posts-dir']}/{slug}",
license=config["license"],
),
True,
)
)
@ -949,7 +952,7 @@ def build(config: dict[str, typing.Any]) -> int:
with open("index.html", "w") as index:
index.write(
minify_html_onepass.minify(
min_html(
INDEX_TEMPLATE.format( # type: ignore
lang=lang,
keywords=html_escape(", ".join(config["blog-keywords"])),
@ -982,7 +985,6 @@ def build(config: dict[str, typing.Any]) -> int:
for slug, post in config["posts"].items()
),
),
True,
)
)

View file

@ -1,12 +0,0 @@
!/usr/bin/env sh
set -xeu
main() {
pip install -r requirements/requirements.txt
CI=1 NOCLR=1 python3 ./scripts/blog.py static
rm -rf ./scripts/ ./requirements/
}
main "$@"