mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-02 15:10:16 +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,
|
ENABLE: process.env.NEXT_PUBLIC_WEBMENTION_ENABLE || false,
|
||||||
AUTH: process.env.NEXT_PUBLIC_WEBMENTION_AUTH || '',
|
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 || ''
|
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 [mentions, setMentions] = useState([])
|
||||||
const fetchMentions = async (target) =>
|
const fetchMentions = async (target) =>
|
||||||
fetch(
|
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))
|
).then((response) => (response.json ? response.json() : response))
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function getMentions() {
|
async function getMentions() {
|
||||||
@@ -153,7 +153,7 @@ const WebMentionBlock = ({ frontMatter }) => {
|
|||||||
<a
|
<a
|
||||||
target="_blank"
|
target="_blank"
|
||||||
id='tweet-post-url'
|
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"
|
rel="noopener noreferrer"
|
||||||
>tweet this post</a>{' '}
|
>tweet this post</a>{' '}
|
||||||
or{' '}
|
or{' '}
|
||||||
|
|||||||
Reference in New Issue
Block a user