From 2b47af46de03d9b55fcbc5732317812704dcb6d6 Mon Sep 17 00:00:00 2001 From: polv Date: Sun, 1 Feb 2026 19:37:08 +0700 Subject: [PATCH] add video and fix filename for md --- docs/.vitepress/config.mts | 20 + docs/.vitepress/theme/components/Video.vue | 2 +- docs/index.md | 1 + ...る!?中国語_様態補語と程度補語の文法の注意点とは.md | 1473 +++++++++++++++++ server.js | 2 +- 5 files changed, 1496 insertions(+), 2 deletions(-) create mode 100644 docs/みんなうっかり間違える!?中国語_様態補語と程度補語の文法の注意点とは.md 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)