Files
blog/themes/Ying/layouts/_default/single.html
T
2024-07-31 16:20:41 +08:00

51 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="{{ . }}">{{ . }}</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">
<!-- 评论区内容 -->
{{ if or (eq .Type "about") (eq .Type "post") }}
{{ partial "waline.html" . }}
{{ end }}
<!-- 评论区内容结束 -->
</div>
{{/* 文章页面评论弹幕 */}}
<script>
for(let i =0;i<=100;i++){
loadBarrager();
}
function loadBarrager() {
// 获取当前页面的路径
var currentPath = "{{ .RelPermalink }}";
// 调用封装的函数
fetchCommentsAndCreateBarrager(currentPath, {
looper_time: 3000, // 每条弹幕的发送间隔,单位毫秒
defaultAvatar: 'static/default-avatar.png', // 默认头像
defaultInfo: 'No comment', // 默认评论内容
defaultLink: '#', // 默认用户链接
speed: 10, // 弹幕速度,单位秒
});
}
</script>
</div>
{{ end }}