summaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/stats.html64
1 files changed, 64 insertions, 0 deletions
diff --git a/layouts/_default/stats.html b/layouts/_default/stats.html
index efa9821e..27c2af6f 100644
--- a/layouts/_default/stats.html
+++ b/layouts/_default/stats.html
@@ -43,6 +43,30 @@
bottom: 0;
z-index: -1;
}
+
+ .site-stats-table {
+ width: 100%;
+ max-width: 700px;
+ border-collapse: collapse;
+ margin-bottom: 1.5rem;
+ }
+ .site-stats-table td {
+ padding: 0.5rem;
+ text-align: left;
+ }
+ .site-stats-table td:nth-child(2n) {
+ text-align: right;
+ }
+ .number-pill {
+ text-align: center;
+ display: inline-block;
+ line-height: 1.75rem;
+ box-sizing: border-box;
+ border-radius: 5px;
+ padding: 0 0.5rem;
+ background-color: var(--block-background-color);
+ font-size: 1rem;
+ }
</style>
<article>
@@ -54,6 +78,46 @@
</div>
<section>
+ <h2>站点统计</h2>
+ <table class="site-stats-table">
+ <tbody>
+ <tr>
+ <td>页面总数</td>
+ <td><span class="number-pill">{{ len .Site.RegularPages }}</span></td>
+ <td>总字数</td>
+ <td>
+ <span class="number-pill">
+ {{- $words := 0 -}}
+ {{- range .Site.RegularPages -}}
+ {{- $words = add $words .WordCount -}}
+ {{- end -}}
+ {{ $words }}
+ </span>
+ </td>
+ </tr>
+ <tr>
+ <td>标签总数</td>
+ <td><span class="number-pill">{{ len .Site.Taxonomies.tags }}</span></td>
+ <td>专栏数量</td>
+ <td><span class="number-pill">{{ len .Site.Taxonomies.categories }}</span></td>
+ </tr>
+ <tr>
+ <td>卡片数量</td>
+ <td><span class="number-pill">{{ len (where .Site.RegularPages "Section" "cards") }}</span></td>
+ <td>小说数量</td>
+ <td><span class="number-pill">{{ len (where .Site.RegularPages "Section" "fictions") }}</span></td>
+ </tr>
+ <tr>
+ <td>书评数量</td>
+ <td><span class="number-pill">{{ len (where .Site.RegularPages "Section" "library") }}</span></td>
+ <td>精选文章数量</td>
+ <td><span class="number-pill">{{ len (where .Site.RegularPages ".Params.featured" true) }}</span></td>
+ </tr>
+ </tbody>
+ </table>
+ </section>
+
+ <section>
<h2>内部链接图谱</h2>
<p>站内各个页面之间通过超链接建立起来的联系,你可以通过视觉化的双向链接逛逛我的博客。图谱可以缩放和拖拽,你也可以<a href="/graph" style="text-decoration: underline;">点击这里</a>全屏浏览。</p>
<div class="outbox small">