Files
blog/themes/Ying/layouts/_default/single.html
T
2024-07-13 11:42:38 +08:00

49 lines
1.8 KiB
HTML

{{ define "main" }}
<div id="pjax-container">
<article style="margin-bottom: 3.5em;">
<h1 class="post-title" itemprop="name headline">{{ .Title }}</h1>
<div class="meta">
作者: 小赵同学 浏览: {{ .Params.views }} 字数: {{ .WordCount }} 分类: {{ range .Params.categories }}<a
href="{{ .Permalink }}">{{ . }}</a>{{ end }}
</div>
<div class="post-content" itemprop="articleBody">
{{ .Content }}
</div>
<div class="post-tags" style="margin-top: -30px;">
<nav class="nav tags">
<ul class="flat">
</ul>
</nav>
</div>
</article>
<hr class="uk-divider-icon">
<div id="comments" class="comments-area">
<!-- 评论区内容 -->
<div id="waline"></div>
</div>
{{/* 文章页面评论弹幕 */}}
<script type="text/javascript">
$(document).ready(function () {
// 获取当前页面的路径
var currentPath = "{{ .RelPermalink }}";
console.log(currentPath)
// 调用封装的函数
fetchCommentsAndCreateBarrager(currentPath, {
looper_time: 3000, // 每条弹幕的发送间隔,单位毫秒
defaultAvatar: 'static/default-avatar.png', // 默认头像
defaultInfo: 'No comment', // 默认评论内容
defaultLink: '#', // 默认用户链接
close: true, // 显示关闭按钮
speed: 6, // 弹幕速度,单位秒
color: '#fff', // 弹幕颜色
old_ie_color: '#000000' // IE低版兼容色
});
});
</script>
</div>
{{ end }}