feat: comments

This commit is contained in:
mei
2026-11-23 16:36:30 +08:00
parent 7e7f408b4d
commit b42cd57eaf
2 changed files with 26 additions and 4 deletions
+13 -4
View File
@@ -757,8 +757,8 @@ post:
enable: true
# 指定的插件,需要同时设置对应插件的必要参数
# The specified plugin needs to set the necessary parameters at the same time
# Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo | cusdis | giscus | discuss
type: utterances
# Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo | cusdis | giscus | discuss | mei | mei
type: mei
#---------------------------
@@ -769,6 +769,15 @@ post:
# Enable comments need to be set `post: comments: enable: true`, then set the corresponding comment plugin parameters below according to `type`
#---------------------------
# Mei Comments
# 自托管的评论系统(GitHub 登录 + utterances 迁移),样式跟随 Fluid 主题
# Self-hosted comments (GitHub login + utterances migration), styled for Fluid
# See: comments/README.md
mei_comments:
# Go 评论服务地址,末尾不要加斜杠
# Base URL of the Go comment service, without a trailing slash
server: https://comments.mmeiblog.cn
# Utterances
# 基于 GitHub Issues
# Based on GitHub Issues
@@ -1136,8 +1145,8 @@ links:
enable: true
# 指定的插件,需要同时设置对应插件的必要参数
# The specified plugin needs to set the necessary parameters at the same time
# Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo | cusdis | giscus | discuss
type: utterances
# Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo | cusdis | giscus | discuss | mei
type: mei
#---------------------------
@@ -0,0 +1,13 @@
<% const mc = theme.mei_comments || {}; %>
<% if (mc.server) { %>
<!-- Mei Comments: widget assets are served by the Go comment service -->
<div id="mei-comments" class="mei-comments"
data-server="<%= mc.server %>"
data-path="<%= url_for(page.path) %>"
data-title="<%= page.title %>"></div>
<link rel="stylesheet" href="<%= mc.server %>/embed.css">
<script defer src="<%= mc.server %>/embed.js"></script>
<noscript>请启用 JavaScript 以查看评论。</noscript>
<% } else { %>
<p class="note note-warning">评论服务尚未配置,请在主题配置中设置 <code>mei_comments.server</code>。</p>
<% } %>