style: add image to figure plugin

- Improve styles for images, blockquotes, tables and more
- Fix unexpected line breaks
This commit is contained in:
radishzzz 2025-04-16 06:25:04 +01:00
parent 018f1c9b6c
commit 4ff44f9ac4
14 changed files with 126 additions and 59 deletions

View file

@ -0,0 +1,13 @@
import { toString } from 'mdast-util-to-string'
import getReadingTime from 'reading-time'
export function remarkReadingTime() {
return (tree, { data }) => {
const textOnPage = toString(tree)
const readingTime = getReadingTime(textOnPage)
data.astro.frontmatter.minutes = Math.max(
1,
Math.round(readingTime.minutes),
)
}
}