Skip to content

Commit

Permalink
fix(twikoo): 所有页面都说同一个path的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Lete114 authored Apr 28, 2022
1 parent a43bf1c commit 14de40b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion layout/_plugins/comments/twikoo/script.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
let placeholder = pdata.commentPlaceholder || "<%= theme.comments.twikoo.placeholder %>" || "";
if (path.length == 0) {
let defaultPath = '<%= theme.comments.twikoo.path %>';
path = defaultPath || "decodeURI(window.location.pathname)"; //神奇的pathname 没错,twikoo这里就是字符串,不要乱动了
path = defaultPath || decodeURI(window.location.pathname);
}
twikoo.init(Object.assign(Object.assign(<%- JSON.stringify(theme.comments.twikoo) %>, {
el: '#twikoo_container',
Expand Down

1 comment on commit 14de40b

@imaegoo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好快!正想 PR 这个问题然后发现已经修了!

Please sign in to comment.