feat: hide the comments locally for avoiding the usage from the forkers.
This commit is contained in:
parent
bb8fdfbf9a
commit
2903026ab4
@ -67,7 +67,6 @@ const Options = z
|
|||||||
calendar: z.boolean().default(false),
|
calendar: z.boolean().default(false),
|
||||||
}),
|
}),
|
||||||
comments: z.object({
|
comments: z.object({
|
||||||
server: z.string().url().readonly(),
|
|
||||||
size: z.number().default(10).readonly(),
|
size: z.number().default(10).readonly(),
|
||||||
avatar: z.object({
|
avatar: z.object({
|
||||||
mirror: z.string().url().readonly(),
|
mirror: z.string().url().readonly(),
|
||||||
@ -191,7 +190,6 @@ const options: z.input<typeof Options> = {
|
|||||||
calendar: true,
|
calendar: true,
|
||||||
},
|
},
|
||||||
comments: {
|
comments: {
|
||||||
server: 'https://comment.yufan.me',
|
|
||||||
size: 10,
|
size: 10,
|
||||||
avatar: {
|
avatar: {
|
||||||
mirror: 'https://weavatar.com/avatar',
|
mirror: 'https://weavatar.com/avatar',
|
||||||
|
@ -10,7 +10,7 @@ import { ELEMENT_NODE, transform, walk } from 'ultrahtml';
|
|||||||
import sanitize from 'ultrahtml/transformers/sanitize';
|
import sanitize from 'ultrahtml/transformers/sanitize';
|
||||||
|
|
||||||
// Access the artalk in internal docker host when it was deployed on zeabur.
|
// 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> => {
|
export const loadComments = async (key: string, title: string | null, offset: number): Promise<Comments | null> => {
|
||||||
let params: Record<string, string | number | boolean> = {
|
let params: Record<string, string | number | boolean> = {
|
||||||
|
@ -30,7 +30,7 @@ const { Content, headings } = await page.render();
|
|||||||
<TableOfContents {headings} toc={page.toc} />
|
<TableOfContents {headings} toc={page.toc} />
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
<div class="nc-light-gallery">
|
<div class="nc-light-gallery">
|
||||||
<Content components={{ MusicPlayer: MusicPlayer, Image: Image }} />
|
{page.comments && <Content components={{ MusicPlayer: MusicPlayer, Image: Image }} />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{page.friend && <Friends />}
|
{page.friend && <Friends />}
|
||||||
|
Loading…
Reference in New Issue
Block a user