Replace estimated reading time with wordcount

This commit is contained in:
Helen Chong 2024-09-05 23:49:01 +08:00
parent f3fe88ff58
commit c179700a08
4 changed files with 14 additions and 15 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -4,7 +4,7 @@ import pluginEleventyNavigation from "@11ty/eleventy-navigation";
import pluginSyntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
import pluginEmbedEverything from "eleventy-plugin-embed-everything";
import pluginMetagen from "eleventy-plugin-metagen";
import pluginEmojiReadTime from "@11tyrocks/eleventy-plugin-emoji-readtime";
import pluginWordcount from "eleventy-plugin-wordcount-extended";
import pluginTOC from "@uncenter/eleventy-plugin-toc";
// Custom Configurations
@ -21,7 +21,7 @@ export default function(eleventyConfig) {
eleventyConfig.addPlugin(pluginSyntaxHighlight, { preAttributes: { tabindex: 0 } });
eleventyConfig.addPlugin(pluginEmbedEverything, { add: ['soundcloud'] });
eleventyConfig.addPlugin(pluginMetagen);
eleventyConfig.addPlugin(pluginEmojiReadTime);
eleventyConfig.addPlugin(pluginWordcount);
eleventyConfig.addPlugin(pluginTOC, {
tags: ['h2', 'h3', 'h4', 'h5', 'h6'],
wrapper: function (toc) {

View File

@ -14,11 +14,11 @@
"@11ty/eleventy-navigation": "^0.3.5",
"@11ty/eleventy-plugin-rss": "^2.0.2",
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"@11tyrocks/eleventy-plugin-emoji-readtime": "^1.0.1",
"@uncenter/eleventy-plugin-toc": "^1.0.3",
"@zachleat/details-utils": "^2.0.2",
"eleventy-plugin-embed-everything": "^1.18.2",
"eleventy-plugin-metagen": "^1.8.3",
"eleventy-plugin-wordcount-extended": "^0.2.1",
"install": "^0.13.0",
"markdown-it-anchor": "^9.0.1",
"markdown-it-attribution": "^0.1.4",

View File

@ -18,18 +18,17 @@
{% if isArticle %}
<div class="article__info">
<p class="article__info--desc">{{ desc }}</p>
<p>Posted on {{ date | formatDate }} by {{ sitemeta.siteAuthor.name }}
{% if updated %}
• Last updated on {{ updated | formatDate }}</p>
{% endif %}
{% if categories %}
<p>Categories:
{% for cat in categories %}
<a href="/categories/{{ cat | slugify }}">{{ cat }}</a>{% if not loop.last %}, {% endif %}
{% endfor %}
</p>
{% endif %}
<p>{{ content | emojiReadTime }}</p>
<p>{{ content | wordcount }} words. Posted on {{ date | formatDate }} by {{ sitemeta.siteAuthor.name }}</p>
{% if updated %}
<p>Last updated on {{ updated | formatDate }}</p>
{% endif %}
{% if categories %}
<p>Categories:
{% for cat in categories %}
<a href="/categories/{{ cat | slugify }}">{{ cat }}</a>{% if not loop.last %}, {% endif %}
{% endfor %}
</p>
{% endif %}
</div>
{% else %}
{% if desc %}