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
commitbb505f8fc86e47e277907437fd3240a58670759c (patch)
tree1472d3c85fb8ee82832430278d3b8d9676a5f8ea /layouts/shortcodes
parentc896f61fb6cc69b2cc65be3a5f5e28ddd2b90945 (diff)
feat: add sponsor page and link
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 }}