From 0c6229088c4aa68ccf759eee0cf0b9e2a09e282d Mon Sep 17 00:00:00 2001 From: Ricardo Date: Thu, 5 Mar 2026 13:22:32 +0100 Subject: [PATCH] feat: rework single post view for better content hierarchy - Add post-type header (Reply/Like/Repost/Bookmark/Note) for titleless posts - Add left accent border to user content on interaction posts - Collapse AI Usage box into a compact
summary line - Collapse comments section when empty, auto-open when comments exist - Collapse webmention send form behind
toggle Confab-Link: http://localhost:8080/sessions/648a550c-4f65-46be-b9a9-6b7e0fd90751 --- _includes/components/comments.njk | 173 ++++++++++++++------------- _includes/components/webmentions.njk | 51 ++++---- _includes/layouts/post.njk | 55 ++++----- js/comments.js | 1 + 4 files changed, 146 insertions(+), 134 deletions(-) diff --git a/_includes/components/comments.njk b/_includes/components/comments.njk index 6943098..ddf074c 100644 --- a/_includes/components/comments.njk +++ b/_includes/components/comments.njk @@ -1,4 +1,5 @@ {# Comments section — shown on post pages before webmentions #} +{# Collapsed when empty, auto-opens when comments exist #} {% set absoluteUrl = site.url + page.url %} @@ -6,91 +7,103 @@ x-data="commentsSection('{{ absoluteUrl }}')" x-init="init()"> -

Comments

+
+ +

+ Comments + +

+ +
- {# Status messages #} -
- -
- - {# Sign-in form (shown when not authenticated) #} -
-

Sign in with your website to comment:

-
-
- - +
+ {# Status messages #} +
+
- - -
- {# Comment form (shown when authenticated) #} -
-
- Signed in as - - -
- -
- -
- - -
-
-
- - {# Comment list #} -
- - - - -
+ {# Comment form (shown when authenticated) #} +
+
+ Signed in as + + +
+ +
+ +
+ + +
+
+
+ + {# Comment list #} +
+ + + + + +
+
+
diff --git a/_includes/components/webmentions.njk b/_includes/components/webmentions.njk index 1ba4f96..971984b 100644 --- a/_includes/components/webmentions.njk +++ b/_includes/components/webmentions.njk @@ -175,27 +175,32 @@ {% endif %} -{# Webmention send form #} -
-

+{# Webmention send form — collapsed by default #} +
+ + Send a Webmention -

-

- Have you written a response to this post? Send a webmention by entering your post URL below. -

-
- - - -
-
+ +
+

+ Have you written a response to this post? Send a webmention by entering your post URL below. +

+
+ + + +
+
+
diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk index 36492f9..6e11371 100644 --- a/_includes/layouts/post.njk +++ b/_includes/layouts/post.njk @@ -3,8 +3,20 @@ layout: layouts/base.njk withBlogSidebar: true ---
+ {# Support both camelCase (Indiekit Eleventy preset) and underscore (legacy) property names #} + {% set bookmarkedUrl = bookmarkOf or bookmark_of %} + {% set likedUrl = likeOf or like_of %} + {% set replyTo = inReplyTo or in_reply_to %} + {% set repostedUrl = repostOf or repost_of %} + {% if title %}

{{ title }}

+ {% else %} +
+ + {% if replyTo %}↩ Reply{% elif likedUrl %}♥ Like{% elif repostedUrl %}♻ Repost{% elif bookmarkedUrl %}🔖 Bookmark{% else %}✎ Note{% endif %} + +
{% endif %} {% endif %} -
+ {% set isInteraction = replyTo or likedUrl or repostedUrl or bookmarkedUrl %} + {% set hasContent = content and content | striptags | trim %} +
{{ content | safe }}
- {# AI usage disclosure #} + {# AI usage disclosure — collapsed by default #} {% set aiTextLevel = aiTextLevel or ai_text_level %} {% set aiCodeLevel = aiCodeLevel or ai_code_level %} {% set aiTools = aiTools or ai_tools %} {% set aiDescription = aiDescription or ai_description %} {% if aiTextLevel or aiCodeLevel or aiTools %} - +
{% endif %} {# Rich reply context with h-cite microformat #} diff --git a/js/comments.js b/js/comments.js index afb8c46..11219e4 100644 --- a/js/comments.js +++ b/js/comments.js @@ -19,6 +19,7 @@ document.addEventListener("alpine:init", () => { statusMessage: "", statusType: "info", maxLength: 2000, + showForm: false, async init() { await this.checkSession();