Hugo主题配置记录
1.引入busuanzi插件进行字数、访问量统计
-
\layouts\partials\footer
footer文件中
增加以下代码
<!-- 卜算子统计信息 --> <section class="count_info"> <!-- 1运行时间 --> <div> { { T "footer.runtime1" }} <span id="ds" class="running-days"></span> { { T "footer.runtime2" }} <span id="hs" class="running-days"></span> { { T "footer.runtime3" }} <span id="ms" class="running-days"></span> { { T "footer.runtime4" }} </div> <!-- 2文章个数和字数 --> <div> { { $scratch := newScratch }} { { range (where .Site.Pages "Kind" "page") }} { { $scratch.Add "total" .WordCount }} { { end }} <!-- 转换为整数 --> { { $total := $scratch.Get "total" | int }} <!-- 转换为浮点数 --> { { $totalFloat := $total | float }} { { T "footer.count1" }} { { len (where .Site.Regular