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 | # Build HTML lines | 184 | # Build HTML lines |
| 185 | lines = [] | 185 | lines = [] |
| 186 | current_year = None | ||
| 187 | for post in recent: | 186 | for post in recent: |
| 188 | lines.append('\t<li class="post-list-item">') | 187 | lines.append('\t<li class="post-list-item">') |
| 189 | lines.append(f'\t\t<time datetime="{post["date_str"]}">{post["date_full"]}</time>') | 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 | for line in f: | 403 | for line in f: |
| 405 | if not title: | 404 | if not title: |
| 406 | m = header_patterns["title"].match(line) | 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 | if not date_str: | 409 | if not date_str: |
| 409 | m = header_patterns["date"].match(line) | 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 | if not slug: | 414 | if not slug: |
| 412 | m = header_patterns["slug"].match(line) | 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 | if not tags: | 419 | if not tags: |
| 415 | m = header_patterns["tags"].match(line) | 420 | m = header_patterns["tags"].match(line) |
| 416 | if m: | 421 | if m: |
| @@ -419,7 +424,8 @@ def generate_tags_page(content_dir="./content/blog", build_dir="./.build"): | |||
| 419 | continue | 424 | continue |
| 420 | m = header_patterns["draft"].match(line) | 425 | m = header_patterns["draft"].match(line) |
| 421 | if m and m.group(1).strip().lower() != "nil": | 426 | if m and m.group(1).strip().lower() != "nil": |
| 422 | is_draft = True; break | 427 | is_draft = True |
| 428 | break | ||
| 423 | if title and date_str and slug and tags: | 429 | if title and date_str and slug and tags: |
| 424 | break | 430 | break |
| 425 | 431 | ||