fix(docs): center copy icons and wrap full-width tables

This commit is contained in:
maoyingjie
2026-10-21 13:16:57 +08:00
parent 630963c652
commit 56b1ef11d8
4 changed files with 56 additions and 26 deletions
+12 -1
View File
@@ -9,7 +9,18 @@ export default defineConfig({
appearance: true,
cleanUrls: true,
head: [["meta", { name: "theme-color", content: "#f5f5f5" }]],
markdown: { headers: { level: [2, 3] } },
markdown: {
codeCopyButtonTitle: "复制代码",
headers: { level: [2, 3] },
config(md) {
const fence = md.renderer.rules.fence!;
md.renderer.rules.fence = (...args) =>
fence(...args).replace(
/(<button\b[^>]*class="copy"[^>]*>)(<\/button>)/g,
'$1<DocsCopyIcon class="copy-icon" aria-hidden="true" :size="16" /><DocsCheckIcon class="copied-icon" aria-hidden="true" :size="16" />$2',
);
},
},
vite: {
plugins: [
tailwindcss(),