7.31
This commit is contained in:
1 parent
8587f80c2a
commit
08ff4ac853
198 files changed
+230
No files matched your search
@@ -118,3 +118,20 @@ async function fetchCommentsAndCreateBarrager(path, options) {
|
||||
}
|
||||
}
|
||||
|
||||
// 弹幕函数
|
||||
function loadBarrager() {
|
||||
// 获取当前页面的路径
|
||||
var currentPath = "{{ .RelPermalink }}";
|
||||
|
||||
// 只有当 URL 包含 "post" 时才执行弹幕加载逻辑
|
||||
if (currentPath.includes("post") || currentPath.includes("says")) {
|
||||
// 调用封装的函数
|
||||
fetchCommentsAndCreateBarrager(currentPath, {
|
||||
looper_time: 3000, // 每条弹幕的发送间隔,单位毫秒
|
||||
defaultAvatar: 'static/default-avatar.png', // 默认头像
|
||||
defaultInfo: 'No comment', // 默认评论内容
|
||||
defaultLink: '#', // 默认用户链接
|
||||
speed: 10, // 弹幕速度,单位秒
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user