Astro Theme Pure

Back

评论系统

页面底部的评论系统

Waline 评论系统#

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

移除#

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

通过以下步骤移除它:

  1. src/site.config.ts 中将 enable 设置为 false

    src/site.config.ts
    export const integ: IntegrationUserConfig = {
      // ...
      waline: {
        enable: false
      }
    }
    ts
  2. 移除依赖 @waline/client

    bun remove @waline/client
    shell
  3. 移除文件夹 src/components/waline

  4. 移除这些布局中的相关代码:

    • src/layouts/CommonPage.astro
    • src/layouts/BlogPost.astro
  5. 移除这些文件中为之前编辑的布局配置的相关配置,如 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

渲染效果:

Comment seems to stuck. Try to refresh?✨