评论系统
页面底部的评论系统
Waline 评论系统#
主题的评论、阅读统计、点赞等功能均由 Waline ↗ 提供。
移除#
如果您有一些原因需要移除评论系统,或者只是想了解如何更换为其他评论系统,本节可能会对您有所帮助。但如果您想了解如何配置它,可以跳过本节。
通过以下步骤移除它:
-
在
src/site.config.ts中将enable设置为false。src/site.config.ts
tsexport const integ: IntegrationUserConfig = { // ... waline: { enable: false } } -
移除依赖
@waline/client:
shellbun remove @waline/client -
移除文件夹
src/components/waline。 -
移除这些布局中的相关代码:
src/layouts/CommonPage.astrosrc/layouts/BlogPost.astro
-
移除这些文件中为之前编辑的布局配置的相关配置,如
comment或view:src/pages/about/index.astrosrc/pages/links/index.astrosrc/pages/projects/index.astro- 其他存在的博客文章 frontmatter 配置
部署#
您可以参考其文档进行配置,建议使用 Vercel ↗ + Supabase ↗ 组合。
配置#
然后,您可以在 integrationConfig.server 中配置 Waline 评论系统。
src/site.config.ts
export const integ: IntegrationUserConfig = {
// ...
waline: {
enable: true,
// Server service link
server: 'https://astro-theme-pure-waline.arthals.ink/',
// Refer https://waline.js.org/en/guide/features/emoji.html
emoji: ['bmoji', 'weibo'],
// Refer https://waline.js.org/en/reference/client/props.html
additionalConfigs: {
pageview: true,
comment: true
// ...
}
}
}ts使用#
您可以在 .astro 或 .mdx 文件中手动调用它。
import { Comment } from '@/components/waline'
// prettier-ignore
<Comment />jsx渲染效果:
Comment seems to stuck. Try to refresh?✨