Jerry's Blog

Back

评论系统

页面底部的评论系统

Waline 评论系统#

主题的评论、阅读统计、点赞等功能均由 Waline 提供。

移除#

如果你有某些原因需要移除评论系统,或者只是想了解如何更换为其他评论系统,本部分可能对你有所帮助。但如果你只是想了解如何配置,可以跳过本部分。

按以下步骤移除:

  1. src/site.config.ts 中将 enable 设置为 false
src/site.config.ts
export const integ: IntegrationUserConfig = {
  // ...
  waline: {
    enable: false
  }
}
ts
  1. 移除依赖 @waline/client
bun remove @waline/client
shell
  1. 删除文件夹 src/components/waline

  2. 移除以下布局中的相关代码:

  • src/layouts/CommonPage.astro
  • src/layouts/BlogPost.astro
  1. 移除以下文件中为之前编辑的布局配置的相关配置,如 commentview
  • src/pages/about/index.astro
  • src/pages/links/index.astro
  • src/pages/projects/index.astro
  • 其他博客文章的 frontmatter 配置(如果存在)

部署#

你可以参考其文档进行配置,推荐使用 Vercel + Supabase 组合。

配置#

然后在 integrationConfig.server 中配置 Waline 评论系统。

使用#

你可以在 .astro.mdx 文件中手动调用。

import { Comment } from '@/components/waline'

// prettier-ignore
<Comment />
jsx

渲染效果: