From 9559abd0aa627bb2a2dbc57eb145ab1c8d9244b5 Mon Sep 17 00:00:00 2001 From: grassblock Date: Sat, 10 May 2025 22:10:44 +0800 Subject: [PATCH] chore: clean up format --- .../helper/comments/Fediverse.astro | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/components/helper/comments/Fediverse.astro b/src/components/helper/comments/Fediverse.astro index 9b1017c..23943e6 100644 --- a/src/components/helper/comments/Fediverse.astro +++ b/src/components/helper/comments/Fediverse.astro @@ -1,35 +1,36 @@ --- - import { siteConfig } from "../../../config"; +import { siteConfig } from "../../../config"; - const fediverseConfig = siteConfig.comments.fediverse; - const { - instanceDomain, - useV2api, - token, - useReverseProxy, - reverseProxyUrl, - accountId - } = fediverseConfig; +const fediverseConfig = siteConfig.comments.fediverse; +const { + instanceDomain, + useV2api, + token, + useReverseProxy, + reverseProxyUrl, + accountId +} = fediverseConfig; - interface Props { - path: string; - } +interface Props { + path: string; +} - const { path } = Astro.props; +const { path } = Astro.props; - // Create the full URL to search for - const fullSiteUrl = Astro.url.host; - const postUrl = `https://${fullSiteUrl}${path.startsWith('/') ? path : '/' + path}`; +// Create the full URL to search for +const fullSiteUrl = Astro.url.host; +const postUrl = `https://${fullSiteUrl}${path.startsWith('/') ? path : '/' + path}`; - // Define the search API endpoint based on configuration - let searchEndpoint; - if (useReverseProxy && reverseProxyUrl) { - searchEndpoint = reverseProxyUrl; - } else { - const apiVersion = useV2api ? 'v2' : 'v1'; - searchEndpoint = `https://${instanceDomain}/api/${apiVersion}/search`; - } - --- +// Define the search API endpoint based on configuration +let searchEndpoint; +if (useReverseProxy && reverseProxyUrl) { + searchEndpoint = reverseProxyUrl; +} else { + const apiVersion = useV2api ? 'v2' : 'v1'; + searchEndpoint = `https://${instanceDomain}/api/${apiVersion}/search`; +} + +---