feat: add Journal page

This commit is contained in:
Stefan Imhoff
2023-05-31 19:34:46 +02:00
parent 3da1c5c0d2
commit 3a96fd808e
39 changed files with 640 additions and 15 deletions

View File

@@ -0,0 +1,13 @@
import { toString } from 'mdast-util-to-string';
import getReadingTime from 'reading-time';
import type { Node } from 'unist';
export const remarkReadingTime = () => {
return function (tree: Node, { data }: { data: any }) {
const textOnPage = toString(tree);
const readingTime = getReadingTime(textOnPage);
data.astro.frontmatter.minutesRead = readingTime.text;
};
};