forked from retoor/devplacepy
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:
@@ -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;">💬 {{ item.comment_count }}</span>
|
||||
<a href="/posts/{{ item.post['uid'] }}" class="post-action-btn share">↗︎ Open</a>
|
||||
<a href="/posts/{{ item.post['slug'] or item.post['uid'] }}" class="post-action-btn share">↗︎ 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>
|
||||
|
||||
Reference in New Issue
Block a user