From 033fa8ccc68db2bbe3456de7a93848c14e611d68 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 23 May 2025 20:15:42 +0800 Subject: feat: add page counts to stats page --- assets/css/components/_card.scss | 21 ------------- layouts/_default/stats.html | 64 ++++++++++++++++++++++++++++++++++++++++ layouts/cards/section.html | 8 ----- 3 files changed, 64 insertions(+), 29 deletions(-) diff --git a/assets/css/components/_card.scss b/assets/css/components/_card.scss index aba59e1a..491604b6 100644 --- a/assets/css/components/_card.scss +++ b/assets/css/components/_card.scss @@ -89,27 +89,6 @@ } } -.cards-statistics { - margin: 1rem 0; - table { - width: 100%; - } - table tr > td:nth-child(2) { - text-align: right; - } - .number-pill { - text-align: center; - display: inline-block; - width: 1.75rem; - height: 1.75rem; - line-height: 1.75rem; - box-sizing: border-box; - border-radius: 50%; - background-color: var(--block-background-color); - font-size: 1rem; - } -} - #latest-cards { margin: 1rem 0; .latest-cards-container { 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; + }
@@ -53,6 +77,46 @@ {{ .Content }} +
+

站点统计

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
页面总数{{ len .Site.RegularPages }}总字数 + + {{- $words := 0 -}} + {{- range .Site.RegularPages -}} + {{- $words = add $words .WordCount -}} + {{- end -}} + {{ $words }} + +
标签总数{{ len .Site.Taxonomies.tags }}专栏数量{{ len .Site.Taxonomies.categories }}
卡片数量{{ len (where .Site.RegularPages "Section" "cards") }}小说数量{{ len (where .Site.RegularPages "Section" "fictions") }}
书评数量{{ len (where .Site.RegularPages "Section" "library") }}精选文章数量{{ len (where .Site.RegularPages ".Params.featured" true) }}
+
+

内部链接图谱

站内各个页面之间通过超链接建立起来的联系,你可以通过视觉化的双向链接逛逛我的博客。图谱可以缩放和拖拽,你也可以点击这里全屏浏览。

diff --git a/layouts/cards/section.html b/layouts/cards/section.html index 1e7254e3..7e24facc 100644 --- a/layouts/cards/section.html +++ b/layouts/cards/section.html @@ -1,14 +1,6 @@ {{ define "main" }}
{{ partial "header.html" . }} -
- - - - - -
卡片数量{{ len .Pages }}
-
{{- $cards := .Site.GetPage "section" "cards" }} {{- $paginator := .Paginate $cards.Pages 10 }} -- cgit v1.2.3