Commit b9fd010d1c
Verified · cmc
Layout: unified · split
build.py +11 −5
| @@ -183,7 +183,6 @@ def get_recent_posts_html(content_dir="./content/blog", num_posts=3): | ||
| 183 | 183 | |
| 184 | 184 | # Build HTML lines |
| 185 | 185 | lines = [] |
| 186 | current_year = None | |
| 187 | 186 | for post in recent: |
| 188 | 187 | lines.append('\t<li class="post-list-item">') |
| 189 | 188 | lines.append(f'\t\t<time datetime="{post["date_str"]}">{post["date_full"]}</time>') |
| @@ -404,13 +403,19 @@ def generate_tags_page(content_dir="./content/blog", build_dir="./.build"): | ||
| 404 | 403 | for line in f: |
| 405 | 404 | if not title: |
| 406 | 405 | m = header_patterns["title"].match(line) |
| 407 | if m: title = m.group(1).strip(); continue | |
| 406 | if m: | |
| 407 | title = m.group(1).strip() | |
| 408 | continue | |
| 408 | 409 | if not date_str: |
| 409 | 410 | m = header_patterns["date"].match(line) |
| 410 | if m: date_str = m.group(1); continue | |
| 411 | if m: | |
| 412 | date_str = m.group(1) | |
| 413 | continue | |
| 411 | 414 | if not slug: |
| 412 | 415 | m = header_patterns["slug"].match(line) |
| 413 | if m: slug = m.group(1).strip(); continue | |
| 416 | if m: | |
| 417 | slug = m.group(1).strip() | |
| 418 | continue | |
| 414 | 419 | if not tags: |
| 415 | 420 | m = header_patterns["tags"].match(line) |
| 416 | 421 | if m: |
| @@ -419,7 +424,8 @@ def generate_tags_page(content_dir="./content/blog", build_dir="./.build"): | ||
| 419 | 424 | continue |
| 420 | 425 | m = header_patterns["draft"].match(line) |
| 421 | 426 | if m and m.group(1).strip().lower() != "nil": |
| 422 | is_draft = True; break | |
| 427 | is_draft = True | |
| 428 | break | |
| 423 | 429 | if title and date_str and slug and tags: |
| 424 | 430 | break |
| 425 | 431 | |