diff options
| -rw-r--r-- | i18n/en.toml | 1 | ||||
| -rw-r--r-- | i18n/zh.toml | 1 | ||||
| -rw-r--r-- | layouts/_partials/components/wordcount.html | 1 | ||||
| -rw-r--r-- | layouts/fiction/page.html | 4 |
4 files changed, 6 insertions, 1 deletions
diff --git a/i18n/en.toml b/i18n/en.toml index 15acc17c..f15a8c27 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -15,6 +15,7 @@ postCountMonthly = "{{ . }} POSTS" postCountAnnual = "{{ . }} TOTAL POSTS" [postPage] +wordcount = "%d words" commentNotLoaded = "if comment is not loaded, please try refreshing" staticCommentsSectionHeader = "These are static comments that are stored in frontmatter of this page. They used to be in different comment platforms, but now they are integrated into the page's content." originallyPostedOn = "originally posted on {{ . }}" diff --git a/i18n/zh.toml b/i18n/zh.toml index 2179bd87..e9da65f2 100644 --- a/i18n/zh.toml +++ b/i18n/zh.toml @@ -22,6 +22,7 @@ postCountAnnual = "共计 {{ . }} 篇文章" pageCount = "共 {{ . }} 个页面" [postPage] +wordcount = "%d 字" commentNotLoaded = "如果评论未加载,请尝试刷新页面" staticCommentsSectionHeader = "这些是曾经发布在不同评论平台上的评论,现在它们已经作为静态内容集成到页面中。" originallyPostedOn = "原本发表于 {{ . }}" diff --git a/layouts/_partials/components/wordcount.html b/layouts/_partials/components/wordcount.html new file mode 100644 index 00000000..526acaa4 --- /dev/null +++ b/layouts/_partials/components/wordcount.html @@ -0,0 +1 @@ +<span>{{ printf (T "postPage.wordcount") .WordCount }}</span> diff --git a/layouts/fiction/page.html b/layouts/fiction/page.html index 067f205a..37e91c86 100644 --- a/layouts/fiction/page.html +++ b/layouts/fiction/page.html @@ -11,7 +11,9 @@ class="xerox text-4xl font-900" data-pagefind-meta="title" ><span class="p-name" style="view-transition-name: post-{{ .File.UniqueID }}">{{ .Title }}</span></h1> - <div class="text-secondary">{{ partial "components/date" . }}</div> + <div class="text-secondary"> + {{ partial "components/date" . }} · + {{ partial "components/wordcount" . }}</div> </header> {{ partial "content" . }} |
