Skip to content

请问评论内容与页面的映射(mapping)关系与多页面共用同一个评论区改进? #301

Answered by imaegoo
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

试试给 twikoo 传个 path 参数,该参数获取 URL 路径的末尾作为 path,可以满足你的情况。

twikoo.init({
  envId: '...',
  // ...
  path: 'location.pathname.split("/").reverse().find(function(i){return i})'
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Answer selected by imaegoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant