mirror of
https://git.ari.lt/ari.lt/blog.ari.lt.git
synced 2025-02-04 09:39:25 +01:00
update @ Fri Oct 6 21:56:06 EEST 2023
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
parent
31a96d308f
commit
7f0081726a
6 changed files with 9 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
|||
[build]
|
||||
command = "sh scripts/netlify.sh"
|
||||
command = "CI=1 NOCLR=1 python3 ./scripts/blog.py static"
|
||||
|
||||
[[redirects]]
|
||||
from = "/git/*"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
minify-html-onepass
|
||||
html-minifer
|
||||
rcssmin
|
||||
mistune
|
||||
typing
|
|
@ -1,2 +0,0 @@
|
|||
[toolchain]
|
||||
channel = "stable"
|
|
@ -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,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -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 "$@"
|
||||
|
Loading…
Add table
Reference in a new issue