From 82838b59a1d5227ab19272192eeb315dacdfef6e Mon Sep 17 00:00:00 2001 From: Bobby Hiltz Date: Fri, 18 Apr 2025 13:59:40 +0200 Subject: [PATCH] * changed atom encoding to utf-8 in order to pass https://validator.w3.org/feed/ feed validation * changed replace space in tags with dash --- blag/blag.py | 2 +- blag/markdown.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/blag/blag.py b/blag/blag.py index ed6db15..51e681d 100644 --- a/blag/blag.py +++ b/blag/blag.py @@ -396,7 +396,7 @@ def generate_feed( ) with open(f"{output_dir}/atom.xml", "w") as fh: - feed.write(fh, encoding="utf8") + feed.write(fh, encoding="utf-8") def generate_index( diff --git a/blag/markdown.py b/blag/markdown.py index ee4c573..8c584b7 100644 --- a/blag/markdown.py +++ b/blag/markdown.py @@ -51,6 +51,7 @@ def convert_markdown( * `date` is converted into datetime with local timezone * `tags` is interpreted as a comma-separeted list of strings. All strings are stripped and converted to lower case. + All strings have spaces replaced with dashes. Parameters ---------- @@ -85,6 +86,7 @@ def convert_markdown( tags = meta["tags"].split(",") tags = [t.lower() for t in tags] tags = [t.strip() for t in tags] + tags = [t.replace(" ","-") for t in tags] meta["tags"] = tags return content, meta