mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-13 23:16:47 +00:00
fix: missing webmention token and use encodeURIComponent to keep share content format
This commit is contained in:
@@ -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 || ''
|
||||
},
|
||||
|
||||
// <---- 评论插件
|
||||
|
||||
@@ -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 }) => {
|
||||
<a
|
||||
target="_blank"
|
||||
id='tweet-post-url'
|
||||
href={`https://twitter.com/intent/tweet?text=${encodeURI(tweet)}`}
|
||||
href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(tweet)}`}
|
||||
rel="noopener noreferrer"
|
||||
>tweet this post</a>{' '}
|
||||
or{' '}
|
||||
|
||||
Reference in New Issue
Block a user