diff --git a/blog.config.js b/blog.config.js index 16b043b2..6dd3701c 100644 --- a/blog.config.js +++ b/blog.config.js @@ -180,7 +180,8 @@ const BLOG = { COMMENT_WEBMENTION: { ENABLE: process.env.NEXT_PUBLIC_WEBMENTION_ENABLE || false, AUTH: process.env.NEXT_PUBLIC_WEBMENTION_AUTH || '', - HOSTNAME: process.env.NEXT_PUBLIC_WEBMENTION_HOSTNAME || '' + HOSTNAME: process.env.NEXT_PUBLIC_WEBMENTION_HOSTNAME || '', + TWITTER_USERNAME: process.env.NEXT_PUBLIC_TWITTER_USERNAME || '' }, // <---- 评论插件 diff --git a/components/WebMention.js b/components/WebMention.js index ceee4173..ef8b54d6 100644 --- a/components/WebMention.js +++ b/components/WebMention.js @@ -139,26 +139,30 @@ const WebmentionReplies = ({ target }) => { const WebMentionBlock = ({ frontMatter }) => { const router = useRouter() - const url = `https://${BLOG.COMMENT_WEBMENTION.HOSTNAME}/${router.asPath}` - const tweet = `${frontMatter.title} by @siygle ${url}` + const url = `https://${BLOG.COMMENT_WEBMENTION.HOSTNAME}${router.asPath}` + const tweet = `${frontMatter.title} by @${BLOG.COMMENT_WEBMENTION.TWITTER_USERNAME} ${url}` + console.log('ini', url, tweet, router.asPath) return (

- powered by WebMention + powered by WebMention.io

- This post is using{' '} - - WebMention.io - {' '} - as the comment system.{' '} + You can{' '} Tweet this post + >tweet this post{' '} + or{' '} + discuss it on Twitter , the comments will show up here.
diff --git a/styles/globals.css b/styles/globals.css index 41a35f37..e17e9452 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -238,6 +238,11 @@ nav { margin-bottom: .5rem; } +.webmention-block-intro a { + color: #0000EE; + text-decoration: underline; +} + .webmention { margin-top: 1rem; padding-top: 1rem;