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]
|
[build]
|
||||||
command = "sh scripts/netlify.sh"
|
command = "CI=1 NOCLR=1 python3 ./scripts/blog.py static"
|
||||||
|
|
||||||
[[redirects]]
|
[[redirects]]
|
||||||
from = "/git/*"
|
from = "/git/*"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
minify-html-onepass
|
html-minifer
|
||||||
rcssmin
|
rcssmin
|
||||||
mistune
|
mistune
|
||||||
typing
|
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 timeit import default_timer as code_timer
|
||||||
from warnings import filterwarnings as filter_warnings
|
from warnings import filterwarnings as filter_warnings
|
||||||
|
|
||||||
import minify_html_onepass
|
import html_minifier.minify # type: ignore
|
||||||
import mistune
|
import mistune
|
||||||
import mistune.core
|
import mistune.core
|
||||||
import mistune.inline_parser
|
import mistune.inline_parser
|
||||||
|
@ -571,6 +571,10 @@ def process_css_file(file: str, out: str) -> None:
|
||||||
css.write(process_css_from_file(file))
|
css.write(process_css_from_file(file))
|
||||||
|
|
||||||
|
|
||||||
|
def min_html(code: str) -> str:
|
||||||
|
return html_minifier.minify.Minifier(code).minify() # type: ignore
|
||||||
|
|
||||||
|
|
||||||
# markdown
|
# markdown
|
||||||
|
|
||||||
TITLE_LINKS_RE: typing.Final[str] = r"<#:[^>]+?>"
|
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:
|
with open(f"{post_dir}/index.html", "w") as html:
|
||||||
html.write(
|
html.write(
|
||||||
minify_html_onepass.minify(
|
min_html(
|
||||||
POST_TEMPLATE.format(
|
POST_TEMPLATE.format(
|
||||||
lang=lang,
|
lang=lang,
|
||||||
keywords=html_escape(
|
keywords=html_escape(
|
||||||
|
@ -933,7 +937,6 @@ def build(config: dict[str, typing.Any]) -> int:
|
||||||
path=f"{config['posts-dir']}/{slug}",
|
path=f"{config['posts-dir']}/{slug}",
|
||||||
license=config["license"],
|
license=config["license"],
|
||||||
),
|
),
|
||||||
True,
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -949,7 +952,7 @@ def build(config: dict[str, typing.Any]) -> int:
|
||||||
|
|
||||||
with open("index.html", "w") as index:
|
with open("index.html", "w") as index:
|
||||||
index.write(
|
index.write(
|
||||||
minify_html_onepass.minify(
|
min_html(
|
||||||
INDEX_TEMPLATE.format( # type: ignore
|
INDEX_TEMPLATE.format( # type: ignore
|
||||||
lang=lang,
|
lang=lang,
|
||||||
keywords=html_escape(", ".join(config["blog-keywords"])),
|
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()
|
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