From 4ab42f95433ad2058140ffd286a9534e9fb21eb7 Mon Sep 17 00:00:00 2001 From: grassblock Date: Mon, 21 Jul 2025 16:45:21 +0800 Subject: [PATCH] feat: remove the path attribute requirement from comments --- src/components/Comments.astro | 12 ++++-------- src/components/helper/comments/Artalk.astro | 4 +--- src/components/helper/comments/Fediverse.astro | 9 +-------- src/pages/blog/[...slug].astro | 2 +- 4 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/components/Comments.astro b/src/components/Comments.astro index af05d36..e6e6bd4 100644 --- a/src/components/Comments.astro +++ b/src/components/Comments.astro @@ -8,15 +8,11 @@ import Giscus from "./helper/comments/Giscus.astro"; const method = siteConfig.comments.type const FediverseConfig = siteConfig.comments.fediverse -interface Props { - path?: string; -} -let { path='/' } = Astro.props; --- -{method === 'artalk' && } -{method === 'giscus' && } +{method === 'artalk' && } +{method === 'giscus' && } -{(method === 'fediverse' && !FediverseConfig.renderOnServer ) && } -{(method === 'fediverse' && FediverseConfig.renderOnServer ) &&

Loading comments...

} +{(method === 'fediverse' && !FediverseConfig.renderOnServer ) && } +{(method === 'fediverse' && FediverseConfig.renderOnServer ) &&

Loading comments...

} {method === 'hatsu' && } \ No newline at end of file diff --git a/src/components/helper/comments/Artalk.astro b/src/components/helper/comments/Artalk.astro index ad52a8b..b39dadb 100644 --- a/src/components/helper/comments/Artalk.astro +++ b/src/components/helper/comments/Artalk.astro @@ -2,12 +2,10 @@ import {siteConfig} from "../../../config"; import 'artalk/Artalk.css'; const ArtalkInstanceDomain = siteConfig.comments.artalk.instanceDomain - -const { path } = Astro.props; ---
-
+