Add Rehype Plugin to lazy images

This commit is contained in:
prototypa
2024-04-02 14:05:16 -04:00
parent 27436c10ca
commit 05412477c7
4 changed files with 164 additions and 694 deletions

View File

@@ -1,5 +1,6 @@
import getReadingTime from 'reading-time';
import { toString } from 'mdast-util-to-string';
import lazyLoadPlugin from 'rehype-plugin-image-native-lazy-loading'
export function readingTimeRemarkPlugin() {
return function (tree, file) {
@@ -34,3 +35,5 @@ export function responsiveTablesRehypePlugin() {
}
};
}
export const lazyImagesRehypePlugin = lazyLoadPlugin