chore: clean up format
This commit is contained in:
parent
f571670e13
commit
9559abd0aa
1 changed files with 27 additions and 26 deletions
|
@ -1,35 +1,36 @@
|
||||||
---
|
---
|
||||||
import { siteConfig } from "../../../config";
|
import { siteConfig } from "../../../config";
|
||||||
|
|
||||||
const fediverseConfig = siteConfig.comments.fediverse;
|
const fediverseConfig = siteConfig.comments.fediverse;
|
||||||
const {
|
const {
|
||||||
instanceDomain,
|
instanceDomain,
|
||||||
useV2api,
|
useV2api,
|
||||||
token,
|
token,
|
||||||
useReverseProxy,
|
useReverseProxy,
|
||||||
reverseProxyUrl,
|
reverseProxyUrl,
|
||||||
accountId
|
accountId
|
||||||
} = fediverseConfig;
|
} = fediverseConfig;
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
path: string;
|
path: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { path } = Astro.props;
|
const { path } = Astro.props;
|
||||||
|
|
||||||
// Create the full URL to search for
|
// Create the full URL to search for
|
||||||
const fullSiteUrl = Astro.url.host;
|
const fullSiteUrl = Astro.url.host;
|
||||||
const postUrl = `https://${fullSiteUrl}${path.startsWith('/') ? path : '/' + path}`;
|
const postUrl = `https://${fullSiteUrl}${path.startsWith('/') ? path : '/' + path}`;
|
||||||
|
|
||||||
// Define the search API endpoint based on configuration
|
// Define the search API endpoint based on configuration
|
||||||
let searchEndpoint;
|
let searchEndpoint;
|
||||||
if (useReverseProxy && reverseProxyUrl) {
|
if (useReverseProxy && reverseProxyUrl) {
|
||||||
searchEndpoint = reverseProxyUrl;
|
searchEndpoint = reverseProxyUrl;
|
||||||
} else {
|
} else {
|
||||||
const apiVersion = useV2api ? 'v2' : 'v1';
|
const apiVersion = useV2api ? 'v2' : 'v1';
|
||||||
searchEndpoint = `https://${instanceDomain}/api/${apiVersion}/search`;
|
searchEndpoint = `https://${instanceDomain}/api/${apiVersion}/search`;
|
||||||
}
|
}
|
||||||
---
|
|
||||||
|
---
|
||||||
|
|
||||||
<div class="fediverse-comments">
|
<div class="fediverse-comments">
|
||||||
<div class="fediverse-status">
|
<div class="fediverse-status">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue