Really nice work with the latest updates and the new docs site! :)
I noticed the code blocks were rendering client side, and causing layout shifts as they completed after the main page load.
This could be improved with a simple change to use shiki in the SSR mode instead of rendering on the client side. This works well for the docs site since we know all content at build time, which means no dynamic client side rendering is needed and we can safely use SSR instead.
Here's an example implementation for how to use Shiki with SSR - feel free to copy the module into this project if you'd like:
https://github.com/Greenheart/greenheart.github.io/blob/8a45a6bba82dbe536ac56afc29563296678e5d09/src/lib/shiki-ssr.ts
And here is how the code blocks get preprocessed:
https://github.com/Greenheart/greenheart.github.io/blob/8a45a6bba82dbe536ac56afc29563296678e5d09/src/lib/markdoc.ts#L3
Let me know if you have any questions :)
Really nice work with the latest updates and the new docs site! :)
I noticed the code blocks were rendering client side, and causing layout shifts as they completed after the main page load.
This could be improved with a simple change to use
shikiin the SSR mode instead of rendering on the client side. This works well for the docs site since we know all content at build time, which means no dynamic client side rendering is needed and we can safely use SSR instead.Here's an example implementation for how to use Shiki with SSR - feel free to copy the module into this project if you'd like:
https://github.com/Greenheart/greenheart.github.io/blob/8a45a6bba82dbe536ac56afc29563296678e5d09/src/lib/shiki-ssr.ts
And here is how the code blocks get preprocessed:
https://github.com/Greenheart/greenheart.github.io/blob/8a45a6bba82dbe536ac56afc29563296678e5d09/src/lib/markdoc.ts#L3
Let me know if you have any questions :)