From 3ae3dbdab525bcdb12b809c007ca114840688952 Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Wed, 17 Dec 2025 15:44:21 +0800 Subject: feat: mutually exclusively toggle comment and webmention sections --- layouts/_partials/components/toggle-button.html | 46 ++++++++++++++++++++----- 1 file changed, 37 insertions(+), 9 deletions(-) (limited to 'layouts/_partials/components/toggle-button.html') diff --git a/layouts/_partials/components/toggle-button.html b/layouts/_partials/components/toggle-button.html index 3aef1509..2b1de2f9 100644 --- a/layouts/_partials/components/toggle-button.html +++ b/layouts/_partials/components/toggle-button.html @@ -9,11 +9,13 @@ - countId: (string, optional) Override for count element ID. Defaults to "{id}-count". - sectionId: (string, optional) Override for section element ID. Defaults to "{id}-section". - buttonId: (string, optional) Override for button element ID. Defaults to "{id}-toggle". + - group: (string, optional) Mutual exclusion group name. If provided, opening this toggle will close others in the same group. */}} {{ $id := .id }} {{ $buttonId := default (printf "%s-toggle" $id) .buttonId }} {{ $sectionId := default (printf "%s-section" $id) .sectionId }} {{ $countId := default (printf "%s-count" $id) .countId }} +{{ $group := .group }}