summaryrefslogtreecommitdiff
path: root/layouts/shortcodes
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-04-03 14:11:51 +0800
committerEltrac <hi@guhub.cn>2025-04-03 14:11:51 +0800
commit2772544294afea137e92ed095e1e5e0901426fee (patch)
treef4336a9ced571b36f3d7dc1d7799ba39392450da /layouts/shortcodes
parent5b17aaa86f546e12ffdaee4e1417eca020b5b565 (diff)
feat: add sponsor page and link
Former-commit-id: bb505f8fc86e47e277907437fd3240a58670759c
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r--layouts/shortcodes/postcount.html1
-rw-r--r--layouts/shortcodes/wordcount.html5
2 files changed, 6 insertions, 0 deletions
diff --git a/layouts/shortcodes/postcount.html b/layouts/shortcodes/postcount.html
new file mode 100644
index 00000000..68da6893
--- /dev/null
+++ b/layouts/shortcodes/postcount.html
@@ -0,0 +1 @@
+{{ len (where .Site.RegularPages "Section" "posts") }}
diff --git a/layouts/shortcodes/wordcount.html b/layouts/shortcodes/wordcount.html
new file mode 100644
index 00000000..3b302b82
--- /dev/null
+++ b/layouts/shortcodes/wordcount.html
@@ -0,0 +1,5 @@
+{{ $total := 0 }}
+{{ range where .Site.RegularPages "Section" "posts" }}
+ {{ $total = add $total .WordCount }}
+{{ end }}
+{{ $total }}