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

@ -11,7 +11,8 @@ import remarkMath from 'remark-math'
import UnoCSS from 'unocss/astro'
import { themeConfig } from './src/config'
import { langMap } from './src/i18n/config'
import { remarkReadingTime } from './src/plugins/remark-reading-time'
import { rehypeImgToFigure } from './src/plugins/rehype-img-to-figure.mjs'
import { remarkReadingTime } from './src/plugins/remark-reading-time.mjs'
const url = themeConfig.site.url
const locale = themeConfig.global.locale
@ -24,9 +25,9 @@ const imageConfig = imageHostURL
image: {
domains: [imageHostURL],
remotePatterns: [{ protocol: 'https' }],
}
},
}
: {};
: {}
export default defineConfig({
site: url,
@ -66,6 +67,7 @@ export default defineConfig({
rehypePlugins: [
rehypeSlug,
rehypeKatex,
rehypeImgToFigure,
[
rehypeExternalLinks,
{