From 5e19175cf5df0ff6306be36039a4abeb6a749c66 Mon Sep 17 00:00:00 2001 From: Ari Archer Date: Fri, 6 Oct 2023 17:53:29 +0300 Subject: [PATCH] update @ Fri Oct 6 17:53:29 EEST 2023 Signed-off-by: Ari Archer --- scripts/blog.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/scripts/blog.py b/scripts/blog.py index 224eeff..f64a56c 100755 --- a/scripts/blog.py +++ b/scripts/blog.py @@ -155,7 +155,7 @@ IMP_CLR: str = "\033[1m\033[35m" HTML_BEGIN: typing.Final[ str ] = """ - + @@ -172,6 +172,23 @@ HTML_BEGIN: typing.Final[ + + + int: blog_title: str = html_escape(config["title"]) author: str = html_escape(config["author"]) styles: str = os.path.join(config["assets-dir"], "styles.min.css") + lang: str = config["locale"][:2] def build_post(slug: str, post: typing.Dict[str, typing.Any]) -> None: ct: float = ctimer() @@ -857,6 +876,7 @@ def build(config: typing.Dict[str, typing.Any]) -> int: html.write( html_minify( POST_TEMPLATE.format( + lang=lang, keywords=html_escape( ", ".join( set(post["keywords"] + config["default-keywords"]) @@ -864,6 +884,7 @@ def build(config: typing.Dict[str, typing.Any]) -> int: ), theme_type=config["theme"]["type"], theme_primary=config["theme"]["primary"], + theme_secondary=config["theme"]["secondary"], styles=styles, rss=config["rss-file"], blog_title=blog_title, @@ -912,9 +933,11 @@ def build(config: typing.Dict[str, typing.Any]) -> int: index.write( html_minify( INDEX_TEMPLATE.format( # type: ignore + lang=lang, keywords=html_escape(", ".join(config["blog-keywords"])), theme_type=config["theme"]["type"], theme_primary=config["theme"]["primary"], + theme_secondary=config["theme"]["secondary"], blog=config["blog"], path="", styles=styles,