Skip to content

Commit

Permalink
fix: content may also be passed
Browse files Browse the repository at this point in the history
  • Loading branch information
MyXoToD committed May 13, 2024
1 parent 4d48458 commit a15cea4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A lightweight [eleventy](https://11ty.dev) plugin to display page/post reading time in minutes. No dependencies.

![NPM Version](https://img.shields.io/npm/v/@myxotod/eleventy-plugin-readingtime.svg) ![NPM Downloads](https://img.shields.io/npm/d18m/%40myxotod%2Feleventy-plugin-readingtime) ![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/min/%40myxotod/eleventy-plugin-readingtime/1.0.2)
![NPM Version](https://img.shields.io/npm/v/@myxotod/eleventy-plugin-readingtime.svg) ![NPM Downloads](https://img.shields.io/npm/d18m/%40myxotod%2Feleventy-plugin-readingtime) ![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/min/%40myxotod/eleventy-plugin-readingtime/1.1.2)


## Usage
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@myxotod/eleventy-plugin-readingtime",
"version": "1.0.2",
"version": "1.1.2",
"description": "A lightweight plugin to calculate the average reading time of your 11ty pages / posts",
"main": "readingtime.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion readingtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = (eleventyConfig, options) => {
let totalPosts = 0;

eleventyConfig.addFilter('readingtime', (post) => {
let html = post.content || post.templateContent || "";
let html = post.content || post.templateContent || post;
let readingtime = 0;

if (typeof html === 'string' && html != '') {
Expand Down

0 comments on commit a15cea4

Please sign in to comment.