Added eleventy config to add public folder passthrough, updated pack.json to serve content instead of compile, added plugins/metadata to rendering engine
12 lines
334 B
JavaScript
12 lines
334 B
JavaScript
export default function (data) {
|
|
if (typeof data.content === 'string') {
|
|
const words = data.content.trim().split(/\s+/).length;
|
|
const minutes = Math.ceil(words / 200); // avg reading speed
|
|
data.wordCount = words;
|
|
data.readingTime = `${minutes} min read`;
|
|
data.readingTimeMinutes = minutes;
|
|
}
|
|
|
|
return data;
|
|
}
|