diff --git a/.eleventy.js b/.eleventy.js index 498422b..5b01a3d 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,5 +1,6 @@ const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight') const pluginRss = require('@11ty/eleventy-plugin-rss'); +const timeToRead = require('eleventy-plugin-time-to-read'); module.exports = function (eleventyConfig) { const parseDate = (str) => { @@ -12,8 +13,9 @@ module.exports = function (eleventyConfig) { const formatPart = (part, date) => new Intl.DateTimeFormat("en", part).format(date); - eleventyConfig.addPlugin(pluginRss) - eleventyConfig.addPlugin(syntaxHighlight) + eleventyConfig.addPlugin(pluginRss); + eleventyConfig.addPlugin(syntaxHighlight); + eleventyConfig.addPlugin(timeToRead); eleventyConfig.addPassthroughCopy({ "src/static": "/" }); diff --git a/package-lock.json b/package-lock.json index b7fd6f3..a730c53 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,8 @@ "dependencies": { "@11ty/eleventy": "^v2.0.0-beta.1", "@11ty/eleventy-plugin-rss": "^1.2.0", - "@11ty/eleventy-plugin-syntaxhighlight": "^4.0.0" + "@11ty/eleventy-plugin-syntaxhighlight": "^4.0.0", + "eleventy-plugin-time-to-read": "^1.3.0" } }, "node_modules/@11ty/dependency-tree": { @@ -705,6 +706,22 @@ "node": ">=0.10.0" } }, + "node_modules/eleventy-plugin-time-to-read": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eleventy-plugin-time-to-read/-/eleventy-plugin-time-to-read-1.3.0.tgz", + "integrity": "sha512-EefxYZJviQbClwoQ+pXW0YsVoi3gzXJ3prJoOLO1g3n5dM17KyZh81/yyq5Inrdc2pxBz3CXsyo21kk43gK/Gg==", + "engines": { + "node": ">=13.0.0" + }, + "peerDependencies": { + "@11ty/eleventy": "*" + }, + "peerDependenciesMeta": { + "@11ty/eleventy": { + "optional": true + } + } + }, "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -2795,6 +2812,12 @@ "jake": "^10.8.5" } }, + "eleventy-plugin-time-to-read": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eleventy-plugin-time-to-read/-/eleventy-plugin-time-to-read-1.3.0.tgz", + "integrity": "sha512-EefxYZJviQbClwoQ+pXW0YsVoi3gzXJ3prJoOLO1g3n5dM17KyZh81/yyq5Inrdc2pxBz3CXsyo21kk43gK/Gg==", + "requires": {} + }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", diff --git a/package.json b/package.json index 3dfce5d..f764bca 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "dependencies": { "@11ty/eleventy": "^v2.0.0-beta.1", "@11ty/eleventy-plugin-rss": "^1.2.0", - "@11ty/eleventy-plugin-syntaxhighlight": "^4.0.0" + "@11ty/eleventy-plugin-syntaxhighlight": "^4.0.0", + "eleventy-plugin-time-to-read": "^1.3.0" } } diff --git a/src/_includes/layouts/post.njk b/src/_includes/layouts/post.njk index 91bfffb..01c1f6c 100644 --- a/src/_includes/layouts/post.njk +++ b/src/_includes/layouts/post.njk @@ -13,7 +13,11 @@ subhead: blog {% if changed_date %} (updated ) {% endif %} + + {{ content | timeToRead }} to read + by {{ site.name }} + {% if tags %} in {% for tag in tags %} diff --git a/src/posts.njk b/src/posts.njk index 34a6de4..7941be5 100644 --- a/src/posts.njk +++ b/src/posts.njk @@ -11,8 +11,27 @@ permalink: /posts/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumbe {% block main %} diff --git a/src/static/style.css b/src/static/style.css index 7485b2a..d8af31a 100644 --- a/src/static/style.css +++ b/src/static/style.css @@ -41,6 +41,14 @@ footer, text-align: center; } +.list-entry { + list-style-type: none; +} + +.list-entry h2 { + margin-bottom: 0; +} + #content { max-width: 900px; margin-left: auto; @@ -53,6 +61,11 @@ footer, font-size: 0.75rem; } +.middot::after { + content: '\00B7'; + display: inline-block; +} + time, .author, .updated { diff --git a/src/tagged.njk b/src/tagged.njk index 5cba719..a39a7c4 100644 --- a/src/tagged.njk +++ b/src/tagged.njk @@ -20,9 +20,26 @@ date: git Last Modified {% endblock %}