diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index bd969c28..fbc03261 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -26,6 +26,26 @@ export default defineConfig({ { icon: 'github', link: 'https://github.com/vuejs/vitepress' } ] }, + markdown: { + image: { + lazyLoading: true, + }, + config(md) { + md.renderer.rules.image = function (tokens, idx, options, env, slf) { + const token = tokens[idx]; + + // Get the alt if it exists + const alt = token.attrGet('alt') || token.content || ''; + + // Fill the title attribute with the alt if it exists + if (!token.attrGet('title')) { + token.attrSet('title', alt); + } + + return slf.renderToken(tokens, idx, options) + } + } + }, vite: { clearScreen: false, server: { diff --git a/docs/.vitepress/theme/components/Video.vue b/docs/.vitepress/theme/components/Video.vue index d42313c6..5e8e6ae5 100644 --- a/docs/.vitepress/theme/components/Video.vue +++ b/docs/.vitepress/theme/components/Video.vue @@ -40,7 +40,7 @@ setTimeout(() => setImgClick(), 500)