feat: hide the comments locally for avoiding the usage from the forkers.

This commit is contained in:
Yufan Sheng 2024-11-28 00:45:05 +08:00
parent bb8fdfbf9a
commit 2903026ab4
Signed by: syhily
GPG Key ID: DEB186763C308C31
3 changed files with 2 additions and 4 deletions

View File

@ -67,7 +67,6 @@ const Options = z
calendar: z.boolean().default(false),
}),
comments: z.object({
server: z.string().url().readonly(),
size: z.number().default(10).readonly(),
avatar: z.object({
mirror: z.string().url().readonly(),
@ -191,7 +190,6 @@ const options: z.input<typeof Options> = {
calendar: true,
},
comments: {
server: 'https://comment.yufan.me',
size: 10,
avatar: {
mirror: 'https://weavatar.com/avatar',

View File

@ -10,7 +10,7 @@ import { ELEMENT_NODE, transform, walk } from 'ultrahtml';
import sanitize from 'ultrahtml/transformers/sanitize';
// Access the artalk in internal docker host when it was deployed on zeabur.
const server = options.isProd() ? `http://${ARTALK_HOST}:23366` : options.settings.comments.server;
const server = options.isProd() ? `http://${ARTALK_HOST}:23366` : `https://${ARTALK_HOST}`;
export const loadComments = async (key: string, title: string | null, offset: number): Promise<Comments | null> => {
let params: Record<string, string | number | boolean> = {

View File

@ -30,7 +30,7 @@ const { Content, headings } = await page.render();
<TableOfContents {headings} toc={page.toc} />
<div class="post-content">
<div class="nc-light-gallery">
<Content components={{ MusicPlayer: MusicPlayer, Image: Image }} />
{page.comments && <Content components={{ MusicPlayer: MusicPlayer, Image: Image }} />}
</div>
</div>
{page.friend && <Friends />}