feat: add threaded comments with polymorphic targets and slug-based routing

Introduce `load_comments` helper supporting polymorphic target types (post, project, bug) with nested parent-child threading. Refactor comment creation to use `target_type`/`target_uid` and `resolve_target_redirect` for correct redirects. Replace raw UID-based post/project routes with slug-aware resolution via `resolve_post`/`resolve_project` and `make_combined_slug`. Update SEO, sitemap, and FAB styling to use slugs and hardcoded red accent. Add reusable `_comment_section.html` template.
This commit is contained in:
2026-05-11 18:49:45 +00:00
parent 1e0960e0dd
commit f7ca123cd6
20 changed files with 427 additions and 222 deletions
+2 -2
View File
@@ -176,7 +176,7 @@
<div class="post-actions">
<span class="post-action-btn" style="cursor: default;">+{{ item.post.get('stars', 0) }}</span>
<span class="post-action-btn" style="cursor: default;">&#x1F4AC; {{ item.comment_count }}</span>
<a href="/posts/{{ item.post['uid'] }}" class="post-action-btn share">&#x2197;&#xFE0E; Open</a>
<a href="/posts/{{ item.post['slug'] or item.post['uid'] }}" class="post-action-btn share">&#x2197;&#xFE0E; Open</a>
</div>
</article>
{% else %}
@@ -184,7 +184,7 @@
{% endfor %}
{% elif current_tab == 'projects' %}
{% for p in projects %}
<a href="/projects/{{ p['uid'] }}" class="project-card fade-in" style="display: block; text-decoration: none; color: inherit;">
<a href="/projects/{{ p['slug'] or p['uid'] }}" class="project-card fade-in" style="display: block; text-decoration: none; color: inherit;">
<div class="project-card-header">
<h3 class="project-card-title">{{ p['title'] }}</h3>
</div>