64defe7f74
A reusable comment thread any sidecar can attach to any page, tied to real logged-in accounts (never anonymous), auto-approved on submission with hide/delete moderation at /admin/comments — only a verified account can post, so there's no anonymous-spam vector to pre-vet against. Framework-level (novaconium/lib, novaconium/migrations, novaconium/pages), not App/migrations, matching Admin auth and Media manager's shape. A page needs its own sidecar to use it — this repo has no client-side JS, so comments ride the same server-rendered POST pattern as every other dynamic feature, which is also what excludes a page from the static cache. App/pages/blog/comments-demo/ demonstrates the pattern without touching existing posts that are referenced elsewhere as the sidecar-less example. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
30 lines
1.4 KiB
Twig
30 lines
1.4 KiB
Twig
{% extends '_layout/layout.twig' %}
|
|
|
|
{% import '_layout/icons.twig' as icons %}
|
|
|
|
{# Feed auto-discovery — only shows up on /blog/* pages, since only this
|
|
layout overrides the root layout's empty head_extra block. See
|
|
App/pages/blog/feed/index.php. #}
|
|
{% block head_extra %}
|
|
<link rel="alternate" type="application/rss+xml" title="{{ site_name }} Blog" href="/blog/feed">
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="blog-layout">
|
|
<aside>
|
|
<p>This sidebar exists because <code>App/pages/blog/_layout/layout.twig</code> overrides the site-wide root layout for everything under <code>/blog</code> — the nearest <code>_layout/layout.twig</code> wins, so a subtree can look different without touching the pages themselves.</p>
|
|
<p><a class="icon-link" href="/admin/docs/layouts">{{ icons.book() }}Layouts docs</a></p>
|
|
</aside>
|
|
<article>
|
|
{% block blog_content %}{% endblock %}
|
|
{# Only pages whose sidecar opts in by returning a 'comments'
|
|
key get a thread — see /admin/docs/comments and
|
|
App/pages/blog/hello-world/index.php. A sidecar-less post
|
|
never has this key, so it's silently skipped. #}
|
|
{% if comments is defined %}
|
|
{% include '_partials/comments/thread.twig' %}
|
|
{% endif %}
|
|
</article>
|
|
</div>
|
|
{% endblock %}
|