diff --git a/blog.config.js b/blog.config.js index 6dd3701c..9ab2f139 100644 --- a/blog.config.js +++ b/blog.config.js @@ -181,7 +181,8 @@ const BLOG = { ENABLE: process.env.NEXT_PUBLIC_WEBMENTION_ENABLE || false, AUTH: process.env.NEXT_PUBLIC_WEBMENTION_AUTH || '', HOSTNAME: process.env.NEXT_PUBLIC_WEBMENTION_HOSTNAME || '', - TWITTER_USERNAME: process.env.NEXT_PUBLIC_TWITTER_USERNAME || '' + TWITTER_USERNAME: process.env.NEXT_PUBLIC_TWITTER_USERNAME || '', + TOKEN: process.env.NEXT_PUBLIC_WEBMENTION_TOKEN || '' }, // <---- 评论插件 diff --git a/components/WebMention.js b/components/WebMention.js index ef8b54d6..c993fe22 100644 --- a/components/WebMention.js +++ b/components/WebMention.js @@ -80,7 +80,7 @@ const WebmentionReplies = ({ target }) => { const [mentions, setMentions] = useState([]) const fetchMentions = async (target) => fetch( - `https://webmention.io/api/mentions.jf2?per-page=500&target=${target}` + `https://webmention.io/api/mentions.jf2?per-page=500&target=${target}&token=${BLOG.COMMENT_WEBMENTION.TOKEN}` ).then((response) => (response.json ? response.json() : response)) useEffect(() => { async function getMentions() { @@ -153,7 +153,7 @@ const WebMentionBlock = ({ frontMatter }) => { tweet this post{' '} or{' '}