From a869a9f343477b169d7ee3ac8de9589cdbc8127c Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 22:11:21 +0000 Subject: Commit from GitHub Actions (Ruff) --- build.py | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/build.py b/build.py index 15d6b10..bde34a4 100644 --- a/build.py +++ b/build.py @@ -185,7 +185,9 @@ def get_recent_posts_html(content_dir="./content/blog", num_posts=3): lines = [] for post in recent: lines.append('\t
  • ') - lines.append(f'\t\t') + lines.append( + f'\t\t' + ) lines.append(f'\t\t{post["title"]}') lines.append("\t
  • ") @@ -358,6 +360,7 @@ def inject_blog_year_separators(blog_index_path="./.build/blog/index.html"): date_pattern = re.compile(r"datetime=['\"]?(\d{4})-\d{2}-\d{2}['\"]?") current_year = None + def replace_item(m): nonlocal current_year item_html = m.group(1) @@ -382,13 +385,22 @@ def generate_tags_page(content_dir="./content/blog", build_dir="./.build"): with one section per tag, each post listed under its tags, sorted newest first. Tags link to anchor IDs on the same page. """ - TAG_ORDER = ["audit", "emacs", "linux", "personal", "privacy", "security", "self-hosting", "web"] + TAG_ORDER = [ + "audit", + "emacs", + "linux", + "personal", + "privacy", + "security", + "self-hosting", + "web", + ] header_patterns = { "title": re.compile(r"^#\+title:\s*(.+)$", re.IGNORECASE), - "date": re.compile(r"^#\+date:\s*[\[<](\d{4}-\d{2}-\d{2})"), - "slug": re.compile(r"^#\+slug:\s*(.+)$", re.IGNORECASE), - "tags": re.compile(r"^#\+filetags:\s*(.+)$", re.IGNORECASE), + "date": re.compile(r"^#\+date:\s*[\[<](\d{4}-\d{2}-\d{2})"), + "slug": re.compile(r"^#\+slug:\s*(.+)$", re.IGNORECASE), + "tags": re.compile(r"^#\+filetags:\s*(.+)$", re.IGNORECASE), "draft": re.compile(r"^#\+draft:\s*(.+)$", re.IGNORECASE), } @@ -439,7 +451,14 @@ def generate_tags_page(content_dir="./content/blog", build_dir="./.build"): for tag in tags: if tag in tag_map: - tag_map[tag].append({"title": title, "slug": slug, "date_obj": date_obj, "date_str": date_str}) + tag_map[tag].append( + { + "title": title, + "slug": slug, + "date_obj": date_obj, + "date_str": date_str, + } + ) for tag in tag_map: tag_map[tag].sort(key=lambda x: x["date_obj"], reverse=True) @@ -458,10 +477,12 @@ def generate_tags_page(content_dir="./content/blog", build_dir="./.build"): f'
  • ' f'' f'{p["title"]}' - f'
  • ' + f"" for p in posts ) - sections.append(f'

    {tag}

    \n') + sections.append( + f'

    {tag}

    \n' + ) html = f""" -- cgit v1.2.3