From de497f4fe766e97123d08838399bb4a0fd780423 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 05:05:49 +0000 Subject: [PATCH] Deploy to GitHub pages --- 404.html | 34 +++ advanced/architecture.html | 34 +++ advanced/cookbook/adding-extra-pages.html | 60 ++++ advanced/cookbook/index.html | 34 +++ .../cookbook/making-a-theme-extendable.html | 68 +++++ advanced/cookbook/markdown-and-vue-sfc.html | 64 +++++ .../cookbook/passing-data-to-client-code.html | 59 ++++ advanced/cookbook/usage-of-client-config.html | 120 ++++++++ advanced/plugin.html | 63 +++++ advanced/theme.html | 91 ++++++ assets/404.html-6Yl8cQE3.js | 1 + assets/404.html-VtKSq7T3.js | 1 + assets/NpmBadge--lRFx50g.js | 1 + assets/active-header-links.html-Gm5kCTnU.js | 1 + assets/active-header-links.html-NWwmfOvm.js | 11 + assets/active-header-links.html-fvsIO2KT.js | 1 + assets/active-header-links.html-sIc4BSCl.js | 11 + assets/adding-extra-pages.html-1UmMYfeg.js | 27 ++ assets/adding-extra-pages.html-8nHB5UGr.js | 1 + assets/adding-extra-pages.html-gbWcNXLf.js | 1 + assets/adding-extra-pages.html-wSdXw6mw.js | 27 ++ assets/app-eU2v8o1B.js | 16 ++ assets/architecture.html-50nO3U30.js | 1 + assets/architecture.html-Ef-WWi97.js | 1 + assets/architecture.html-UaR5cFj_.js | 1 + assets/architecture.html-jLHymeGV.js | 1 + assets/assets.html-1j54Fvx1.js | 1 + assets/assets.html-4ukTXhdM.js | 1 + assets/assets.html-_UpsFxx-.js | 34 +++ assets/assets.html-jGDJJiJc.js | 34 +++ assets/back-to-top.html-3mn9vy9t.js | 1 + assets/back-to-top.html-ETMm9zTr.js | 13 + assets/back-to-top.html-SBrZWHGE.js | 1 + assets/back-to-top.html-U82tNcMw.js | 13 + assets/bundler.html-1Lcboibq.js | 21 ++ assets/bundler.html-3HPSreHe.js | 21 ++ assets/bundler.html-S4_5muti.js | 1 + assets/bundler.html-vrL6KUGX.js | 1 + assets/cli.html-LDAEB0aD.js | 1 + assets/cli.html-UOo9rMKI.js | 46 ++++ assets/cli.html-oJwwPLzh.js | 46 ++++ assets/cli.html-t2GuSTvN.js | 1 + assets/client-api.html-5X1GY6z7.js | 1 + assets/client-api.html-Hz3O_EAk.js | 1 + assets/client-api.html-jr_tX_nU.js | 14 + assets/client-api.html-uhd2B6Du.js | 14 + assets/components.html-3ku0oebd.js | 1 + assets/components.html-4IDj5RAr.js | 1 + assets/components.html-8e6s9jyW.js | 5 + assets/components.html-9ZVeijmS.js | 1 + assets/components.html-WqkyAXws.js | 32 +++ assets/components.html-_1ap8ZIq.js | 1 + assets/components.html-j4FRcZu1.js | 5 + assets/components.html-zMFdbMQ-.js | 32 +++ assets/config.html-3uFubqIm.js | 1 + assets/config.html-QsTvJZys.js | 173 ++++++++++++ assets/config.html-WWjNuxab.js | 1 + assets/config.html-eJqi6Wv3.js | 1 + assets/config.html-i_ba8INl.js | 22 ++ assets/config.html-mzxviKbd.js | 22 ++ assets/config.html-pdR6VJD6.js | 1 + assets/config.html-y99KBdbl.js | 173 ++++++++++++ assets/configuration.html-pW3ShFLZ.js | 29 ++ assets/configuration.html-wcdlW0k5.js | 1 + assets/configuration.html-xF-jc2r3.js | 29 ++ assets/configuration.html-xbAxcozF.js | 1 + assets/container.html-PtxgkxjI.js | 1 + assets/container.html-TjPytR4y.js | 39 +++ assets/container.html-kqFoOXKr.js | 1 + assets/container.html-wrzIDX-O.js | 39 +++ assets/deployment.html-LSGkd9Y2.js | 1 + assets/deployment.html-U91hxMp2.js | 101 +++++++ assets/deployment.html-XbzhTyhT.js | 1 + assets/deployment.html-rDu3xTc7.js | 104 +++++++ assets/docsearch-w40geAFS.js | 1 + assets/docsearch.html-4mSLVIiN.js | 205 ++++++++++++++ assets/docsearch.html-geU7FZc2.js | 1 + assets/docsearch.html-qC621Z1-.js | 203 ++++++++++++++ assets/docsearch.html-yW8YJyTj.js | 1 + assets/extending-a-theme-01-xmIu-MPG.js | 1 + assets/extending.html-DQbmt8Sf.js | 1 + assets/extending.html-oNTFNs2u.js | 1 + assets/extending.html-w7Kv_9tW.js | 64 +++++ assets/extending.html-wJrHlIH8.js | 65 +++++ assets/external-link-icon.html-DFH8UsDb.js | 28 ++ assets/external-link-icon.html-Jypp8WEn.js | 1 + assets/external-link-icon.html-hXXWH4Bv.js | 28 ++ assets/external-link-icon.html-xe1iQbC8.js | 1 + assets/frontmatter.html-0HrMHRj6.js | 30 ++ assets/frontmatter.html-3hYnultF.js | 1 + assets/frontmatter.html-9z0BtxYw.js | 1 + assets/frontmatter.html-IJ5-jzXZ.js | 1 + assets/frontmatter.html-T5c6-cfU.js | 60 ++++ assets/frontmatter.html-UUIM54bd.js | 30 ++ assets/frontmatter.html-pBtKj0Vl.js | 60 ++++ assets/frontmatter.html-sp6j5XB_.js | 1 + assets/getting-started.html-JooUvMS6.js | 1 + assets/getting-started.html-Ya8-UCpt.js | 1 + assets/getting-started.html-otXrftcQ.js | 26 ++ assets/getting-started.html-sCB2RJZF.js | 26 ++ assets/git.html-MIFkPpVx.js | 30 ++ assets/git.html-Ztg3geGz.js | 1 + assets/git.html-gg0deoQP.js | 30 ++ assets/git.html-jPKcGQNF.js | 1 + assets/google-analytics.html-M2qIk_Fo.js | 26 ++ assets/google-analytics.html-WyEii0XV.js | 1 + assets/google-analytics.html-ncL2DNzR.js | 1 + assets/google-analytics.html-p-WIn3G5.js | 26 ++ assets/hero-RIx3NWRP.js | 1 + assets/i18n.html-326CaaCk.js | 41 +++ assets/i18n.html-5KgXR2re.js | 1 + assets/i18n.html-s1H71rsL.js | 1 + assets/i18n.html-y-3sWUaJ.js | 41 +++ assets/index-QOy62Fup.js | 17 ++ assets/index.html-4Jlev2wy.js | 1 + assets/index.html-Ahzl3jpH.js | 1 + assets/index.html-EaoSe4Mj.js | 1 + assets/index.html-LIeZHVSg.js | 1 + assets/index.html-OVZ3rK4C.js | 1 + assets/index.html-__AKVf_E.js | 1 + assets/index.html-hVy-ihXY.js | 1 + assets/index.html-jGrnmanP.js | 1 + assets/index.html-jH3Iv2-7.js | 1 + assets/index.html-owSzs6LV.js | 1 + assets/index.html-rTEwPOLI.js | 1 + assets/index.html-sFLocUcL.js | 1 + ...making-a-theme-extendable.html-hlHjGq6k.js | 35 +++ ...making-a-theme-extendable.html-meYav6NP.js | 1 + ...making-a-theme-extendable.html-rrr09wUd.js | 1 + ...making-a-theme-extendable.html-wDYHhuw8.js | 35 +++ assets/markdown-and-vue-sfc.html-4gGUwagr.js | 31 +++ assets/markdown-and-vue-sfc.html-7cfmbOwj.js | 31 +++ assets/markdown-and-vue-sfc.html-8CMAPm9t.js | 1 + assets/markdown-and-vue-sfc.html-UyAjVe0G.js | 1 + assets/markdown.html-E9TdBNq2.js | 1 + assets/markdown.html-O0xMZyR_.js | 130 +++++++++ assets/markdown.html-Pg4gltF4.js | 50 ++++ assets/markdown.html-RaKgDcuz.js | 129 +++++++++ assets/markdown.html-XKozsizF.js | 1 + assets/markdown.html-f0CKPNMw.js | 50 ++++ assets/markdown.html-ii1dNmCW.js | 1 + assets/markdown.html-v53gNZxx.js | 1 + assets/medium-zoom.html-EoVYZum_.js | 31 +++ assets/medium-zoom.html-dLpz25ZR.js | 1 + assets/medium-zoom.html-lG08Ag1t.js | 1 + assets/medium-zoom.html-qakUfSNj.js | 31 +++ assets/migration.html-j6eU3LYG.js | 97 +++++++ assets/migration.html-jhc4o0sF.js | 1 + assets/migration.html-vHHGQ42_.js | 97 +++++++ assets/migration.html-yL51i5Wa.js | 1 + assets/node-api.html-RzTrTTfo.js | 104 +++++++ assets/node-api.html-ZpV2lRra.js | 104 +++++++ assets/node-api.html-lHGIfrDJ.js | 1 + assets/node-api.html-tuX36iXe.js | 1 + assets/nprogress.html-NpXpKxIh.js | 11 + assets/nprogress.html-RNgL0QGZ.js | 1 + assets/nprogress.html-X5umHJyu.js | 1 + assets/nprogress.html-gqI71Nvz.js | 11 + assets/page.html-3BGhEu12.js | 1 + assets/page.html-_zftyobR.js | 1 + assets/page.html-jiu4BY9r.js | 12 + assets/page.html-qK-n-fJU.js | 12 + assets/palette.html-Vi2lcYGC.js | 39 +++ assets/palette.html-b242Udjo.js | 39 +++ assets/palette.html-mci2X1xJ.js | 1 + assets/palette.html-svIiBuAj.js | 1 + ...ssing-data-to-client-code.html-66UgnX14.js | 1 + ...ssing-data-to-client-code.html-7z7BFnaN.js | 26 ++ ...ssing-data-to-client-code.html-N0mtoojl.js | 1 + ...ssing-data-to-client-code.html-f-CVV22Z.js | 26 ++ assets/plugin-api.html-XOYlxJHp.js | 1 + assets/plugin-api.html-c9sfNuSA.js | 88 ++++++ assets/plugin-api.html-mxjJqHwg.js | 1 + assets/plugin-api.html-nvZZ9-9s.js | 88 ++++++ assets/plugin.html-1l5wit-Z.js | 30 ++ assets/plugin.html-69wz8wnr.js | 1 + assets/plugin.html-GL3IPvy_.js | 1 + assets/plugin.html-JBB6sUWc.js | 15 + assets/plugin.html-LFMVvu2B.js | 1 + assets/plugin.html-PD1th8Qg.js | 30 ++ assets/plugin.html-Z76xkPoN.js | 1 + assets/plugin.html-kN-P6k-m.js | 15 + assets/prismjs.html-0ulnQYWI.js | 1 + assets/prismjs.html-N5-uNoGW.js | 1 + assets/prismjs.html-gemLzpIR.js | 11 + assets/prismjs.html-hnhxNt6P.js | 11 + assets/pwa-popup.html--uhGb_lp.js | 1 + assets/pwa-popup.html-FEkQ6tW5.js | 42 +++ assets/pwa-popup.html-VMOi2wzE.js | 42 +++ assets/pwa-popup.html-dTyC3ZgU.js | 1 + assets/pwa.html-7ewNita9.js | 68 +++++ assets/pwa.html-SVcJrjev.js | 1 + assets/pwa.html-dJHRD2Jh.js | 68 +++++ assets/pwa.html-vvcbXjjF.js | 1 + assets/register-components.html-56buZAHG.js | 1 + assets/register-components.html-Edirl6TP.js | 49 ++++ assets/register-components.html-RP8lipwZ.js | 49 ++++ assets/register-components.html-X0BNrizM.js | 1 + assets/search.html-2D2lSrvH.js | 1 + assets/search.html-3IiPlknu.js | 77 ++++++ assets/search.html-fZuVMAaU.js | 77 ++++++ assets/search.html-uJRJ7ae7.js | 1 + assets/shiki.html-0DoPKGkm.js | 11 + assets/shiki.html-10ErS_oq.js | 1 + assets/shiki.html-ANgciB6g.js | 1 + assets/shiki.html-WJxb9HXD.js | 11 + assets/style-JdokpXsH.css | 1 + assets/style-w40geAFS.js | 1 + assets/styles.html-4XyMA79B.js | 225 +++++++++++++++ assets/styles.html-5VBO1PYN.js | 1 + assets/styles.html-dqTsW5CV.js | 1 + assets/styles.html-ppE-xWyH.js | 225 +++++++++++++++ assets/theme-api.html--P_ZE6Od.js | 10 + assets/theme-api.html-KX9s0kwh.js | 10 + assets/theme-api.html-NnDk2D-T.js | 1 + assets/theme-api.html-ZqagUKXR.js | 1 + assets/theme-data.html-7AgSCC4i.js | 1 + assets/theme-data.html-C8hdJMe3.js | 51 ++++ assets/theme-data.html-O0pSpAdt.js | 51 ++++ assets/theme-data.html-ODrPozv0.js | 1 + assets/theme.html-1lMGI_to.js | 14 + assets/theme.html-AYISgrKz.js | 1 + assets/theme.html-HAoqhZVd.js | 14 + assets/theme.html-PTEeVU-K.js | 58 ++++ assets/theme.html-PWswBlx_.js | 1 + assets/theme.html-bQwRzLau.js | 1 + assets/theme.html-pdgRQ6zJ.js | 58 ++++ assets/theme.html-wQhmGWE7.js | 1 + assets/toc.html-5nixziN1.js | 1 + assets/toc.html-UM_HyWdr.js | 1 + assets/toc.html-a3Qmvl1r.js | 74 +++++ assets/toc.html-k5VmjERh.js | 74 +++++ .../usage-of-client-config.html-2Br2VXom.js | 1 + .../usage-of-client-config.html-WviU2RhQ.js | 1 + .../usage-of-client-config.html-d0TxxEeJ.js | 87 ++++++ .../usage-of-client-config.html-sg8S__SR.js | 87 ++++++ assets/vite.html-ATywsxtj.js | 11 + assets/vite.html-GESTQK3l.js | 1 + assets/vite.html-MchlPc-W.js | 11 + assets/vite.html-UcIosjal.js | 1 + assets/vuepress-core-process-9C1P9KT4.js | 1 + assets/webpack.html--2xfMMIX.js | 11 + assets/webpack.html-0Bcnkx8B.js | 1 + assets/webpack.html-Ynkv9VBN.js | 1 + assets/webpack.html-jpspO8kF.js | 11 + browserconfig.xml | 9 + favicon.ico | Bin 0 -> 15086 bytes guide/assets.html | 70 +++++ guide/bundler.html | 54 ++++ guide/configuration.html | 62 +++++ guide/deployment.html | 134 +++++++++ guide/getting-started.html | 59 ++++ guide/i18n.html | 74 +++++ guide/index.html | 34 +++ guide/markdown.html | 163 +++++++++++ guide/migration.html | 130 +++++++++ guide/page.html | 45 +++ guide/plugin.html | 48 ++++ guide/theme.html | 47 ++++ images/cookbook/extending-a-theme-01.png | Bin 0 -> 13453 bytes .../guide/vuepress-architecture-overview.png | Bin 0 -> 50904 bytes images/guide/vuepress-core-process.png | Bin 0 -> 56796 bytes images/hero.png | Bin 0 -> 153793 bytes images/icons/android-chrome-192x192.png | Bin 0 -> 6839 bytes images/icons/android-chrome-384x384.png | Bin 0 -> 15528 bytes images/icons/apple-touch-icon.png | Bin 0 -> 5373 bytes images/icons/favicon-16x16.png | Bin 0 -> 806 bytes images/icons/favicon-32x32.png | Bin 0 -> 1295 bytes images/icons/mstile-150x150.png | Bin 0 -> 4676 bytes images/icons/safari-pinned-tab.svg | 23 ++ images/logo.png | Bin 0 -> 3451 bytes index.html | 34 +++ manifest.webmanifest | 21 ++ new.html | 3 + reference/bundler/vite.html | 44 +++ reference/bundler/webpack.html | 44 +++ reference/cli.html | 79 ++++++ reference/client-api.html | 47 ++++ reference/components.html | 38 +++ reference/config.html | 55 ++++ reference/default-theme/components.html | 65 +++++ reference/default-theme/config.html | 206 ++++++++++++++ reference/default-theme/extending.html | 98 +++++++ reference/default-theme/frontmatter.html | 93 +++++++ reference/default-theme/markdown.html | 83 ++++++ reference/default-theme/styles.html | 258 ++++++++++++++++++ reference/frontmatter.html | 63 +++++ reference/node-api.html | 137 ++++++++++ reference/plugin-api.html | 121 ++++++++ reference/plugin/active-header-links.html | 44 +++ reference/plugin/back-to-top.html | 46 ++++ reference/plugin/container.html | 72 +++++ reference/plugin/docsearch.html | 238 ++++++++++++++++ reference/plugin/external-link-icon.html | 61 +++++ reference/plugin/git.html | 63 +++++ reference/plugin/google-analytics.html | 59 ++++ reference/plugin/medium-zoom.html | 64 +++++ reference/plugin/nprogress.html | 44 +++ reference/plugin/palette.html | 72 +++++ reference/plugin/prismjs.html | 44 +++ reference/plugin/pwa-popup.html | 75 +++++ reference/plugin/pwa.html | 101 +++++++ reference/plugin/register-components.html | 82 ++++++ reference/plugin/search.html | 110 ++++++++ reference/plugin/shiki.html | 44 +++ reference/plugin/theme-data.html | 84 ++++++ reference/plugin/toc.html | 107 ++++++++ reference/theme-api.html | 43 +++ zh/advanced/architecture.html | 34 +++ zh/advanced/cookbook/adding-extra-pages.html | 60 ++++ zh/advanced/cookbook/index.html | 34 +++ .../cookbook/making-a-theme-extendable.html | 68 +++++ .../cookbook/markdown-and-vue-sfc.html | 64 +++++ .../cookbook/passing-data-to-client-code.html | 59 ++++ .../cookbook/usage-of-client-config.html | 120 ++++++++ zh/advanced/plugin.html | 63 +++++ zh/advanced/theme.html | 91 ++++++ zh/guide/assets.html | 70 +++++ zh/guide/bundler.html | 54 ++++ zh/guide/configuration.html | 62 +++++ zh/guide/deployment.html | 137 ++++++++++ zh/guide/getting-started.html | 59 ++++ zh/guide/i18n.html | 74 +++++ zh/guide/index.html | 34 +++ zh/guide/markdown.html | 164 +++++++++++ zh/guide/migration.html | 130 +++++++++ zh/guide/page.html | 45 +++ zh/guide/plugin.html | 48 ++++ zh/guide/theme.html | 47 ++++ zh/index.html | 34 +++ zh/reference/bundler/vite.html | 44 +++ zh/reference/bundler/webpack.html | 44 +++ zh/reference/cli.html | 79 ++++++ zh/reference/client-api.html | 47 ++++ zh/reference/components.html | 38 +++ zh/reference/config.html | 55 ++++ zh/reference/default-theme/components.html | 65 +++++ zh/reference/default-theme/config.html | 206 ++++++++++++++ zh/reference/default-theme/extending.html | 97 +++++++ zh/reference/default-theme/frontmatter.html | 93 +++++++ zh/reference/default-theme/markdown.html | 83 ++++++ zh/reference/default-theme/styles.html | 258 ++++++++++++++++++ zh/reference/frontmatter.html | 63 +++++ zh/reference/node-api.html | 137 ++++++++++ zh/reference/plugin-api.html | 121 ++++++++ zh/reference/plugin/active-header-links.html | 44 +++ zh/reference/plugin/back-to-top.html | 46 ++++ zh/reference/plugin/container.html | 72 +++++ zh/reference/plugin/docsearch.html | 236 ++++++++++++++++ zh/reference/plugin/external-link-icon.html | 61 +++++ zh/reference/plugin/git.html | 63 +++++ zh/reference/plugin/google-analytics.html | 59 ++++ zh/reference/plugin/medium-zoom.html | 64 +++++ zh/reference/plugin/nprogress.html | 44 +++ zh/reference/plugin/palette.html | 72 +++++ zh/reference/plugin/prismjs.html | 44 +++ zh/reference/plugin/pwa-popup.html | 75 +++++ zh/reference/plugin/pwa.html | 101 +++++++ zh/reference/plugin/register-components.html | 82 ++++++ zh/reference/plugin/search.html | 110 ++++++++ zh/reference/plugin/shiki.html | 44 +++ zh/reference/plugin/theme-data.html | 84 ++++++ zh/reference/plugin/toc.html | 107 ++++++++ zh/reference/theme-api.html | 43 +++ 364 files changed, 14266 insertions(+) create mode 100644 404.html create mode 100644 advanced/architecture.html create mode 100644 advanced/cookbook/adding-extra-pages.html create mode 100644 advanced/cookbook/index.html create mode 100644 advanced/cookbook/making-a-theme-extendable.html create mode 100644 advanced/cookbook/markdown-and-vue-sfc.html create mode 100644 advanced/cookbook/passing-data-to-client-code.html create mode 100644 advanced/cookbook/usage-of-client-config.html create mode 100644 advanced/plugin.html create mode 100644 advanced/theme.html create mode 100644 assets/404.html-6Yl8cQE3.js create mode 100644 assets/404.html-VtKSq7T3.js create mode 100644 assets/NpmBadge--lRFx50g.js create mode 100644 assets/active-header-links.html-Gm5kCTnU.js create mode 100644 assets/active-header-links.html-NWwmfOvm.js create mode 100644 assets/active-header-links.html-fvsIO2KT.js create mode 100644 assets/active-header-links.html-sIc4BSCl.js create mode 100644 assets/adding-extra-pages.html-1UmMYfeg.js create mode 100644 assets/adding-extra-pages.html-8nHB5UGr.js create mode 100644 assets/adding-extra-pages.html-gbWcNXLf.js create mode 100644 assets/adding-extra-pages.html-wSdXw6mw.js create mode 100644 assets/app-eU2v8o1B.js create mode 100644 assets/architecture.html-50nO3U30.js create mode 100644 assets/architecture.html-Ef-WWi97.js create mode 100644 assets/architecture.html-UaR5cFj_.js create mode 100644 assets/architecture.html-jLHymeGV.js create mode 100644 assets/assets.html-1j54Fvx1.js create mode 100644 assets/assets.html-4ukTXhdM.js create mode 100644 assets/assets.html-_UpsFxx-.js create mode 100644 assets/assets.html-jGDJJiJc.js create mode 100644 assets/back-to-top.html-3mn9vy9t.js create mode 100644 assets/back-to-top.html-ETMm9zTr.js create mode 100644 assets/back-to-top.html-SBrZWHGE.js create mode 100644 assets/back-to-top.html-U82tNcMw.js create mode 100644 assets/bundler.html-1Lcboibq.js create mode 100644 assets/bundler.html-3HPSreHe.js create mode 100644 assets/bundler.html-S4_5muti.js create mode 100644 assets/bundler.html-vrL6KUGX.js create mode 100644 assets/cli.html-LDAEB0aD.js create mode 100644 assets/cli.html-UOo9rMKI.js create mode 100644 assets/cli.html-oJwwPLzh.js create mode 100644 assets/cli.html-t2GuSTvN.js create mode 100644 assets/client-api.html-5X1GY6z7.js create mode 100644 assets/client-api.html-Hz3O_EAk.js create mode 100644 assets/client-api.html-jr_tX_nU.js create mode 100644 assets/client-api.html-uhd2B6Du.js create mode 100644 assets/components.html-3ku0oebd.js create mode 100644 assets/components.html-4IDj5RAr.js create mode 100644 assets/components.html-8e6s9jyW.js create mode 100644 assets/components.html-9ZVeijmS.js create mode 100644 assets/components.html-WqkyAXws.js create mode 100644 assets/components.html-_1ap8ZIq.js create mode 100644 assets/components.html-j4FRcZu1.js create mode 100644 assets/components.html-zMFdbMQ-.js create mode 100644 assets/config.html-3uFubqIm.js create mode 100644 assets/config.html-QsTvJZys.js create mode 100644 assets/config.html-WWjNuxab.js create mode 100644 assets/config.html-eJqi6Wv3.js create mode 100644 assets/config.html-i_ba8INl.js create mode 100644 assets/config.html-mzxviKbd.js create mode 100644 assets/config.html-pdR6VJD6.js create mode 100644 assets/config.html-y99KBdbl.js create mode 100644 assets/configuration.html-pW3ShFLZ.js create mode 100644 assets/configuration.html-wcdlW0k5.js create mode 100644 assets/configuration.html-xF-jc2r3.js create mode 100644 assets/configuration.html-xbAxcozF.js create mode 100644 assets/container.html-PtxgkxjI.js create mode 100644 assets/container.html-TjPytR4y.js create mode 100644 assets/container.html-kqFoOXKr.js create mode 100644 assets/container.html-wrzIDX-O.js create mode 100644 assets/deployment.html-LSGkd9Y2.js create mode 100644 assets/deployment.html-U91hxMp2.js create mode 100644 assets/deployment.html-XbzhTyhT.js create mode 100644 assets/deployment.html-rDu3xTc7.js create mode 100644 assets/docsearch-w40geAFS.js create mode 100644 assets/docsearch.html-4mSLVIiN.js create mode 100644 assets/docsearch.html-geU7FZc2.js create mode 100644 assets/docsearch.html-qC621Z1-.js create mode 100644 assets/docsearch.html-yW8YJyTj.js create mode 100644 assets/extending-a-theme-01-xmIu-MPG.js create mode 100644 assets/extending.html-DQbmt8Sf.js create mode 100644 assets/extending.html-oNTFNs2u.js create mode 100644 assets/extending.html-w7Kv_9tW.js create mode 100644 assets/extending.html-wJrHlIH8.js create mode 100644 assets/external-link-icon.html-DFH8UsDb.js create mode 100644 assets/external-link-icon.html-Jypp8WEn.js create mode 100644 assets/external-link-icon.html-hXXWH4Bv.js create mode 100644 assets/external-link-icon.html-xe1iQbC8.js create mode 100644 assets/frontmatter.html-0HrMHRj6.js create mode 100644 assets/frontmatter.html-3hYnultF.js create mode 100644 assets/frontmatter.html-9z0BtxYw.js create mode 100644 assets/frontmatter.html-IJ5-jzXZ.js create mode 100644 assets/frontmatter.html-T5c6-cfU.js create mode 100644 assets/frontmatter.html-UUIM54bd.js create mode 100644 assets/frontmatter.html-pBtKj0Vl.js create mode 100644 assets/frontmatter.html-sp6j5XB_.js create mode 100644 assets/getting-started.html-JooUvMS6.js create mode 100644 assets/getting-started.html-Ya8-UCpt.js create mode 100644 assets/getting-started.html-otXrftcQ.js create mode 100644 assets/getting-started.html-sCB2RJZF.js create mode 100644 assets/git.html-MIFkPpVx.js create mode 100644 assets/git.html-Ztg3geGz.js create mode 100644 assets/git.html-gg0deoQP.js create mode 100644 assets/git.html-jPKcGQNF.js create mode 100644 assets/google-analytics.html-M2qIk_Fo.js create mode 100644 assets/google-analytics.html-WyEii0XV.js create mode 100644 assets/google-analytics.html-ncL2DNzR.js create mode 100644 assets/google-analytics.html-p-WIn3G5.js create mode 100644 assets/hero-RIx3NWRP.js create mode 100644 assets/i18n.html-326CaaCk.js create mode 100644 assets/i18n.html-5KgXR2re.js create mode 100644 assets/i18n.html-s1H71rsL.js create mode 100644 assets/i18n.html-y-3sWUaJ.js create mode 100644 assets/index-QOy62Fup.js create mode 100644 assets/index.html-4Jlev2wy.js create mode 100644 assets/index.html-Ahzl3jpH.js create mode 100644 assets/index.html-EaoSe4Mj.js create mode 100644 assets/index.html-LIeZHVSg.js create mode 100644 assets/index.html-OVZ3rK4C.js create mode 100644 assets/index.html-__AKVf_E.js create mode 100644 assets/index.html-hVy-ihXY.js create mode 100644 assets/index.html-jGrnmanP.js create mode 100644 assets/index.html-jH3Iv2-7.js create mode 100644 assets/index.html-owSzs6LV.js create mode 100644 assets/index.html-rTEwPOLI.js create mode 100644 assets/index.html-sFLocUcL.js create mode 100644 assets/making-a-theme-extendable.html-hlHjGq6k.js create mode 100644 assets/making-a-theme-extendable.html-meYav6NP.js create mode 100644 assets/making-a-theme-extendable.html-rrr09wUd.js create mode 100644 assets/making-a-theme-extendable.html-wDYHhuw8.js create mode 100644 assets/markdown-and-vue-sfc.html-4gGUwagr.js create mode 100644 assets/markdown-and-vue-sfc.html-7cfmbOwj.js create mode 100644 assets/markdown-and-vue-sfc.html-8CMAPm9t.js create mode 100644 assets/markdown-and-vue-sfc.html-UyAjVe0G.js create mode 100644 assets/markdown.html-E9TdBNq2.js create mode 100644 assets/markdown.html-O0xMZyR_.js create mode 100644 assets/markdown.html-Pg4gltF4.js create mode 100644 assets/markdown.html-RaKgDcuz.js create mode 100644 assets/markdown.html-XKozsizF.js create mode 100644 assets/markdown.html-f0CKPNMw.js create mode 100644 assets/markdown.html-ii1dNmCW.js create mode 100644 assets/markdown.html-v53gNZxx.js create mode 100644 assets/medium-zoom.html-EoVYZum_.js create mode 100644 assets/medium-zoom.html-dLpz25ZR.js create mode 100644 assets/medium-zoom.html-lG08Ag1t.js create mode 100644 assets/medium-zoom.html-qakUfSNj.js create mode 100644 assets/migration.html-j6eU3LYG.js create mode 100644 assets/migration.html-jhc4o0sF.js create mode 100644 assets/migration.html-vHHGQ42_.js create mode 100644 assets/migration.html-yL51i5Wa.js create mode 100644 assets/node-api.html-RzTrTTfo.js create mode 100644 assets/node-api.html-ZpV2lRra.js create mode 100644 assets/node-api.html-lHGIfrDJ.js create mode 100644 assets/node-api.html-tuX36iXe.js create mode 100644 assets/nprogress.html-NpXpKxIh.js create mode 100644 assets/nprogress.html-RNgL0QGZ.js create mode 100644 assets/nprogress.html-X5umHJyu.js create mode 100644 assets/nprogress.html-gqI71Nvz.js create mode 100644 assets/page.html-3BGhEu12.js create mode 100644 assets/page.html-_zftyobR.js create mode 100644 assets/page.html-jiu4BY9r.js create mode 100644 assets/page.html-qK-n-fJU.js create mode 100644 assets/palette.html-Vi2lcYGC.js create mode 100644 assets/palette.html-b242Udjo.js create mode 100644 assets/palette.html-mci2X1xJ.js create mode 100644 assets/palette.html-svIiBuAj.js create mode 100644 assets/passing-data-to-client-code.html-66UgnX14.js create mode 100644 assets/passing-data-to-client-code.html-7z7BFnaN.js create mode 100644 assets/passing-data-to-client-code.html-N0mtoojl.js create mode 100644 assets/passing-data-to-client-code.html-f-CVV22Z.js create mode 100644 assets/plugin-api.html-XOYlxJHp.js create mode 100644 assets/plugin-api.html-c9sfNuSA.js create mode 100644 assets/plugin-api.html-mxjJqHwg.js create mode 100644 assets/plugin-api.html-nvZZ9-9s.js create mode 100644 assets/plugin.html-1l5wit-Z.js create mode 100644 assets/plugin.html-69wz8wnr.js create mode 100644 assets/plugin.html-GL3IPvy_.js create mode 100644 assets/plugin.html-JBB6sUWc.js create mode 100644 assets/plugin.html-LFMVvu2B.js create mode 100644 assets/plugin.html-PD1th8Qg.js create mode 100644 assets/plugin.html-Z76xkPoN.js create mode 100644 assets/plugin.html-kN-P6k-m.js create mode 100644 assets/prismjs.html-0ulnQYWI.js create mode 100644 assets/prismjs.html-N5-uNoGW.js create mode 100644 assets/prismjs.html-gemLzpIR.js create mode 100644 assets/prismjs.html-hnhxNt6P.js create mode 100644 assets/pwa-popup.html--uhGb_lp.js create mode 100644 assets/pwa-popup.html-FEkQ6tW5.js create mode 100644 assets/pwa-popup.html-VMOi2wzE.js create mode 100644 assets/pwa-popup.html-dTyC3ZgU.js create mode 100644 assets/pwa.html-7ewNita9.js create mode 100644 assets/pwa.html-SVcJrjev.js create mode 100644 assets/pwa.html-dJHRD2Jh.js create mode 100644 assets/pwa.html-vvcbXjjF.js create mode 100644 assets/register-components.html-56buZAHG.js create mode 100644 assets/register-components.html-Edirl6TP.js create mode 100644 assets/register-components.html-RP8lipwZ.js create mode 100644 assets/register-components.html-X0BNrizM.js create mode 100644 assets/search.html-2D2lSrvH.js create mode 100644 assets/search.html-3IiPlknu.js create mode 100644 assets/search.html-fZuVMAaU.js create mode 100644 assets/search.html-uJRJ7ae7.js create mode 100644 assets/shiki.html-0DoPKGkm.js create mode 100644 assets/shiki.html-10ErS_oq.js create mode 100644 assets/shiki.html-ANgciB6g.js create mode 100644 assets/shiki.html-WJxb9HXD.js create mode 100644 assets/style-JdokpXsH.css create mode 100644 assets/style-w40geAFS.js create mode 100644 assets/styles.html-4XyMA79B.js create mode 100644 assets/styles.html-5VBO1PYN.js create mode 100644 assets/styles.html-dqTsW5CV.js create mode 100644 assets/styles.html-ppE-xWyH.js create mode 100644 assets/theme-api.html--P_ZE6Od.js create mode 100644 assets/theme-api.html-KX9s0kwh.js create mode 100644 assets/theme-api.html-NnDk2D-T.js create mode 100644 assets/theme-api.html-ZqagUKXR.js create mode 100644 assets/theme-data.html-7AgSCC4i.js create mode 100644 assets/theme-data.html-C8hdJMe3.js create mode 100644 assets/theme-data.html-O0pSpAdt.js create mode 100644 assets/theme-data.html-ODrPozv0.js create mode 100644 assets/theme.html-1lMGI_to.js create mode 100644 assets/theme.html-AYISgrKz.js create mode 100644 assets/theme.html-HAoqhZVd.js create mode 100644 assets/theme.html-PTEeVU-K.js create mode 100644 assets/theme.html-PWswBlx_.js create mode 100644 assets/theme.html-bQwRzLau.js create mode 100644 assets/theme.html-pdgRQ6zJ.js create mode 100644 assets/theme.html-wQhmGWE7.js create mode 100644 assets/toc.html-5nixziN1.js create mode 100644 assets/toc.html-UM_HyWdr.js create mode 100644 assets/toc.html-a3Qmvl1r.js create mode 100644 assets/toc.html-k5VmjERh.js create mode 100644 assets/usage-of-client-config.html-2Br2VXom.js create mode 100644 assets/usage-of-client-config.html-WviU2RhQ.js create mode 100644 assets/usage-of-client-config.html-d0TxxEeJ.js create mode 100644 assets/usage-of-client-config.html-sg8S__SR.js create mode 100644 assets/vite.html-ATywsxtj.js create mode 100644 assets/vite.html-GESTQK3l.js create mode 100644 assets/vite.html-MchlPc-W.js create mode 100644 assets/vite.html-UcIosjal.js create mode 100644 assets/vuepress-core-process-9C1P9KT4.js create mode 100644 assets/webpack.html--2xfMMIX.js create mode 100644 assets/webpack.html-0Bcnkx8B.js create mode 100644 assets/webpack.html-Ynkv9VBN.js create mode 100644 assets/webpack.html-jpspO8kF.js create mode 100644 browserconfig.xml create mode 100644 favicon.ico create mode 100644 guide/assets.html create mode 100644 guide/bundler.html create mode 100644 guide/configuration.html create mode 100644 guide/deployment.html create mode 100644 guide/getting-started.html create mode 100644 guide/i18n.html create mode 100644 guide/index.html create mode 100644 guide/markdown.html create mode 100644 guide/migration.html create mode 100644 guide/page.html create mode 100644 guide/plugin.html create mode 100644 guide/theme.html create mode 100644 images/cookbook/extending-a-theme-01.png create mode 100644 images/guide/vuepress-architecture-overview.png create mode 100644 images/guide/vuepress-core-process.png create mode 100644 images/hero.png create mode 100644 images/icons/android-chrome-192x192.png create mode 100644 images/icons/android-chrome-384x384.png create mode 100644 images/icons/apple-touch-icon.png create mode 100644 images/icons/favicon-16x16.png create mode 100644 images/icons/favicon-32x32.png create mode 100644 images/icons/mstile-150x150.png create mode 100644 images/icons/safari-pinned-tab.svg create mode 100644 images/logo.png create mode 100644 index.html create mode 100644 manifest.webmanifest create mode 100644 new.html create mode 100644 reference/bundler/vite.html create mode 100644 reference/bundler/webpack.html create mode 100644 reference/cli.html create mode 100644 reference/client-api.html create mode 100644 reference/components.html create mode 100644 reference/config.html create mode 100644 reference/default-theme/components.html create mode 100644 reference/default-theme/config.html create mode 100644 reference/default-theme/extending.html create mode 100644 reference/default-theme/frontmatter.html create mode 100644 reference/default-theme/markdown.html create mode 100644 reference/default-theme/styles.html create mode 100644 reference/frontmatter.html create mode 100644 reference/node-api.html create mode 100644 reference/plugin-api.html create mode 100644 reference/plugin/active-header-links.html create mode 100644 reference/plugin/back-to-top.html create mode 100644 reference/plugin/container.html create mode 100644 reference/plugin/docsearch.html create mode 100644 reference/plugin/external-link-icon.html create mode 100644 reference/plugin/git.html create mode 100644 reference/plugin/google-analytics.html create mode 100644 reference/plugin/medium-zoom.html create mode 100644 reference/plugin/nprogress.html create mode 100644 reference/plugin/palette.html create mode 100644 reference/plugin/prismjs.html create mode 100644 reference/plugin/pwa-popup.html create mode 100644 reference/plugin/pwa.html create mode 100644 reference/plugin/register-components.html create mode 100644 reference/plugin/search.html create mode 100644 reference/plugin/shiki.html create mode 100644 reference/plugin/theme-data.html create mode 100644 reference/plugin/toc.html create mode 100644 reference/theme-api.html create mode 100644 zh/advanced/architecture.html create mode 100644 zh/advanced/cookbook/adding-extra-pages.html create mode 100644 zh/advanced/cookbook/index.html create mode 100644 zh/advanced/cookbook/making-a-theme-extendable.html create mode 100644 zh/advanced/cookbook/markdown-and-vue-sfc.html create mode 100644 zh/advanced/cookbook/passing-data-to-client-code.html create mode 100644 zh/advanced/cookbook/usage-of-client-config.html create mode 100644 zh/advanced/plugin.html create mode 100644 zh/advanced/theme.html create mode 100644 zh/guide/assets.html create mode 100644 zh/guide/bundler.html create mode 100644 zh/guide/configuration.html create mode 100644 zh/guide/deployment.html create mode 100644 zh/guide/getting-started.html create mode 100644 zh/guide/i18n.html create mode 100644 zh/guide/index.html create mode 100644 zh/guide/markdown.html create mode 100644 zh/guide/migration.html create mode 100644 zh/guide/page.html create mode 100644 zh/guide/plugin.html create mode 100644 zh/guide/theme.html create mode 100644 zh/index.html create mode 100644 zh/reference/bundler/vite.html create mode 100644 zh/reference/bundler/webpack.html create mode 100644 zh/reference/cli.html create mode 100644 zh/reference/client-api.html create mode 100644 zh/reference/components.html create mode 100644 zh/reference/config.html create mode 100644 zh/reference/default-theme/components.html create mode 100644 zh/reference/default-theme/config.html create mode 100644 zh/reference/default-theme/extending.html create mode 100644 zh/reference/default-theme/frontmatter.html create mode 100644 zh/reference/default-theme/markdown.html create mode 100644 zh/reference/default-theme/styles.html create mode 100644 zh/reference/frontmatter.html create mode 100644 zh/reference/node-api.html create mode 100644 zh/reference/plugin-api.html create mode 100644 zh/reference/plugin/active-header-links.html create mode 100644 zh/reference/plugin/back-to-top.html create mode 100644 zh/reference/plugin/container.html create mode 100644 zh/reference/plugin/docsearch.html create mode 100644 zh/reference/plugin/external-link-icon.html create mode 100644 zh/reference/plugin/git.html create mode 100644 zh/reference/plugin/google-analytics.html create mode 100644 zh/reference/plugin/medium-zoom.html create mode 100644 zh/reference/plugin/nprogress.html create mode 100644 zh/reference/plugin/palette.html create mode 100644 zh/reference/plugin/prismjs.html create mode 100644 zh/reference/plugin/pwa-popup.html create mode 100644 zh/reference/plugin/pwa.html create mode 100644 zh/reference/plugin/register-components.html create mode 100644 zh/reference/plugin/search.html create mode 100644 zh/reference/plugin/shiki.html create mode 100644 zh/reference/plugin/theme-data.html create mode 100644 zh/reference/plugin/toc.html create mode 100644 zh/reference/theme-api.html diff --git a/404.html b/404.html new file mode 100644 index 000000000..44fd6665c --- /dev/null +++ b/404.html @@ -0,0 +1,34 @@ + + +
+ + + + + +The above figure shows a brief overview of the VuePress architecture:
As a developer, you must be aware of that VuePress has two main parts: Node App and Client App, which is important when developing plugins and themes:
The above figure shows the core process of VuePress Node App and the hooks of Plugin API:
Sometimes you might want to add some extra pages without creating a markdown file in the source directory.
With the help of Plugin API and Node API, we can do that with ease.
As a theme author, you may not require users to create a /README.md
file as the homepage, but you want to provide a default one:
import { createPage } from '@vuepress/core'
+
+export default {
+ // all pages have been loaded after initialization
+ async onInitialized(app) {
+ // if the homepage does not exist
+ if (app.pages.every((page) => page.path !== '/')) {
+ // create a homepage
+ const homepage = await createPage(app, {
+ path: '/',
+ // set frontmatter
+ frontmatter: {
+ layout: 'Layout',
+ },
+ // set markdown content
+ content: `\
+# Welcome to ${app.options.title}
+
+This is the default homepage
+`,
+ })
+ // add it to `app.pages`
+ app.pages.push(homepage)
+ }
+ },
+}
+
So here comes the Cookbook.
Each recipe will focus on one specific aspect, providing more detailed examples to show you the usages and possibilities of VuePress.
Sometimes users might want make some minor changes to a theme, but they don't want to fork and modify the entire project.
With the help of Theme API, you can make your theme extendable, allowing users to make their own modifications easily.
You must have known that how to extend default theme. Here we'll introduce how to make your own theme extendable like default theme.
This approach requires you to determine which parts of your theme could be extended. It is more suitable for those common customizations like page footer or header.
You just need to provide slots in your layouts, and tell users how to make use of them:
<template>
+ <div class="my-theme-layout">
+ <slot name="page-header" />
+ <Content />
+ <slot name="page-footer" />
+ </div>
+</template>
+
This approach requires you to consider which components of your theme should be replaceable, and you also need to split components into a suitable granularity.
First, set alias
for replaceable components of you theme:
import type { Theme } from '@vuepress/core'
+import { getDirname } from '@vuepress/utils'
+
+const __dirname = getDirname(import.meta.url)
+
+export const fooTheme = (options): Theme => {
+ return {
+ name: 'vuepress-theme-foo',
+ alias: {
+ // set alias for replaceable components
+ '@theme/Navbar.vue': path.resolve(__dirname, 'components/Navbar.vue'),
+ '@theme/Sidebar.vue': path.resolve(__dirname, 'components/Sidebar.vue'),
+ },
+ }
+}
+
Next, use those components via aliases in your theme:
<script setup lang="ts">
+import Navbar from '@theme/Navbar.vue'
+import Sidebar from '@theme/Sidebar.vue'
+</script>
+
+<template>
+ <div class="my-theme-layout">
+ <Navbar />
+ <Sidebar />
+ <Content />
+ </div>
+</template>
+
Then, users can replace specific components by overriding the alias
when extending or using your theme.
Each Markdown file is first compiled into HTML, and then converted to a Vue SFC. In other words, you can write a Markdown file like a Vue SFC:
<script>
and <style>
are treated as Vue SFC blocks as they are. In other words, they are hoisted from the <template>
block to the top-level of SFC.<script>
and <style>
will be compiled into HTML, and be treated as Vue SFC <template>
block.WARNING
As Vue SFC can contain only one <script>
element, you should avoid using more than one <script>
in VuePress markdown.
Here comes an example:
Input
_Hello, {{ msg }}_
+
+<RedDiv>
+
+_Current count is: {{ count }}_
+
+</RedDiv>
+
+<button @click="count++">Click Me!</button>
+
+<script setup>
+import { h, ref } from 'vue'
+
+const RedDiv = (_, ctx) =>
+ h(
+ 'div',
+ {
+ class: 'red-div',
+ },
+ ctx.slots.default(),
+ )
+const msg = 'Vue in Markdown'
+const count = ref(0)
+</script>
+
+<style>
+.red-div {
+ color: red;
+}
+</style>
+
Output
Hello, Vue in Markdown
Current count is: 0
As we know, VuePress plugin entries and theme entries are processed in Node side, but sometimes you might need to pass data to client side. For example, you want to generate different data when users use different options.
define
HookPlugin API provides a define hook to define global constants for client code. You can make use of it to pass data to client.
First, define some constants in define
hook:
export default (options) => ({
+ define: {
+ __FOO__: options.foo || 'str',
+ __OBJ__: {
+ bar: options.bar || 123,
+ },
+ },
+})
+
Then use them in client code directly:
const foo = __FOO__
+const obj = __OBJ__
+
If you are using TypeScript in client code, you may need to declare the types of the global constants manually:
declare const __FOO__: string
+declare const __OBJ__: { bar: number }
+
If you need to achieve some more complex features, you can write temp files and load them dynamically in client code.
First, write a temp file foo.js
, which will be generated in the temp directory:
export default (options) => ({
+ async onPrepared(app) {
+ // write temp file
+ await app.writeTemp(
+ 'foo.js',
+ `export const foo = ${JSON.stringify(options.foo)}`,
+ )
+ },
+})
+
Then, load the temp file via @temp
alias in client code:
import { foo } from '@temp/foo'
+
If you are using TypeScript in client code, you may need to declare the type of the temp module manually:
declare module '@temp/foo' {
+ export const foo: string
+}
+
You can make use of the client config file directly in your project, or specify the file path in your plugin or theme via clientConfigFile hook:
import { getDirname, path } from '@vuepress/utils'
+
+const __dirname = getDirname(import.meta.url)
+
+const pluginOrTheme = {
+ clientConfigFile: path.resolve(__dirname, './path/to/clientConfig.ts'),
+}
+
Inside the client config file, @vuepress/client
package provides a helper function defineClientConfig to help you define the client config:
import { defineClientConfig } from '@vuepress/client'
+
+export default defineClientConfig({
+ enhance({ app, router, siteData }) {},
+ setup() {},
+ layouts: {},
+ rootComponents: [],
+})
+
The enhance
function could be either synchronous or asynchronous. It accepts a context param with following properties:
app
is the Vue application instance that created by createApp.router
is the Vue Router instance that created by createRouter.siteData
is a ref of an object that generated from user config, including base, lang, title, description, head and locales.The enhance
function will be invoked after the client app is created. It's possible to implement any enhancements to the Vue application.
You can register global Vue components via the app.component method:
import { defineClientConfig } from '@vuepress/client'
+import MyComponent from './MyComponent.vue'
+
+export default defineClientConfig({
+ enhance({ app }) {
+ app.component('MyComponent', MyComponent)
+ },
+})
+
VuePress will generate a SSR application to pre-render pages during build. Generally speaking, if a code snippet is using Browser / DOM APIs before client app is mounted, we call it non-SSR-friendly.
We already provides a ClientOnly component to wrap non-SSR-friendly content.
In the enhance
function, you can make use of the __VUEPRESS_SSR__
flag for that purpose.
import { defineClientConfig } from '@vuepress/client'
+
+export default defineClientConfig({
+ async enhance() {
+ if (!__VUEPRESS_SSR__) {
+ const nonSsrFriendlyModule = await import('non-ssr-friendly-module')
+ // ...
+ }
+ },
+})
+
You can make use of the Router Methods that provided by vue-router. For example, add navigation guard:
import { defineClientConfig } from '@vuepress/client'
+
+export default defineClientConfig({
+ enhance({ router }) {
+ router.beforeEach((to) => {
+ console.log('before navigation')
+ })
+
+ router.afterEach((to) => {
+ console.log('after navigation')
+ })
+ },
+})
+
WARNING
It's not recommended to use addRoute
method to add dynamic routes here, because those routes will NOT be pre-rendered in build mode.
But you can still do that if you understand the drawback.
The setup
function would be invoked inside the setup hook of the client vue app.
You can take the setup
function as part of the setup hook of the root component. Thus, all composition APIs are available here.
import { defineClientConfig } from '@vuepress/client'
+import { provide, ref } from 'vue'
+import { useRoute, useRouter } from 'vue-router'
+
+export default defineClientConfig({
+ setup() {
+ // get the current route location
+ const route = useRoute()
+ // get the vue-router instance
+ const router = useRouter()
+ // provide a value that can be injected by layouts, pages and other components
+ const count = ref(0)
+ provide('count', count)
+ },
+})
+
In the setup
function, the __VUEPRESS_SSR__
flag is also available.
Another way to use non-ssr-friendly features is to put them inside the onMounted hook:
import { defineClientConfig } from '@vuepress/client'
+import { onMounted } from 'vue'
+
+export default defineClientConfig({
+ setup() {
+ onMounted(() => {
+ // use DOM API after mounted
+ document.querySelector('#app')
+ })
+ },
+})
+
The layouts
options is to set layout components. After layout components are registered here, users can use it via layout frontmatter.
import { defineClientConfig } from '@vuepress/client'
+import MyLayout from './layouts/MyLayout.vue'
+
+export default defineClientConfig({
+ layouts: {
+ MyLayout,
+ },
+})
+
The rootComponents
is a components array to be placed directly into the root node of the client vue app.
Typical usage of this option is to put some global UI components, like global popup or so:
import { defineClientConfig } from '@vuepress/client'
+import GlobalPopup from './components/GlobalPopup.vue'
+
+export default defineClientConfig({
+ rootComponents: [GlobalPopup],
+})
+
TIP
Before reading this guide, you'd better learn the VuePress architecture first.
A plugin should be a plain JavaScript object that satisfies the Plugin API, which is called a Plugin Object:
const fooPlugin = {
+ name: 'vuepress-plugin-foo',
+ // ...
+}
+
A plugin could also be a function that receives the app instance as the param and returns a Plugin Object, which is called a Plugin Function:
const barPlugin = (app) => {
+ return {
+ name: 'vuepress-plugin-bar',
+ // ...
+ }
+}
+
A plugin usually needs to allow user options, so we typically provide users with a function to receive options, and returns a Plugin Object or a Plugin Function. Then your plugin should be converted like this:
const fooPlugin = (options) => {
+ return {
+ name: 'vuepress-plugin-foo',
+ // ...
+ }
+}
+
+const barPlugin = (options) => {
+ return (app) => {
+ return {
+ name: 'vuepress-plugin-bar',
+ // ...
+ }
+ }
+}
+
After creating a plugin, you should follow some conventions in the package.json file before publishing it to NPM:
{
+ "name": "vuepress-plugin-foo",
+ "keywords": ["vuepress-plugin"]
+}
+
name
to follow the naming convention, i.e. vuepress-plugin-xxx
or @org/vuepress-plugin-xxx
, which should be consistent with the name field of the Plugin Object.keywords
to include vuepress-plugin
, so that users can search your plugin on NPM.TIP
Before reading this guide, you'd better learn the guide of Writing a Plugin first.
A VuePress theme is a special plugin, which should satisfy the Theme API. Like plugins, a theme should also be a Theme Object or a Theme Function, and could be wrapped with a function to receive options:
import { getDirname, path } from '@vuepress/utils'
+
+const __dirname = getDirname(import.meta.url)
+
+const fooTheme = (options) => {
+ // returns a theme object
+ return {
+ name: 'vuepress-theme-foo',
+
+ // path to the client config of your theme
+ clientConfigFile: path.resolve(__dirname, 'client.js'),
+
+ // set custom dev / build template
+ // if the template is not specified, the default template from `@vuepress/client` will be used
+ templateBuild: path.resolve(__dirname, 'templates/build.html'),
+ templateDev: path.resolve(__dirname, 'templates/dev.html'),
+
+ // use plugins
+ plugins: [
+ // ...
+ ],
+
+ // other plugin APIs are also available
+ }
+}
+
+const barTheme = (options) => {
+ // returns a theme function
+ return (app) => {
+ return {
+ name: 'vuepress-theme-bar',
+ // ...
+ }
+ }
+}
+
Then, create theme's client config file client.js
:
import { defineClientConfig } from '@vuepress/client'
+import Layout from './layouts/Layout.vue'
+import NotFound from './layouts/NotFound.vue'
+
+export default defineClientConfig({
+ layouts: {
+ Layout,
+ NotFound,
+ },
+})
+
The layouts
field declares the layouts provided by your theme. A theme must provide at least two layouts: Layout
and NotFound
. The former is to provide default layout for common pages, while the latter is to provide layout for 404-not-found page.
The Layout
layout should contain the Content component to display the markdown content:
<template>
+ <div>
+ <Content />
+ </div>
+</template>
+
The NotFound
layout will be used for the 404.html
page:
<template>
+ <div>404 Not Found</div>
+</template>
+
You can provide more layouts, and users can change layout via layout frontmatter.
Also, there are some conventions for theme in package.json:
{
+ "name": "vuepress-theme-foo",
+ "keywords": ["vuepress-theme"]
+}
+
name
to follow the naming convention: vuepress-theme-xxx
or @org/vuepress-theme-xxx
, which should be consistent with the name field of the Theme Object.keywords
to include vuepress-theme
, so that users can search your theme on NPM.该插件会监听页面滚动事件。当页面滚动至某个 标题锚点 后,如果存在对应的 标题链接 ,那么该插件会将路由 Hash 更改为该 标题锚点 。
该插件主要用于开发主题,并且已经集成到默认主题中。大部分情况下你不需要直接使用它。
npm i -D @vuepress/plugin-active-header-links@next
+
import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links'
+
+export default {
+ plugins: [
+ activeHeaderLinksPlugin({
+ // 配置项
+ }),
+ ],
+}
+
类型: string
默认值: 'a.sidebar-item'
详情:
标题链接 的选择器。
如果一个 标题锚点 没有对应的 标题链接 ,那么即使滚动到这个 标题锚点 ,该插件也不会更改路由 Hash 。
类型: number
默认值: 200
详情:
滚动事件监听器的 Debounce 延迟。
类型: number
默认值: 5
详情:
即便直接点击 标题锚点 的链接, scrollTop
也可能不会完全等于 标题锚点 的 offsetTop
,所以我们添加一个 Offset 偏移量来避免这个误差。
This plugin will listen to page scroll event. When the page scrolls to a certain header anchor, this plugin will change the route hash to that header anchor if there is a corresponding header link.
This plugin is mainly used to develop themes, and has been integrated into the default theme. You won't need to use it directly in most cases.
npm i -D @vuepress/plugin-active-header-links@next
+
import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links'
+
+export default {
+ plugins: [
+ activeHeaderLinksPlugin({
+ // options
+ }),
+ ],
+}
+
Type: string
Default: 'a.sidebar-item'
Details:
Selector of header link.
If a header anchor does not have a corresponding header link, this plugin won't change the route hash to that anchor when scrolling to it.
Type: number
Default: 200
Details:
The delay of the debounced scroll event listener.
Type: number
Default: 5
Details:
Even if you click the link of the header anchor directly, the scrollTop
might not be exactly equal to offsetTop
of the header anchor, so we add an offset to avoid the error.
As a theme author, you may not require users to create a /README.md
file as the homepage, but you want to provide a default one:
import { createPage } from '@vuepress/core'
+
+export default {
+ // all pages have been loaded after initialization
+ async onInitialized(app) {
+ // if the homepage does not exist
+ if (app.pages.every((page) => page.path !== '/')) {
+ // create a homepage
+ const homepage = await createPage(app, {
+ path: '/',
+ // set frontmatter
+ frontmatter: {
+ layout: 'Layout',
+ },
+ // set markdown content
+ content: \`\\
+# Welcome to \${app.options.title}
+
+This is the default homepage
+\`,
+ })
+ // add it to \`app.pages\`
+ app.pages.push(homepage)
+ }
+ },
+}
+
作为一个主题作者,你可能不想要求用户必须创建一个 /README.md
文件来作为主页,但是你希望提供一个默认的主页:
import { createPage } from '@vuepress/core'
+
+export default {
+ // 初始化之后,所有的页面已经加载完毕
+ async onInitialized(app) {
+ // 如果主页不存在
+ if (app.pages.every((page) => page.path !== '/')) {
+ // 创建一个主页
+ const homepage = await createPage(app, {
+ path: '/',
+ // 设置 frontmatter
+ frontmatter: {
+ layout: 'Layout',
+ },
+ // 设置 markdown 内容
+ content: \`\\
+# 欢迎来到 \${app.options.title}
+
+这是默认主页
+\`,
+ })
+ // 把它添加到 \`app.pages\`
+ app.pages.push(homepage)
+ }
+ },
+}
+
{const{slotScopeIds:z}=y;z&&($=$?$.concat(z):z);const C=s(b),q=v(i(b),y,C,B,J,$,g);return q&&rr(q)&&q.data==="]"?i(y.anchor=q):(At=!0,l(y.anchor=c("]"),C,q),q)},w=(b,y,B,J,$,g)=>{if(At=!0,y.el=null,g){const q=R(b);for(;;){const L=i(b);if(L&&L!==q)a(L);else break}}const z=i(b),C=s(b);return a(b),n(null,y,C,z,B,J,nr(C),$),z},R=(b,y="[",B="]")=>{let J=0;for(;b;)if(b=i(b),b&&rr(b)&&(b.data===y&&J++,b.data===B)){if(J===0)return i(b);J--}return b},I=(b,y,B)=>{const J=y.parentNode;J&&J.replaceChild(b,y);let $=B;for(;$;)$.vnode.el===y&&($.vnode.el=$.subTree.el=b),$=$.parent},k=b=>b.nodeType===1&&b.tagName.toLowerCase()==="template";return[u,d]}const Ke=Fs;function Ic(e){return kc(e,Oc)}function kc(e,t){const n=Xr();n.__VUE__=!0;const{insert:r,remove:o,patchProp:i,createElement:s,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:v=ut,insertStaticContent:E}=e,w=(f,p,_,T=null,O=null,x=null,F=!1,V=null,H=!!p.dynamicChildren)=>{if(f===p)return;f&&!Ft(f,p)&&(T=P(f),Ne(f,O,x,!0),f=null),p.patchFlag===-2&&(H=!1,p.dynamicChildren=null);const{type:D,ref:X,shapeFlag:G}=p;switch(D){case dn:R(f,p,_,T);break;case Qe:I(f,p,_,T);break;case On:f==null&&k(p,_,T,F);break;case ye:L(f,p,_,T,O,x,F,V,H);break;default:G&1?B(f,p,_,T,O,x,F,V,H):G&6?M(f,p,_,T,O,x,F,V,H):(G&64||G&128)&&D.process(f,p,_,T,O,x,F,V,H,N)}X!=null&&O&&br(X,f&&f.ref,x,p||f,!p)},R=(f,p,_,T)=>{if(f==null)r(p.el=a(p.children),_,T);else{const O=p.el=f.el;p.children!==f.children&&c(O,p.children)}},I=(f,p,_,T)=>{f==null?r(p.el=l(p.children||""),_,T):p.el=f.el},k=(f,p,_,T)=>{[f.el,f.anchor]=E(f.children,p,_,T,f.el,f.anchor)},b=({el:f,anchor:p},_,T)=>{let O;for(;f&&f!==p;)O=h(f),r(f,_,T),f=O;r(p,_,T)},y=({el:f,anchor:p})=>{let _;for(;f&&f!==p;)_=h(f),o(f),f=_;o(p)},B=(f,p,_,T,O,x,F,V,H)=>{F=F||p.type==="svg",f==null?J(p,_,T,O,x,F,V,H):z(f,p,O,x,F,V,H)},J=(f,p,_,T,O,x,F,V)=>{let H,D;const{type:X,props:G,shapeFlag:ee,transition:ie,dirs:ae}=f;if(H=f.el=s(f.type,x,G&&G.is,G),ee&8?u(H,f.children):ee&16&&g(f.children,H,null,T,O,x&&X!=="foreignObject",F,V),ae&&at(f,null,T,"created"),$(H,f,f.scopeId,F,T),G){for(const ge in G)ge!=="value"&&!Pn(ge)&&i(H,ge,null,G[ge],x,f.children,T,O,Se);"value"in G&&i(H,"value",null,G.value),(D=G.onVnodeBeforeMount)&&Xe(D,T,f)}ae&&at(f,null,T,"beforeMount");const be=rl(O,ie);be&&ie.beforeEnter(H),r(H,p,_),((D=G&&G.onVnodeMounted)||be||ae)&&Ke(()=>{D&&Xe(D,T,f),be&&ie.enter(H),ae&&at(f,null,T,"mounted")},O)},$=(f,p,_,T,O)=>{if(_&&v(f,_),T)for(let x=0;x{for(let D=H;D {const V=p.el=f.el;let{patchFlag:H,dynamicChildren:D,dirs:X}=p;H|=f.patchFlag&16;const G=f.props||Le,ee=p.props||Le;let ie;_&&Mt(_,!1),(ie=ee.onVnodeBeforeUpdate)&&Xe(ie,_,p,f),X&&at(p,f,_,"beforeUpdate"),_&&Mt(_,!0);const ae=O&&p.type!=="foreignObject";if(D?C(f.dynamicChildren,D,V,_,T,ae,x):F||K(f,p,V,null,_,T,ae,x,!1),H>0){if(H&16)q(V,p,G,ee,_,T,O);else if(H&2&&G.class!==ee.class&&i(V,"class",null,ee.class,O),H&4&&i(V,"style",G.style,ee.style,O),H&8){const be=p.dynamicProps;for(let ge=0;ge {ie&&Xe(ie,_,p,f),X&&at(p,f,_,"updated")},T)},C=(f,p,_,T,O,x,F)=>{for(let V=0;V {if(_!==T){if(_!==Le)for(const V in _)!Pn(V)&&!(V in T)&&i(f,V,_[V],null,F,p.children,O,x,Se);for(const V in T){if(Pn(V))continue;const H=T[V],D=_[V];H!==D&&V!=="value"&&i(f,V,D,H,F,p.children,O,x,Se)}"value"in T&&i(f,"value",_.value,T.value)}},L=(f,p,_,T,O,x,F,V,H)=>{const D=p.el=f?f.el:a(""),X=p.anchor=f?f.anchor:a("");let{patchFlag:G,dynamicChildren:ee,slotScopeIds:ie}=p;ie&&(V=V?V.concat(ie):ie),f==null?(r(D,_,T),r(X,_,T),g(p.children,_,X,O,x,F,V,H)):G>0&&G&64&&ee&&f.dynamicChildren?(C(f.dynamicChildren,ee,_,O,x,F,V),(p.key!=null||O&&p===O.subTree)&&ol(f,p,!0)):K(f,p,_,X,O,x,F,V,H)},M=(f,p,_,T,O,x,F,V,H)=>{p.slotScopeIds=V,f==null?p.shapeFlag&512?O.ctx.activate(p,_,T,F,H):re(p,_,T,O,x,F,H):le(f,p,H)},re=(f,p,_,T,O,x,F)=>{const V=f.component=Nc(f,T,O);if(Kn(f)&&(V.ctx.renderer=N),Hc(V),V.asyncDep){if(O&&O.registerDep(V,S),!f.el){const H=V.subTree=oe(Qe);I(null,H,p,_)}return}S(V,f,p,_,O,x,F)},le=(f,p,_)=>{const T=p.component=f.component;if(Ja(f,p,_))if(T.asyncDep&&!T.asyncResolved){Q(T,p,_);return}else T.next=p,Ua(T.update),T.update();else p.el=f.el,T.vnode=p},S=(f,p,_,T,O,x,F)=>{const V=()=>{if(f.isMounted){let{next:X,bu:G,u:ee,parent:ie,vnode:ae}=f,be=X,ge;Mt(f,!1),X?(X.el=ae.el,Q(f,X,F)):X=ae,G&&Nr(G),(ge=X.props&&X.props.onVnodeBeforeUpdate)&&Xe(ge,ie,X,ae),Mt(f,!0);const Re=Hr(f),tt=f.subTree;f.subTree=Re,w(tt,Re,d(tt.el),P(tt),f,O,x),X.el=Re.el,be===null&&Qa(f,Re.el),ee&&Ke(ee,O),(ge=X.props&&X.props.onVnodeUpdated)&&Ke(()=>Xe(ge,ie,X,ae),O)}else{let X;const{el:G,props:ee}=p,{bm:ie,m:ae,parent:be}=f,ge=cn(p);if(Mt(f,!1),ie&&Nr(ie),!ge&&(X=ee&&ee.onVnodeBeforeMount)&&Xe(X,be,p),Mt(f,!0),G&&ce){const Re=()=>{f.subTree=Hr(f),ce(G,f.subTree,f,O,null)};ge?p.type.__asyncLoader().then(()=>!f.isUnmounted&&Re()):Re()}else{const Re=f.subTree=Hr(f);w(null,Re,_,T,f,O,x),p.el=Re.el}if(ae&&Ke(ae,O),!ge&&(X=ee&&ee.onVnodeMounted)){const Re=p;Ke(()=>Xe(X,be,Re),O)}(p.shapeFlag&256||be&&cn(be.vnode)&&be.vnode.shapeFlag&256)&&f.a&&Ke(f.a,O),f.isMounted=!0,p=_=T=null}},H=f.effect=new To(V,()=>Ir(D),f.scope),D=f.update=()=>H.run();D.id=f.uid,Mt(f,!0),D()},Q=(f,p,_)=>{p.component=f;const T=f.vnode.props;f.vnode=p,f.next=null,wc(f,p.props,T,_),Rc(f,p.children,_),_n(),ci(),gn()},K=(f,p,_,T,O,x,F,V,H=!1)=>{const D=f&&f.children,X=f?f.shapeFlag:0,G=p.children,{patchFlag:ee,shapeFlag:ie}=p;if(ee>0){if(ee&128){Ve(D,G,_,T,O,x,F,V,H);return}else if(ee&256){De(D,G,_,T,O,x,F,V,H);return}}ie&8?(X&16&&Se(D,O,x),G!==D&&u(_,G)):X&16?ie&16?Ve(D,G,_,T,O,x,F,V,H):Se(D,O,x,!0):(X&8&&u(_,""),ie&16&&g(G,_,T,O,x,F,V,H))},De=(f,p,_,T,O,x,F,V,H)=>{f=f||on,p=p||on;const D=f.length,X=p.length,G=Math.min(D,X);let ee;for(ee=0;ee X?Se(f,O,x,!0,!1,G):g(p,_,T,O,x,F,V,H,G)},Ve=(f,p,_,T,O,x,F,V,H)=>{let D=0;const X=p.length;let G=f.length-1,ee=X-1;for(;D<=G&&D<=ee;){const ie=f[D],ae=p[D]=H?It(p[D]):nt(p[D]);if(Ft(ie,ae))w(ie,ae,_,null,O,x,F,V,H);else break;D++}for(;D<=G&&D<=ee;){const ie=f[G],ae=p[ee]=H?It(p[ee]):nt(p[ee]);if(Ft(ie,ae))w(ie,ae,_,null,O,x,F,V,H);else break;G--,ee--}if(D>G){if(D<=ee){const ie=ee+1,ae=ie ee)for(;D<=G;)Ne(f[D],O,x,!0),D++;else{const ie=D,ae=D,be=new Map;for(D=ae;D<=ee;D++){const Ye=p[D]=H?It(p[D]):nt(p[D]);Ye.key!=null&&be.set(Ye.key,D)}let ge,Re=0;const tt=ee-ae+1;let Xt=!1,Zo=0;const bn=new Array(tt);for(D=0;D=tt){Ne(Ye,O,x,!0);continue}let lt;if(Ye.key!=null)lt=be.get(Ye.key);else for(ge=ae;ge<=ee;ge++)if(bn[ge-ae]===0&&Ft(Ye,p[ge])){lt=ge;break}lt===void 0?Ne(Ye,O,x,!0):(bn[lt-ae]=D+1,lt>=Zo?Zo=lt:Xt=!0,w(Ye,p[lt],_,null,O,x,F,V,H),Re++)}const Xo=Xt?xc(bn):on;for(ge=Xo.length-1,D=tt-1;D>=0;D--){const Ye=ae+D,lt=p[Ye],ei=Ye+1 {const{el:x,type:F,transition:V,children:H,shapeFlag:D}=f;if(D&6){Ue(f.component.subTree,p,_,T);return}if(D&128){f.suspense.move(p,_,T);return}if(D&64){F.move(f,p,_,N);return}if(F===ye){r(x,p,_);for(let G=0;G V.enter(x),O);else{const{leave:G,delayLeave:ee,afterLeave:ie}=V,ae=()=>r(x,p,_),be=()=>{G(x,()=>{ae(),ie&&ie()})};ee?ee(x,ae,be):be()}else r(x,p,_)},Ne=(f,p,_,T=!1,O=!1)=>{const{type:x,props:F,ref:V,children:H,dynamicChildren:D,shapeFlag:X,patchFlag:G,dirs:ee}=f;if(V!=null&&br(V,null,_,f,!0),X&256){p.ctx.deactivate(f);return}const ie=X&1&&ee,ae=!cn(f);let be;if(ae&&(be=F&&F.onVnodeBeforeUnmount)&&Xe(be,p,f),X&6)st(f.component,_,T);else{if(X&128){f.suspense.unmount(_,T);return}ie&&at(f,null,p,"beforeUnmount"),X&64?f.type.remove(f,p,_,O,N,T):D&&(x!==ye||G>0&&G&64)?Se(D,p,_,!1,!0):(x===ye&&G&384||!O&&X&16)&&Se(H,p,_),T&&Tt(f)}(ae&&(be=F&&F.onVnodeUnmounted)||ie)&&Ke(()=>{be&&Xe(be,p,f),ie&&at(f,null,p,"unmounted")},_)},Tt=f=>{const{type:p,el:_,anchor:T,transition:O}=f;if(p===ye){Lt(_,T);return}if(p===On){y(f);return}const x=()=>{o(_),O&&!O.persisted&&O.afterLeave&&O.afterLeave()};if(f.shapeFlag&1&&O&&!O.persisted){const{leave:F,delayLeave:V}=O,H=()=>F(_,x);V?V(f.el,x,H):H()}else x()},Lt=(f,p)=>{let _;for(;f!==p;)_=h(f),o(f),f=_;o(p)},st=(f,p,_)=>{const{bum:T,scope:O,update:x,subTree:F,um:V}=f;T&&Nr(T),O.stop(),x&&(x.active=!1,Ne(F,f,p,_)),V&&Ke(V,p),Ke(()=>{f.isUnmounted=!0},p),p&&p.pendingBranch&&!p.isUnmounted&&f.asyncDep&&!f.asyncResolved&&f.suspenseId===p.pendingId&&(p.deps--,p.deps===0&&p.resolve())},Se=(f,p,_,T=!1,O=!1,x=0)=>{for(let F=x;F f.shapeFlag&6?P(f.component.subTree):f.shapeFlag&128?f.suspense.next():h(f.anchor||f.el),U=(f,p,_)=>{f==null?p._vnode&&Ne(p._vnode,null,null,!0):w(p._vnode||null,f,p,null,null,null,_),ci(),mr(),p._vnode=f},N={p:w,um:Ne,m:Ue,r:Tt,mt:re,mc:g,pc:K,pbc:C,n:P,o:e};let Y,ce;return t&&([Y,ce]=t(N)),{render:U,hydrate:Y,createApp:Tc(U,Y)}}function Mt({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function rl(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ol(e,t,n=!1){const r=e.children,o=t.children;if(Z(r)&&Z(o))for(let i=0;i >1,e[n[a]] 0&&(t[r]=n[i-1]),n[i]=r)}}for(i=n.length,s=n[i-1];i-- >0;)n[i]=s,s=t[s];return n}const Cc=e=>e.__isTeleport,ye=Symbol.for("v-fgt"),dn=Symbol.for("v-txt"),Qe=Symbol.for("v-cmt"),On=Symbol.for("v-stc"),In=[];let ot=null;function j(e=!1){In.push(ot=e?null:[])}function Dc(){In.pop(),ot=In[In.length-1]||null}let zn=1;function yi(e){zn+=e}function il(e){return e.dynamicChildren=zn>0?ot||on:null,Dc(),zn>0&&ot&&ot.push(e),e}function te(e,t,n,r,o,i){return il(he(e,t,n,r,o,i,!0))}function Oe(e,t,n,r,o){return il(oe(e,t,n,r,o,!0))}function Er(e){return e?e.__v_isVNode===!0:!1}function Ft(e,t){return e.type===t.type&&e.key===t.key}const Sr="__vInternal",sl=({key:e})=>e??null,cr=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?pe(e)||ze(e)||se(e)?{i:$e,r:e,k:t,f:!!n}:e:null);function he(e,t=null,n=null,r=0,o=null,i=e===ye?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&sl(t),ref:t&&cr(t),scopeId:Hs,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:$e};return a?(zo(l,n),i&128&&e.normalize(l)):n&&(l.shapeFlag|=pe(n)?8:16),zn>0&&!s&&ot&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&ot.push(l),l}const oe=Sc;function Sc(e,t=null,n=null,r=0,o=null,i=!1){if((!e||e===Za)&&(e=Qe),Er(e)){const a=zt(e,t,!0);return n&&zo(a,n),zn>0&&!i&&ot&&(a.shapeFlag&6?ot[ot.indexOf(e)]=a:ot.push(a)),a.patchFlag|=-2,a}if(Kc(e)&&(e=e.__vccOpts),t){t=zc(t);let{class:a,style:l}=t;a&&!pe(a)&&(t.class=We(a)),we(l)&&(Cs(l)&&!Z(l)&&(l=Ce({},l)),t.style=Hn(l))}const s=pe(e)?1:ec(e)?128:Cc(e)?64:we(e)?4:se(e)?2:0;return he(e,t,n,r,o,s,i,!0)}function zc(e){return e?Cs(e)||Sr in e?Ce({},e):e:null}function zt(e,t,n=!1){const{props:r,ref:o,patchFlag:i,children:s}=e,a=t?uo(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:a,key:a&&sl(a),ref:t&&t.ref?n&&o?Z(o)?o.concat(cr(t)):[o,cr(t)]:cr(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ye?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&zt(e.ssContent),ssFallback:e.ssFallback&&zt(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Vt(e=" ",t=0){return oe(dn,null,e,t)}function Vc(e,t){const n=oe(On,null,e);return n.staticCount=t,n}function Ie(e="",t=!1){return t?(j(),Oe(Qe,null,e)):oe(Qe,null,e)}function nt(e){return e==null||typeof e=="boolean"?oe(Qe):Z(e)?oe(ye,null,e.slice()):typeof e=="object"?It(e):oe(dn,null,String(e))}function It(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:zt(e)}function zo(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Z(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),zo(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!(Sr in t)?t._ctx=$e:o===3&&$e&&($e.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else se(t)?(t={default:t,_ctx:$e},n=32):(t=String(t),r&64?(n=16,t=[Vt(t)]):n=8);e.children=t,e.shapeFlag|=n}function uo(...e){const t={};for(let n=0;n ke||$e;let Mo,en,Ti="__VUE_INSTANCE_SETTERS__";(en=Xr()[Ti])||(en=Xr()[Ti]=[]),en.push(e=>ke=e),Mo=e=>{en.length>1?en.forEach(t=>t(e)):en[0](e)};const fn=e=>{Mo(e),e.scope.on()},qt=()=>{ke&&ke.scope.off(),Mo(null)};function ll(e){return e.vnode.shapeFlag&4}let hn=!1;function Hc(e,t=!1){hn=t;const{props:n,children:r}=e.vnode,o=ll(e);Lc(e,n,o,t),Pc(e,r);const i=o?Bc(e,t):void 0;return hn=!1,i}function Bc(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Ds(new Proxy(e.ctx,pc));const{setup:r}=n;if(r){const o=e.setupContext=r.length>1?jc(e):null;fn(e),_n();const i=Ct(r,e,0,[e.props,o]);if(gn(),qt(),ps(i)){if(i.then(qt,qt),t)return i.then(s=>{Li(e,s,t)}).catch(s=>{jn(s,e,0)});e.asyncDep=i}else Li(e,i,t)}else al(e,t)}function Li(e,t,n){se(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:we(t)&&(e.setupState=zs(t)),al(e,n)}let wi;function al(e,t,n){const r=e.type;if(!e.render){if(!t&&wi&&!r.render){const o=r.template||Do(e).template;if(o){const{isCustomElement:i,compilerOptions:s}=e.appContext.config,{delimiters:a,compilerOptions:l}=r,c=Ce(Ce({isCustomElement:i,delimiters:a},s),l);r.render=wi(o,c)}}e.render=r.render||ut}{fn(e),_n();try{vc(e)}finally{gn(),qt()}}}function Fc(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return Ge(e,"get","$attrs"),t[n]}}))}function jc(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return Fc(e)},slots:e.slots,emit:e.emit,expose:t}}function zr(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(zs(Ds(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Rn)return Rn[n](e)},has(t,n){return n in t||n in Rn}}))}function Uc(e,t=!0){return se(e)?e.displayName||e.name:e.name||t&&e.__name}function Kc(e){return se(e)&&"__vccOpts"in e}const W=(e,t)=>Ba(e,t,hn);function _e(e,t,n){const r=arguments.length;return r===2?we(t)&&!Z(t)?Er(t)?oe(e,null,[t]):oe(e,t):oe(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Er(n)&&(n=[n]),oe(e,t,n))}const Wc=Symbol.for("v-scx"),qc=()=>Pe(Wc),Gc="3.3.9",Yc="http://www.w3.org/2000/svg",jt=typeof document<"u"?document:null,Ai=jt&&jt.createElement("template"),Jc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t?jt.createElementNS(Yc,e):jt.createElement(e,n?{is:n}:void 0);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>jt.createTextNode(e),createComment:e=>jt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>jt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,i){const s=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{Ai.innerHTML=r?``:e;const a=Ai.content;if(r){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Pt="transition",En="animation",Vn=Symbol("_vtc"),Wn=(e,{slots:t})=>_e(oc,Qc(e),t);Wn.displayName="Transition";const cl={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};Wn.props=Ce({},Ks,cl);const $t=(e,t=[])=>{Z(e)?e.forEach(n=>n(...t)):e&&e(...t)},Pi=e=>e?Z(e)?e.some(t=>t.length>1):e.length>1:!1;function Qc(e){const t={};for(const L in e)L in cl||(t[L]=e[L]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:c=s,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:v=`${n}-leave-to`}=e,E=Zc(o),w=E&&E[0],R=E&&E[1],{onBeforeEnter:I,onEnter:k,onEnterCancelled:b,onLeave:y,onLeaveCancelled:B,onBeforeAppear:J=I,onAppear:$=k,onAppearCancelled:g=b}=t,z=(L,M,re)=>{Nt(L,M?u:a),Nt(L,M?c:s),re&&re()},C=(L,M)=>{L._isLeaving=!1,Nt(L,d),Nt(L,v),Nt(L,h),M&&M()},q=L=>(M,re)=>{const le=L?$:k,S=()=>z(M,L,re);$t(le,[M,S]),Ri(()=>{Nt(M,L?l:i),Rt(M,L?u:a),Pi(le)||Oi(M,r,w,S)})};return Ce(t,{onBeforeEnter(L){$t(I,[L]),Rt(L,i),Rt(L,s)},onBeforeAppear(L){$t(J,[L]),Rt(L,l),Rt(L,c)},onEnter:q(!1),onAppear:q(!0),onLeave(L,M){L._isLeaving=!0;const re=()=>C(L,M);Rt(L,d),tu(),Rt(L,h),Ri(()=>{L._isLeaving&&(Nt(L,d),Rt(L,v),Pi(y)||Oi(L,r,R,re))}),$t(y,[L,re])},onEnterCancelled(L){z(L,!1),$t(b,[L])},onAppearCancelled(L){z(L,!0),$t(g,[L])},onLeaveCancelled(L){C(L),$t(B,[L])}})}function Zc(e){if(e==null)return null;if(we(e))return[Ur(e.enter),Ur(e.leave)];{const t=Ur(e);return[t,t]}}function Ur(e){return ra(e)}function Rt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Vn]||(e[Vn]=new Set)).add(t)}function Nt(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Vn];n&&(n.delete(t),n.size||(e[Vn]=void 0))}function Ri(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Xc=0;function Oi(e,t,n,r){const o=e._endId=++Xc,i=()=>{o===e._endId&&r()};if(n)return setTimeout(i,n);const{type:s,timeout:a,propCount:l}=eu(e,t);if(!s)return r();const c=s+"end";let u=0;const d=()=>{e.removeEventListener(c,h),i()},h=v=>{v.target===e&&++u>=l&&d()};setTimeout(()=>{u (n[E]||"").split(", "),o=r(`${Pt}Delay`),i=r(`${Pt}Duration`),s=Ii(o,i),a=r(`${En}Delay`),l=r(`${En}Duration`),c=Ii(a,l);let u=null,d=0,h=0;t===Pt?s>0&&(u=Pt,d=s,h=i.length):t===En?c>0&&(u=En,d=c,h=l.length):(d=Math.max(s,c),u=d>0?s>c?Pt:En:null,h=u?u===Pt?i.length:l.length:0);const v=u===Pt&&/\b(transform|all)(,|$)/.test(r(`${Pt}Property`).toString());return{type:u,timeout:d,propCount:h,hasTransform:v}}function Ii(e,t){for(;e.length ki(n)+ki(e[r])))}function ki(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function tu(){return document.body.offsetHeight}function nu(e,t,n){const r=e[Vn];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const $o=Symbol("_vod"),yr={beforeMount(e,{value:t},{transition:n}){e[$o]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):yn(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),yn(e,!0),r.enter(e)):r.leave(e,()=>{yn(e,!1)}):yn(e,t))},beforeUnmount(e,{value:t}){yn(e,t)}};function yn(e,t){e.style.display=t?e[$o]:"none"}function ru(e,t,n){const r=e.style,o=pe(n);if(n&&!o){if(t&&!pe(t))for(const i in t)n[i]==null&&fo(r,i,"");for(const i in n)fo(r,i,n[i])}else{const i=r.display;o?t!==n&&(r.cssText=n):t&&e.removeAttribute("style"),$o in e&&(r.display=i)}}const xi=/\s*!important$/;function fo(e,t,n){if(Z(n))n.forEach(r=>fo(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=ou(e,t);xi.test(n)?e.setProperty(Jt(r),n.replace(xi,""),"important"):e[r]=n}}const Ci=["Webkit","Moz","ms"],Kr={};function ou(e,t){const n=Kr[t];if(n)return n;let r=dt(t);if(r!=="filter"&&r in e)return Kr[t]=r;r=Rr(r);for(let o=0;o Wr||(du.then(()=>Wr=0),Wr=Date.now());function hu(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;et(mu(r,n.value),t,5,[r])};return n.value=e,n.attached=fu(),n}function mu(e,t){if(Z(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const Vi=/^on[a-z]/,pu=(e,t,n,r,o=!1,i,s,a,l)=>{t==="class"?nu(e,r,o):t==="style"?ru(e,n,r):Nn(t)?go(t)||cu(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):vu(e,t,r,o))?su(e,t,r,i,s,a,l):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),iu(e,t,r,o))};function vu(e,t,n,r){return r?!!(t==="innerHTML"||t==="textContent"||t in e&&Vi.test(t)&&se(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||Vi.test(t)&&pe(n)?!1:t in e}const _u={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},gu=(e,t)=>n=>{if(!("key"in n))return;const r=Jt(n.key);if(t.some(o=>o===r||_u[o]===r))return e(n)},bu=Ce({patchProp:pu},Jc);let qr,Mi=!1;function Eu(){return qr=Mi?qr:Ic(bu),Mi=!0,qr}const yu=(...e)=>{const t=Eu().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=Tu(r);if(o)return n(o,!0,o instanceof SVGElement)},t};function Tu(e){return pe(e)?document.querySelector(e):e}const Lu="modulepreload",wu=function(e){return"/"+e},$i={},m=function(t,n,r){if(!n||n.length===0)return t();const o=document.getElementsByTagName("link");return Promise.all(n.map(i=>{if(i=wu(i),i in $i)return;$i[i]=!0;const s=i.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!r)for(let u=o.length-1;u>=0;u--){const d=o[u];if(d.href===i&&(!s||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${a}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":Lu,s||(c.as="script",c.crossOrigin=""),c.href=i,document.head.appendChild(c),s)return new Promise((u,d)=>{c.addEventListener("load",u),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})},Au={"v-8daa1a0e":()=>m(()=>import("./index.html-EaoSe4Mj.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-b4ed4f1c":()=>m(()=>import("./architecture.html-Ef-WWi97.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-301ab792":()=>m(()=>import("./plugin.html-69wz8wnr.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-06329db8":()=>m(()=>import("./theme.html-AYISgrKz.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-fffb8e28":()=>m(()=>import("./index.html-jH3Iv2-7.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-3c32c2ca":()=>m(()=>import("./assets.html-4ukTXhdM.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-6f1f3595":()=>m(()=>import("./bundler.html-S4_5muti.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-4f4ccb8f":()=>m(()=>import("./configuration.html-wcdlW0k5.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-e8a66a70":()=>m(()=>import("./deployment.html-LSGkd9Y2.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-fb0f0066":()=>m(()=>import("./getting-started.html-JooUvMS6.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-acb10be2":()=>m(()=>import("./i18n.html-5KgXR2re.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-0978b044":()=>m(()=>import("./markdown.html-ii1dNmCW.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-d0112c92":()=>m(()=>import("./migration.html-jhc4o0sF.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-4eaf9f84":()=>m(()=>import("./page.html-_zftyobR.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-1d14d5cc":()=>m(()=>import("./plugin.html-Z76xkPoN.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-4d76029c":()=>m(()=>import("./theme.html-wQhmGWE7.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-a951be94":()=>m(()=>import("./cli.html-t2GuSTvN.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-a84e51b8":()=>m(()=>import("./client-api.html-Hz3O_EAk.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-55453034":()=>m(()=>import("./components.html-4IDj5RAr.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-b249668c":()=>m(()=>import("./config.html-WWjNuxab.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-3590f0ec":()=>m(()=>import("./frontmatter.html-sp6j5XB_.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-4986678d":()=>m(()=>import("./node-api.html-lHGIfrDJ.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-51569e88":()=>m(()=>import("./plugin-api.html-XOYlxJHp.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-6b76c1c0":()=>m(()=>import("./theme-api.html-ZqagUKXR.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-2d0ad528":()=>m(()=>import("./index.html-Ahzl3jpH.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-03c9312a":()=>m(()=>import("./index.html-sFLocUcL.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-2a57b498":()=>m(()=>import("./adding-extra-pages.html-8nHB5UGr.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-06adec7d":()=>m(()=>import("./making-a-theme-extendable.html-rrr09wUd.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-4e3c9b8c":()=>m(()=>import("./markdown-and-vue-sfc.html-UyAjVe0G.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-3bc3633f":()=>m(()=>import("./passing-data-to-client-code.html-N0mtoojl.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-3d6c80f5":()=>m(()=>import("./usage-of-client-config.html-2Br2VXom.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-cf5a290e":()=>m(()=>import("./vite.html-GESTQK3l.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-d4319af0":()=>m(()=>import("./webpack.html-0Bcnkx8B.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-2e97e858":()=>m(()=>import("./components.html-3ku0oebd.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-0f0d17a8":()=>m(()=>import("./config.html-3uFubqIm.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-6175ace0":()=>m(()=>import("./extending.html-DQbmt8Sf.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-e5e26a84":()=>m(()=>import("./frontmatter.html-9z0BtxYw.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-176c9c4a":()=>m(()=>import("./markdown.html-E9TdBNq2.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-31e08608":()=>m(()=>import("./styles.html-dqTsW5CV.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-3ba02eb8":()=>m(()=>import("./active-header-links.html-Gm5kCTnU.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-6474e88f":()=>m(()=>import("./back-to-top.html-SBrZWHGE.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-3df91977":()=>m(()=>import("./container.html-PtxgkxjI.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-ec0baf10":()=>m(()=>import("./docsearch.html-geU7FZc2.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-5c864690":()=>m(()=>import("./external-link-icon.html-Jypp8WEn.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-0f9e4c06":()=>m(()=>import("./git.html-Ztg3geGz.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-b3f1b470":()=>m(()=>import("./google-analytics.html-ncL2DNzR.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-2ad6454d":()=>m(()=>import("./medium-zoom.html-dLpz25ZR.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-46d4f19d":()=>m(()=>import("./nprogress.html-RNgL0QGZ.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-37c5e106":()=>m(()=>import("./palette.html-svIiBuAj.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-35ebfb0e":()=>m(()=>import("./prismjs.html-0ulnQYWI.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-5f86289f":()=>m(()=>import("./pwa-popup.html--uhGb_lp.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-7ab4099e":()=>m(()=>import("./pwa.html-vvcbXjjF.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-7f8fee18":()=>m(()=>import("./register-components.html-56buZAHG.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-260e1012":()=>m(()=>import("./search.html-uJRJ7ae7.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-bb2079f4":()=>m(()=>import("./shiki.html-10ErS_oq.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-18fd0fcc":()=>m(()=>import("./theme-data.html-7AgSCC4i.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-76709450":()=>m(()=>import("./toc.html-5nixziN1.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-0754cde1":()=>m(()=>import("./architecture.html-50nO3U30.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-574aac41":()=>m(()=>import("./plugin.html-LFMVvu2B.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-66c42ad6":()=>m(()=>import("./theme.html-bQwRzLau.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-47357bdb":()=>m(()=>import("./index.html-jGrnmanP.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-029ba47b":()=>m(()=>import("./assets.html-1j54Fvx1.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-75d28a04":()=>m(()=>import("./bundler.html-vrL6KUGX.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-81f65e84":()=>m(()=>import("./configuration.html-xbAxcozF.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-4a7b6bf9":()=>m(()=>import("./deployment.html-XbzhTyhT.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-37781588":()=>m(()=>import("./getting-started.html-Ya8-UCpt.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-4b8f1400":()=>m(()=>import("./i18n.html-s1H71rsL.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-6a0a3d62":()=>m(()=>import("./markdown.html-XKozsizF.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-81b14334":()=>m(()=>import("./migration.html-yL51i5Wa.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-7a8fca2f":()=>m(()=>import("./page.html-3BGhEu12.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-9043126a":()=>m(()=>import("./plugin.html-GL3IPvy_.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-2efcb26a":()=>m(()=>import("./theme.html-PWswBlx_.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-9beb15b6":()=>m(()=>import("./cli.html-LDAEB0aD.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-332177d5":()=>m(()=>import("./client-api.html-5X1GY6z7.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-5ca60897":()=>m(()=>import("./components.html-_1ap8ZIq.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-65a9edeb":()=>m(()=>import("./config.html-eJqi6Wv3.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-d147334a":()=>m(()=>import("./frontmatter.html-IJ5-jzXZ.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-e19cff04":()=>m(()=>import("./node-api.html-tuX36iXe.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-5e9d516d":()=>m(()=>import("./plugin-api.html-mxjJqHwg.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-49a27222":()=>m(()=>import("./theme-api.html-NnDk2D-T.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-0a7c8599":()=>m(()=>import("./index.html-rTEwPOLI.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-5b617736":()=>m(()=>import("./adding-extra-pages.html-gbWcNXLf.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-04c514ac":()=>m(()=>import("./making-a-theme-extendable.html-meYav6NP.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-63e02eaa":()=>m(()=>import("./markdown-and-vue-sfc.html-8CMAPm9t.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-10b13bae":()=>m(()=>import("./passing-data-to-client-code.html-66UgnX14.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-c03241b4":()=>m(()=>import("./usage-of-client-config.html-WviU2RhQ.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-6ff623ea":()=>m(()=>import("./vite.html-UcIosjal.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-dde74f12":()=>m(()=>import("./webpack.html-Ynkv9VBN.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-551922c5":()=>m(()=>import("./components.html-9ZVeijmS.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-03a561ce":()=>m(()=>import("./config.html-pdR6VJD6.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-90ed1862":()=>m(()=>import("./extending.html-oNTFNs2u.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-a566dc26":()=>m(()=>import("./frontmatter.html-3hYnultF.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-c78c5de8":()=>m(()=>import("./markdown.html-v53gNZxx.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-2100bd79":()=>m(()=>import("./styles.html-5VBO1PYN.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-231b4d69":()=>m(()=>import("./active-header-links.html-fvsIO2KT.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-6c6e4840":()=>m(()=>import("./back-to-top.html-3mn9vy9t.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-b10e9d30":()=>m(()=>import("./container.html-kqFoOXKr.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-190c7f2e":()=>m(()=>import("./docsearch.html-yW8YJyTj.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-7cc40dbf":()=>m(()=>import("./external-link-icon.html-xe1iQbC8.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-d2322692":()=>m(()=>import("./git.html-jPKcGQNF.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-07ca2692":()=>m(()=>import("./google-analytics.html-WyEii0XV.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-32cfa4fe":()=>m(()=>import("./medium-zoom.html-lG08Ag1t.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-9f56ece4":()=>m(()=>import("./nprogress.html-X5umHJyu.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-5fd3efae":()=>m(()=>import("./palette.html-mci2X1xJ.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-9cba4982":()=>m(()=>import("./prismjs.html-N5-uNoGW.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-6df47ee0":()=>m(()=>import("./pwa-popup.html-dTyC3ZgU.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-01fcaa4f":()=>m(()=>import("./pwa.html-SVcJrjev.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-670b0cc9":()=>m(()=>import("./register-components.html-X0BNrizM.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-42d1e5c1":()=>m(()=>import("./search.html-2D2lSrvH.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-7a12fb77":()=>m(()=>import("./shiki.html-ANgciB6g.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-411f140a":()=>m(()=>import("./theme-data.html-ODrPozv0.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-048d95fe":()=>m(()=>import("./toc.html-UM_HyWdr.js"),__vite__mapDeps([])).then(({data:e})=>e),"v-3706649a":()=>m(()=>import("./404.html-6Yl8cQE3.js"),__vite__mapDeps([])).then(({data:e})=>e)},Pu=JSON.parse('{"base":"/","lang":"en-US","title":"","description":"","head":[["link",{"rel":"icon","type":"image/png","sizes":"16x16","href":"/images/icons/favicon-16x16.png"}],["link",{"rel":"icon","type":"image/png","sizes":"32x32","href":"/images/icons/favicon-32x32.png"}],["link",{"rel":"manifest","href":"/manifest.webmanifest"}],["meta",{"name":"application-name","content":"VuePress"}],["meta",{"name":"apple-mobile-web-app-title","content":"VuePress"}],["meta",{"name":"apple-mobile-web-app-status-bar-style","content":"black"}],["link",{"rel":"apple-touch-icon","href":"/images/icons/apple-touch-icon.png"}],["link",{"rel":"mask-icon","href":"/images/icons/safari-pinned-tab.svg","color":"#3eaf7c"}],["meta",{"name":"msapplication-TileColor","content":"#3eaf7c"}],["meta",{"name":"theme-color","content":"#3eaf7c"}]],"locales":{"/":{"lang":"en-US","title":"VuePress","description":"Vue-powered Static Site Generator"},"/zh/":{"lang":"zh-CN","title":"VuePress","description":"Vue 驱动的静态网站生成器"}}}');var Ru=([e,t,n])=>e==="meta"&&t.name?`${e}.${t.name}`:["title","base"].includes(e)?e:e==="template"&&t.id?`${e}.${t.id}`:JSON.stringify([e,t,n]),Ou=e=>{const t=new Set,n=[];return e.forEach(r=>{const o=Ru(r);t.has(o)||(t.add(o),n.push(r))}),n},qn=e=>/^(https?:)?\/\//.test(e),Iu=e=>/^[a-z][a-z0-9+.-]*:/.test(e),No=e=>Object.prototype.toString.call(e)==="[object Object]",ul=e=>e[e.length-1]==="/"?e.slice(0,-1):e,dl=e=>e[0]==="/"?e.slice(1):e,fl=(e,t)=>{const n=Object.keys(e).sort((r,o)=>{const i=o.split("/").length-r.split("/").length;return i!==0?i:o.length-r.length});for(const r of n)if(t.startsWith(r))return r;return"/"},Ni=(e,t="/")=>{const n=e.replace(/^(https?:)?\/\/[^/]*/,"");return n.startsWith(t)?`/${n.slice(t.length)}`:n};const hl={"v-8daa1a0e":A(()=>m(()=>import("./index.html-owSzs6LV.js"),__vite__mapDeps([]))),"v-b4ed4f1c":A(()=>m(()=>import("./architecture.html-jLHymeGV.js"),__vite__mapDeps([0,1]))),"v-301ab792":A(()=>m(()=>import("./plugin.html-1l5wit-Z.js"),__vite__mapDeps([]))),"v-06329db8":A(()=>m(()=>import("./theme.html-pdgRQ6zJ.js"),__vite__mapDeps([]))),"v-fffb8e28":A(()=>m(()=>import("./index.html-4Jlev2wy.js"),__vite__mapDeps([]))),"v-3c32c2ca":A(()=>m(()=>import("./assets.html-jGDJJiJc.js"),__vite__mapDeps([2,3]))),"v-6f1f3595":A(()=>m(()=>import("./bundler.html-1Lcboibq.js"),__vite__mapDeps([]))),"v-4f4ccb8f":A(()=>m(()=>import("./configuration.html-xF-jc2r3.js"),__vite__mapDeps([]))),"v-e8a66a70":A(()=>m(()=>import("./deployment.html-U91hxMp2.js"),__vite__mapDeps([]))),"v-fb0f0066":A(()=>m(()=>import("./getting-started.html-sCB2RJZF.js"),__vite__mapDeps([]))),"v-acb10be2":A(()=>m(()=>import("./i18n.html-y-3sWUaJ.js"),__vite__mapDeps([]))),"v-0978b044":A(()=>m(()=>import("./markdown.html-RaKgDcuz.js"),__vite__mapDeps([]))),"v-d0112c92":A(()=>m(()=>import("./migration.html-vHHGQ42_.js"),__vite__mapDeps([]))),"v-4eaf9f84":A(()=>m(()=>import("./page.html-jiu4BY9r.js"),__vite__mapDeps([]))),"v-1d14d5cc":A(()=>m(()=>import("./plugin.html-JBB6sUWc.js"),__vite__mapDeps([]))),"v-4d76029c":A(()=>m(()=>import("./theme.html-1lMGI_to.js"),__vite__mapDeps([]))),"v-a951be94":A(()=>m(()=>import("./cli.html-UOo9rMKI.js"),__vite__mapDeps([]))),"v-a84e51b8":A(()=>m(()=>import("./client-api.html-jr_tX_nU.js"),__vite__mapDeps([]))),"v-55453034":A(()=>m(()=>import("./components.html-8e6s9jyW.js"),__vite__mapDeps([]))),"v-b249668c":A(()=>m(()=>import("./config.html-i_ba8INl.js"),__vite__mapDeps([]))),"v-3590f0ec":A(()=>m(()=>import("./frontmatter.html-0HrMHRj6.js"),__vite__mapDeps([]))),"v-4986678d":A(()=>m(()=>import("./node-api.html-ZpV2lRra.js"),__vite__mapDeps([]))),"v-51569e88":A(()=>m(()=>import("./plugin-api.html-c9sfNuSA.js"),__vite__mapDeps([]))),"v-6b76c1c0":A(()=>m(()=>import("./theme-api.html--P_ZE6Od.js"),__vite__mapDeps([]))),"v-2d0ad528":A(()=>m(()=>import("./index.html-__AKVf_E.js"),__vite__mapDeps([]))),"v-03c9312a":A(()=>m(()=>import("./index.html-OVZ3rK4C.js"),__vite__mapDeps([]))),"v-2a57b498":A(()=>m(()=>import("./adding-extra-pages.html-1UmMYfeg.js"),__vite__mapDeps([]))),"v-06adec7d":A(()=>m(()=>import("./making-a-theme-extendable.html-hlHjGq6k.js"),__vite__mapDeps([]))),"v-4e3c9b8c":A(()=>m(()=>import("./markdown-and-vue-sfc.html-4gGUwagr.js"),__vite__mapDeps([]))),"v-3bc3633f":A(()=>m(()=>import("./passing-data-to-client-code.html-7z7BFnaN.js"),__vite__mapDeps([]))),"v-3d6c80f5":A(()=>m(()=>import("./usage-of-client-config.html-sg8S__SR.js"),__vite__mapDeps([]))),"v-cf5a290e":A(()=>m(()=>import("./vite.html-MchlPc-W.js"),__vite__mapDeps([]))),"v-d4319af0":A(()=>m(()=>import("./webpack.html-jpspO8kF.js"),__vite__mapDeps([]))),"v-2e97e858":A(()=>m(()=>import("./components.html-zMFdbMQ-.js"),__vite__mapDeps([]))),"v-0f0d17a8":A(()=>m(()=>import("./config.html-y99KBdbl.js"),__vite__mapDeps([]))),"v-6175ace0":A(()=>m(()=>import("./extending.html-wJrHlIH8.js"),__vite__mapDeps([4,5]))),"v-e5e26a84":A(()=>m(()=>import("./frontmatter.html-T5c6-cfU.js"),__vite__mapDeps([]))),"v-176c9c4a":A(()=>m(()=>import("./markdown.html-Pg4gltF4.js"),__vite__mapDeps([]))),"v-31e08608":A(()=>m(()=>import("./styles.html-4XyMA79B.js"),__vite__mapDeps([]))),"v-3ba02eb8":A(()=>m(()=>import("./active-header-links.html-sIc4BSCl.js"),__vite__mapDeps([]))),"v-6474e88f":A(()=>m(()=>import("./back-to-top.html-ETMm9zTr.js"),__vite__mapDeps([]))),"v-3df91977":A(()=>m(()=>import("./container.html-wrzIDX-O.js"),__vite__mapDeps([]))),"v-ec0baf10":A(()=>m(()=>import("./docsearch.html-4mSLVIiN.js"),__vite__mapDeps([]))),"v-5c864690":A(()=>m(()=>import("./external-link-icon.html-hXXWH4Bv.js"),__vite__mapDeps([]))),"v-0f9e4c06":A(()=>m(()=>import("./git.html-gg0deoQP.js"),__vite__mapDeps([]))),"v-b3f1b470":A(()=>m(()=>import("./google-analytics.html-M2qIk_Fo.js"),__vite__mapDeps([]))),"v-2ad6454d":A(()=>m(()=>import("./medium-zoom.html-qakUfSNj.js"),__vite__mapDeps([]))),"v-46d4f19d":A(()=>m(()=>import("./nprogress.html-NpXpKxIh.js"),__vite__mapDeps([]))),"v-37c5e106":A(()=>m(()=>import("./palette.html-b242Udjo.js"),__vite__mapDeps([]))),"v-35ebfb0e":A(()=>m(()=>import("./prismjs.html-hnhxNt6P.js"),__vite__mapDeps([]))),"v-5f86289f":A(()=>m(()=>import("./pwa-popup.html-FEkQ6tW5.js"),__vite__mapDeps([]))),"v-7ab4099e":A(()=>m(()=>import("./pwa.html-7ewNita9.js"),__vite__mapDeps([]))),"v-7f8fee18":A(()=>m(()=>import("./register-components.html-Edirl6TP.js"),__vite__mapDeps([]))),"v-260e1012":A(()=>m(()=>import("./search.html-3IiPlknu.js"),__vite__mapDeps([]))),"v-bb2079f4":A(()=>m(()=>import("./shiki.html-0DoPKGkm.js"),__vite__mapDeps([]))),"v-18fd0fcc":A(()=>m(()=>import("./theme-data.html-O0pSpAdt.js"),__vite__mapDeps([]))),"v-76709450":A(()=>m(()=>import("./toc.html-k5VmjERh.js"),__vite__mapDeps([]))),"v-0754cde1":A(()=>m(()=>import("./architecture.html-UaR5cFj_.js"),__vite__mapDeps([6,1]))),"v-574aac41":A(()=>m(()=>import("./plugin.html-PD1th8Qg.js"),__vite__mapDeps([]))),"v-66c42ad6":A(()=>m(()=>import("./theme.html-PTEeVU-K.js"),__vite__mapDeps([]))),"v-47357bdb":A(()=>m(()=>import("./index.html-hVy-ihXY.js"),__vite__mapDeps([]))),"v-029ba47b":A(()=>m(()=>import("./assets.html-_UpsFxx-.js"),__vite__mapDeps([7,3]))),"v-75d28a04":A(()=>m(()=>import("./bundler.html-3HPSreHe.js"),__vite__mapDeps([]))),"v-81f65e84":A(()=>m(()=>import("./configuration.html-pW3ShFLZ.js"),__vite__mapDeps([]))),"v-4a7b6bf9":A(()=>m(()=>import("./deployment.html-rDu3xTc7.js"),__vite__mapDeps([]))),"v-37781588":A(()=>m(()=>import("./getting-started.html-otXrftcQ.js"),__vite__mapDeps([]))),"v-4b8f1400":A(()=>m(()=>import("./i18n.html-326CaaCk.js"),__vite__mapDeps([]))),"v-6a0a3d62":A(()=>m(()=>import("./markdown.html-O0xMZyR_.js"),__vite__mapDeps([]))),"v-81b14334":A(()=>m(()=>import("./migration.html-j6eU3LYG.js"),__vite__mapDeps([]))),"v-7a8fca2f":A(()=>m(()=>import("./page.html-qK-n-fJU.js"),__vite__mapDeps([]))),"v-9043126a":A(()=>m(()=>import("./plugin.html-kN-P6k-m.js"),__vite__mapDeps([]))),"v-2efcb26a":A(()=>m(()=>import("./theme.html-HAoqhZVd.js"),__vite__mapDeps([]))),"v-9beb15b6":A(()=>m(()=>import("./cli.html-oJwwPLzh.js"),__vite__mapDeps([]))),"v-332177d5":A(()=>m(()=>import("./client-api.html-uhd2B6Du.js"),__vite__mapDeps([]))),"v-5ca60897":A(()=>m(()=>import("./components.html-j4FRcZu1.js"),__vite__mapDeps([]))),"v-65a9edeb":A(()=>m(()=>import("./config.html-mzxviKbd.js"),__vite__mapDeps([]))),"v-d147334a":A(()=>m(()=>import("./frontmatter.html-UUIM54bd.js"),__vite__mapDeps([]))),"v-e19cff04":A(()=>m(()=>import("./node-api.html-RzTrTTfo.js"),__vite__mapDeps([]))),"v-5e9d516d":A(()=>m(()=>import("./plugin-api.html-nvZZ9-9s.js"),__vite__mapDeps([]))),"v-49a27222":A(()=>m(()=>import("./theme-api.html-KX9s0kwh.js"),__vite__mapDeps([]))),"v-0a7c8599":A(()=>m(()=>import("./index.html-LIeZHVSg.js"),__vite__mapDeps([]))),"v-5b617736":A(()=>m(()=>import("./adding-extra-pages.html-wSdXw6mw.js"),__vite__mapDeps([]))),"v-04c514ac":A(()=>m(()=>import("./making-a-theme-extendable.html-wDYHhuw8.js"),__vite__mapDeps([]))),"v-63e02eaa":A(()=>m(()=>import("./markdown-and-vue-sfc.html-7cfmbOwj.js"),__vite__mapDeps([]))),"v-10b13bae":A(()=>m(()=>import("./passing-data-to-client-code.html-f-CVV22Z.js"),__vite__mapDeps([]))),"v-c03241b4":A(()=>m(()=>import("./usage-of-client-config.html-d0TxxEeJ.js"),__vite__mapDeps([]))),"v-6ff623ea":A(()=>m(()=>import("./vite.html-ATywsxtj.js"),__vite__mapDeps([]))),"v-dde74f12":A(()=>m(()=>import("./webpack.html--2xfMMIX.js"),__vite__mapDeps([]))),"v-551922c5":A(()=>m(()=>import("./components.html-WqkyAXws.js"),__vite__mapDeps([]))),"v-03a561ce":A(()=>m(()=>import("./config.html-QsTvJZys.js"),__vite__mapDeps([]))),"v-90ed1862":A(()=>m(()=>import("./extending.html-w7Kv_9tW.js"),__vite__mapDeps([8,5]))),"v-a566dc26":A(()=>m(()=>import("./frontmatter.html-pBtKj0Vl.js"),__vite__mapDeps([]))),"v-c78c5de8":A(()=>m(()=>import("./markdown.html-f0CKPNMw.js"),__vite__mapDeps([]))),"v-2100bd79":A(()=>m(()=>import("./styles.html-ppE-xWyH.js"),__vite__mapDeps([]))),"v-231b4d69":A(()=>m(()=>import("./active-header-links.html-NWwmfOvm.js"),__vite__mapDeps([]))),"v-6c6e4840":A(()=>m(()=>import("./back-to-top.html-U82tNcMw.js"),__vite__mapDeps([]))),"v-b10e9d30":A(()=>m(()=>import("./container.html-TjPytR4y.js"),__vite__mapDeps([]))),"v-190c7f2e":A(()=>m(()=>import("./docsearch.html-qC621Z1-.js"),__vite__mapDeps([]))),"v-7cc40dbf":A(()=>m(()=>import("./external-link-icon.html-DFH8UsDb.js"),__vite__mapDeps([]))),"v-d2322692":A(()=>m(()=>import("./git.html-MIFkPpVx.js"),__vite__mapDeps([]))),"v-07ca2692":A(()=>m(()=>import("./google-analytics.html-p-WIn3G5.js"),__vite__mapDeps([]))),"v-32cfa4fe":A(()=>m(()=>import("./medium-zoom.html-EoVYZum_.js"),__vite__mapDeps([]))),"v-9f56ece4":A(()=>m(()=>import("./nprogress.html-gqI71Nvz.js"),__vite__mapDeps([]))),"v-5fd3efae":A(()=>m(()=>import("./palette.html-Vi2lcYGC.js"),__vite__mapDeps([]))),"v-9cba4982":A(()=>m(()=>import("./prismjs.html-gemLzpIR.js"),__vite__mapDeps([]))),"v-6df47ee0":A(()=>m(()=>import("./pwa-popup.html-VMOi2wzE.js"),__vite__mapDeps([]))),"v-01fcaa4f":A(()=>m(()=>import("./pwa.html-dJHRD2Jh.js"),__vite__mapDeps([]))),"v-670b0cc9":A(()=>m(()=>import("./register-components.html-RP8lipwZ.js"),__vite__mapDeps([]))),"v-42d1e5c1":A(()=>m(()=>import("./search.html-fZuVMAaU.js"),__vite__mapDeps([]))),"v-7a12fb77":A(()=>m(()=>import("./shiki.html-WJxb9HXD.js"),__vite__mapDeps([]))),"v-411f140a":A(()=>m(()=>import("./theme-data.html-C8hdJMe3.js"),__vite__mapDeps([]))),"v-048d95fe":A(()=>m(()=>import("./toc.html-a3Qmvl1r.js"),__vite__mapDeps([]))),"v-3706649a":A(()=>m(()=>import("./404.html-VtKSq7T3.js"),__vite__mapDeps([])))};var ku=Symbol(""),ml=Symbol(""),xu=Fn({key:"",path:"",title:"",lang:"",frontmatter:{},headers:[]}),Gt=()=>{const e=Pe(ml);if(!e)throw new Error("pageData() is called without provider.");return e},pl=Symbol(""),_t=()=>{const e=Pe(pl);if(!e)throw new Error("usePageFrontmatter() is called without provider.");return e},vl=Symbol(""),Cu=()=>{const e=Pe(vl);if(!e)throw new Error("usePageHead() is called without provider.");return e},Du=Symbol(""),_l=Symbol(""),gl=()=>{const e=Pe(_l);if(!e)throw new Error("usePageLang() is called without provider.");return e},bl=Symbol(""),Su=()=>{const e=Pe(bl);if(!e)throw new Error("usePageLayout() is called without provider.");return e},zu=Te(Au),Ho=Symbol(""),Gn=()=>{const e=Pe(Ho);if(!e)throw new Error("useRouteLocale() is called without provider.");return e},rn=Te(Pu),El=()=>rn,yl=Symbol(""),Bo=()=>{const e=Pe(yl);if(!e)throw new Error("useSiteLocaleData() is called without provider.");return e},Vu=Symbol(""),Mu="Layout",$u="NotFound",ht=Bn({resolveLayouts:e=>e.reduce((t,n)=>({...t,...n.layouts}),{}),resolvePageData:async e=>{const t=zu.value[e];return await(t==null?void 0:t())??xu},resolvePageFrontmatter:e=>e.frontmatter,resolvePageHead:(e,t,n)=>{const r=pe(t.description)?t.description:n.description,o=[...Z(t.head)?t.head:[],...n.head,["title",{},e],["meta",{name:"description",content:r}]];return Ou(o)},resolvePageHeadTitle:(e,t)=>[e.title,t.title].filter(n=>!!n).join(" | "),resolvePageLang:(e,t)=>e.lang||t.lang||"en-US",resolvePageLayout:(e,t)=>{let n;if(e.path){const r=e.frontmatter.layout;pe(r)?n=r:n=Mu}else n=$u;return t[n]},resolveRouteLocale:(e,t)=>fl(e,t),resolveSiteLocaleData:(e,t)=>({...e,...e.locales[t]})}),Fo=ue({name:"ClientOnly",setup(e,t){const n=Te(!1);return je(()=>{n.value=!0}),()=>{var r,o;return n.value?(o=(r=t.slots).default)==null?void 0:o.call(r):null}}}),Nu=ue({name:"Content",props:{pageKey:{type:String,required:!1,default:""}},setup(e){const t=Gt(),n=W(()=>hl[e.pageKey||t.value.key]);return()=>n.value?_e(n.value):_e("div","404 Not Found")}}),yt=(e={})=>e,jo=e=>qn(e)?e:`/${dl(e)}`;function Uo(e,t,n){var r,o,i;t===void 0&&(t=50),n===void 0&&(n={});var s=(r=n.isImmediate)!=null&&r,a=(o=n.callback)!=null&&o,l=n.maxWait,c=Date.now(),u=[];function d(){if(l!==void 0){var v=Date.now()-c;if(v+t>=l)return l-v}return t}var h=function(){var v=[].slice.call(arguments),E=this;return new Promise(function(w,R){var I=s&&i===void 0;if(i!==void 0&&clearTimeout(i),i=setTimeout(function(){if(i=void 0,c=Date.now(),!s){var b=e.apply(E,v);a&&a(b),u.forEach(function(y){return(0,y.resolve)(b)}),u=[]}},d()),I){var k=e.apply(E,v);return a&&a(k),w(k)}u.push({resolve:w,reject:R})})};return h.cancel=function(v){i!==void 0&&clearTimeout(i),u.forEach(function(E){return(0,E.reject)(v)}),u=[]},h}/*! + * vue-router v4.2.5 + * (c) 2023 Eduardo San Martin Morote + * @license MIT + */const nn=typeof window<"u";function Hu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const ve=Object.assign;function Gr(e,t){const n={};for(const r in t){const o=t[r];n[r]=it(o)?o.map(e):e(o)}return n}const kn=()=>{},it=Array.isArray,Bu=/\/$/,Fu=e=>e.replace(Bu,"");function Yr(e,t,n="/"){let r,o={},i="",s="";const a=t.indexOf("#");let l=t.indexOf("?");return a =0&&(l=-1),l>-1&&(r=t.slice(0,l),i=t.slice(l+1,a>-1?a:t.length),o=e(i)),a>-1&&(r=r||t.slice(0,a),s=t.slice(a,t.length)),r=Wu(r??t,n),{fullPath:r+(i&&"?")+i+s,path:r,query:o,hash:s}}function ju(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Hi(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Uu(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&mn(t.matched[r],n.matched[o])&&Tl(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function mn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Tl(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Ku(e[n],t[n]))return!1;return!0}function Ku(e,t){return it(e)?Bi(e,t):it(t)?Bi(t,e):e===t}function Bi(e,t){return it(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Wu(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let i=n.length-1,s,a;for(s=0;s 1&&i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(s-(s===r.length?1:0)).join("/")}var Mn;(function(e){e.pop="pop",e.push="push"})(Mn||(Mn={}));var xn;(function(e){e.back="back",e.forward="forward",e.unknown=""})(xn||(xn={}));function qu(e){if(!e)if(nn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Fu(e)}const Gu=/^[^#]+#/;function Yu(e,t){return e.replace(Gu,"#")+t}function Ju(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const Vr=()=>({left:window.pageXOffset,top:window.pageYOffset});function Qu(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=Ju(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function Fi(e,t){return(history.state?history.state.position-t:-1)+e}const ho=new Map;function Zu(e,t){ho.set(e,t)}function Xu(e){const t=ho.get(e);return ho.delete(e),t}let ed=()=>location.protocol+"//"+location.host;function Ll(e,t){const{pathname:n,search:r,hash:o}=t,i=e.indexOf("#");if(i>-1){let a=o.includes(e.slice(i))?e.slice(i).length:1,l=o.slice(a);return l[0]!=="/"&&(l="/"+l),Hi(l,"")}return Hi(n,e)+r+o}function td(e,t,n,r){let o=[],i=[],s=null;const a=({state:h})=>{const v=Ll(e,location),E=n.value,w=t.value;let R=0;if(h){if(n.value=v,t.value=h,s&&s===E){s=null;return}R=w?h.position-w.position:0}else r(v);o.forEach(I=>{I(n.value,E,{delta:R,type:Mn.pop,direction:R?R>0?xn.forward:xn.back:xn.unknown})})};function l(){s=n.value}function c(h){o.push(h);const v=()=>{const E=o.indexOf(h);E>-1&&o.splice(E,1)};return i.push(v),v}function u(){const{history:h}=window;h.state&&h.replaceState(ve({},h.state,{scroll:Vr()}),"")}function d(){for(const h of i)h();i=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:d}}function ji(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?Vr():null}}function nd(e){const{history:t,location:n}=window,r={value:Ll(e,n)},o={value:t.state};o.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(l,c,u){const d=e.indexOf("#"),h=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+l:ed()+e+l;try{t[u?"replaceState":"pushState"](c,"",h),o.value=c}catch(v){console.error(v),n[u?"replace":"assign"](h)}}function s(l,c){const u=ve({},t.state,ji(o.value.back,l,o.value.forward,!0),c,{position:o.value.position});i(l,u,!0),r.value=l}function a(l,c){const u=ve({},o.value,t.state,{forward:l,scroll:Vr()});i(u.current,u,!0);const d=ve({},ji(r.value,l,null),{position:u.position+1},c);i(l,d,!1),r.value=l}return{location:r,state:o,push:a,replace:s}}function rd(e){e=qu(e);const t=nd(e),n=td(e,t.state,t.location,t.replace);function r(i,s=!0){s||n.pauseListeners(),history.go(i)}const o=ve({location:"",base:e,go:r,createHref:Yu.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function od(e){return typeof e=="string"||e&&typeof e=="object"}function wl(e){return typeof e=="string"||typeof e=="symbol"}const mt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Al=Symbol("");var Ui;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Ui||(Ui={}));function pn(e,t){return ve(new Error,{type:e,[Al]:!0},t)}function ft(e,t){return e instanceof Error&&Al in e&&(t==null||!!(e.type&t))}const Ki="[^/]+?",id={sensitive:!1,strict:!1,start:!0,end:!0},sd=/[.+*?^${}()[\]/\\]/g;function ld(e,t){const n=ve({},id,t),r=[];let o=n.start?"^":"";const i=[];for(const c of e){const u=c.length?[]:[90];n.strict&&!c.length&&(o+="/");for(let d=0;d t.length?t.length===1&&t[0]===80?1:-1:0}function cd(e,t){let n=0;const r=e.score,o=t.score;for(;n 0&&t[t.length-1]<0}const ud={type:0,value:""},dd=/[a-zA-Z0-9_]/;function fd(e){if(!e)return[[]];if(e==="/")return[[ud]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(v){throw new Error(`ERR (${n})/"${c}": ${v}`)}let n=0,r=n;const o=[];let i;function s(){i&&o.push(i),i=[]}let a=0,l,c="",u="";function d(){c&&(n===0?i.push({type:0,value:c}):n===1||n===2||n===3?(i.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),c="")}function h(){c+=l}for(;a {s(k)}:kn}function s(u){if(wl(u)){const d=r.get(u);d&&(r.delete(u),n.splice(n.indexOf(d),1),d.children.forEach(s),d.alias.forEach(s))}else{const d=n.indexOf(u);d>-1&&(n.splice(d,1),u.record.name&&r.delete(u.record.name),u.children.forEach(s),u.alias.forEach(s))}}function a(){return n}function l(u){let d=0;for(;d =0&&(u.record.path!==n[d].record.path||!Pl(u,n[d]));)d++;n.splice(d,0,u),u.record.name&&!Gi(u)&&r.set(u.record.name,u)}function c(u,d){let h,v={},E,w;if("name"in u&&u.name){if(h=r.get(u.name),!h)throw pn(1,{location:u});w=h.record.name,v=ve(qi(d.params,h.keys.filter(k=>!k.optional).map(k=>k.name)),u.params&&qi(u.params,h.keys.map(k=>k.name))),E=h.stringify(v)}else if("path"in u)E=u.path,h=n.find(k=>k.re.test(E)),h&&(v=h.parse(E),w=h.record.name);else{if(h=d.name?r.get(d.name):n.find(k=>k.re.test(d.path)),!h)throw pn(1,{location:u,currentLocation:d});w=h.record.name,v=ve({},d.params,u.params),E=h.stringify(v)}const R=[];let I=h;for(;I;)R.unshift(I.record),I=I.parent;return{name:w,path:E,params:v,matched:R,meta:_d(R)}}return e.forEach(u=>i(u)),{addRoute:i,resolve:c,removeRoute:s,getRoutes:a,getRecordMatcher:o}}function qi(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function pd(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:vd(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function vd(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Gi(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function _d(e){return e.reduce((t,n)=>ve(t,n.meta),{})}function Yi(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function Pl(e,t){return t.children.some(n=>n===e||Pl(e,n))}const Rl=/#/g,gd=/&/g,bd=/\//g,Ed=/=/g,yd=/\?/g,Ol=/\+/g,Td=/%5B/g,Ld=/%5D/g,Il=/%5E/g,wd=/%60/g,kl=/%7B/g,Ad=/%7C/g,xl=/%7D/g,Pd=/%20/g;function Ko(e){return encodeURI(""+e).replace(Ad,"|").replace(Td,"[").replace(Ld,"]")}function Rd(e){return Ko(e).replace(kl,"{").replace(xl,"}").replace(Il,"^")}function mo(e){return Ko(e).replace(Ol,"%2B").replace(Pd,"+").replace(Rl,"%23").replace(gd,"%26").replace(wd,"`").replace(kl,"{").replace(xl,"}").replace(Il,"^")}function Od(e){return mo(e).replace(Ed,"%3D")}function Id(e){return Ko(e).replace(Rl,"%23").replace(yd,"%3F")}function kd(e){return e==null?"":Id(e).replace(bd,"%2F")}function Tr(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function xd(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let o=0;o i&&mo(i)):[r&&mo(r)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function Cd(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=it(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}const Dd=Symbol(""),Qi=Symbol(""),Mr=Symbol(""),Wo=Symbol(""),po=Symbol("");function Tn(){let e=[];function t(r){return e.push(r),()=>{const o=e.indexOf(r);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function kt(e,t,n,r,o){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((s,a)=>{const l=d=>{d===!1?a(pn(4,{from:n,to:t})):d instanceof Error?a(d):od(d)?a(pn(2,{from:t,to:d})):(i&&r.enterCallbacks[o]===i&&typeof d=="function"&&i.push(d),s())},c=e.call(r&&r.instances[o],t,n,l);let u=Promise.resolve(c);e.length<3&&(u=u.then(l)),u.catch(d=>a(d))})}function Jr(e,t,n,r){const o=[];for(const i of e)for(const s in i.components){let a=i.components[s];if(!(t!=="beforeRouteEnter"&&!i.instances[s]))if(Sd(a)){const c=(a.__vccOpts||a)[t];c&&o.push(kt(c,n,r,i,s))}else{let l=a();o.push(()=>l.then(c=>{if(!c)return Promise.reject(new Error(`Couldn't resolve component "${s}" at "${i.path}"`));const u=Hu(c)?c.default:c;i.components[s]=u;const h=(u.__vccOpts||u)[t];return h&&kt(h,n,r,i,s)()}))}}return o}function Sd(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Zi(e){const t=Pe(Mr),n=Pe(Wo),r=W(()=>t.resolve(ne(e.to))),o=W(()=>{const{matched:l}=r.value,{length:c}=l,u=l[c-1],d=n.matched;if(!u||!d.length)return-1;const h=d.findIndex(mn.bind(null,u));if(h>-1)return h;const v=Xi(l[c-2]);return c>1&&Xi(u)===v&&d[d.length-1].path!==v?d.findIndex(mn.bind(null,l[c-2])):h}),i=W(()=>o.value>-1&&$d(n.params,r.value.params)),s=W(()=>o.value>-1&&o.value===n.matched.length-1&&Tl(n.params,r.value.params));function a(l={}){return Md(l)?t[ne(e.replace)?"replace":"push"](ne(e.to)).catch(kn):Promise.resolve()}return{route:r,href:W(()=>r.value.href),isActive:i,isExactActive:s,navigate:a}}const zd=ue({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Zi,setup(e,{slots:t}){const n=Bn(Zi(e)),{options:r}=Pe(Mr),o=W(()=>({[es(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[es(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&t.default(n);return e.custom?i:_e("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},i)}}}),Vd=zd;function Md(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function $d(e,t){for(const n in t){const r=t[n],o=e[n];if(typeof r=="string"){if(r!==o)return!1}else if(!it(o)||o.length!==r.length||r.some((i,s)=>i!==o[s]))return!1}return!0}function Xi(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const es=(e,t,n)=>e??t??n,Nd=ue({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Pe(po),o=W(()=>e.route||r.value),i=Pe(Qi,0),s=W(()=>{let c=ne(i);const{matched:u}=o.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=W(()=>o.value.matched[s.value]);Wt(Qi,W(()=>s.value+1)),Wt(Dd,a),Wt(po,o);const l=Te();return qe(()=>[l.value,a.value,e.name],([c,u,d],[h,v,E])=>{u&&(u.instances[d]=c,v&&v!==u&&c&&c===h&&(u.leaveGuards.size||(u.leaveGuards=v.leaveGuards),u.updateGuards.size||(u.updateGuards=v.updateGuards))),c&&u&&(!v||!mn(u,v)||!h)&&(u.enterCallbacks[d]||[]).forEach(w=>w(c))},{flush:"post"}),()=>{const c=o.value,u=e.name,d=a.value,h=d&&d.components[u];if(!h)return ts(n.default,{Component:h,route:c});const v=d.props[u],E=v?v===!0?c.params:typeof v=="function"?v(c):v:null,R=_e(h,ve({},E,t,{onVnodeUnmounted:I=>{I.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return ts(n.default,{Component:R,route:c})||R}}});function ts(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Cl=Nd;function Hd(e){const t=md(e.routes,e),n=e.parseQuery||xd,r=e.stringifyQuery||Ji,o=e.history,i=Tn(),s=Tn(),a=Tn(),l=Io(mt);let c=mt;nn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Gr.bind(null,P=>""+P),d=Gr.bind(null,kd),h=Gr.bind(null,Tr);function v(P,U){let N,Y;return wl(P)?(N=t.getRecordMatcher(P),Y=U):Y=P,t.addRoute(Y,N)}function E(P){const U=t.getRecordMatcher(P);U&&t.removeRoute(U)}function w(){return t.getRoutes().map(P=>P.record)}function R(P){return!!t.getRecordMatcher(P)}function I(P,U){if(U=ve({},U||l.value),typeof P=="string"){const _=Yr(n,P,U.path),T=t.resolve({path:_.path},U),O=o.createHref(_.fullPath);return ve(_,T,{params:h(T.params),hash:Tr(_.hash),redirectedFrom:void 0,href:O})}let N;if("path"in P)N=ve({},P,{path:Yr(n,P.path,U.path).path});else{const _=ve({},P.params);for(const T in _)_[T]==null&&delete _[T];N=ve({},P,{params:d(_)}),U.params=d(U.params)}const Y=t.resolve(N,U),ce=P.hash||"";Y.params=u(h(Y.params));const f=ju(r,ve({},P,{hash:Rd(ce),path:Y.path})),p=o.createHref(f);return ve({fullPath:f,hash:ce,query:r===Ji?Cd(P.query):P.query||{}},Y,{redirectedFrom:void 0,href:p})}function k(P){return typeof P=="string"?Yr(n,P,l.value.path):ve({},P)}function b(P,U){if(c!==P)return pn(8,{from:U,to:P})}function y(P){return $(P)}function B(P){return y(ve(k(P),{replace:!0}))}function J(P){const U=P.matched[P.matched.length-1];if(U&&U.redirect){const{redirect:N}=U;let Y=typeof N=="function"?N(P):N;return typeof Y=="string"&&(Y=Y.includes("?")||Y.includes("#")?Y=k(Y):{path:Y},Y.params={}),ve({query:P.query,hash:P.hash,params:"path"in Y?{}:P.params},Y)}}function $(P,U){const N=c=I(P),Y=l.value,ce=P.state,f=P.force,p=P.replace===!0,_=J(N);if(_)return $(ve(k(_),{state:typeof _=="object"?ve({},ce,_.state):ce,force:f,replace:p}),U||N);const T=N;T.redirectedFrom=U;let O;return!f&&Uu(r,Y,N)&&(O=pn(16,{to:T,from:Y}),Ue(Y,Y,!0,!1)),(O?Promise.resolve(O):C(T,Y)).catch(x=>ft(x)?ft(x,2)?x:Ve(x):K(x,T,Y)).then(x=>{if(x){if(ft(x,2))return $(ve({replace:p},k(x.to),{state:typeof x.to=="object"?ve({},ce,x.to.state):ce,force:f}),U||T)}else x=L(T,Y,!0,p,ce);return q(T,Y,x),x})}function g(P,U){const N=b(P,U);return N?Promise.reject(N):Promise.resolve()}function z(P){const U=Lt.values().next().value;return U&&typeof U.runWithContext=="function"?U.runWithContext(P):P()}function C(P,U){let N;const[Y,ce,f]=Bd(P,U);N=Jr(Y.reverse(),"beforeRouteLeave",P,U);for(const _ of Y)_.leaveGuards.forEach(T=>{N.push(kt(T,P,U))});const p=g.bind(null,P,U);return N.push(p),Se(N).then(()=>{N=[];for(const _ of i.list())N.push(kt(_,P,U));return N.push(p),Se(N)}).then(()=>{N=Jr(ce,"beforeRouteUpdate",P,U);for(const _ of ce)_.updateGuards.forEach(T=>{N.push(kt(T,P,U))});return N.push(p),Se(N)}).then(()=>{N=[];for(const _ of f)if(_.beforeEnter)if(it(_.beforeEnter))for(const T of _.beforeEnter)N.push(kt(T,P,U));else N.push(kt(_.beforeEnter,P,U));return N.push(p),Se(N)}).then(()=>(P.matched.forEach(_=>_.enterCallbacks={}),N=Jr(f,"beforeRouteEnter",P,U),N.push(p),Se(N))).then(()=>{N=[];for(const _ of s.list())N.push(kt(_,P,U));return N.push(p),Se(N)}).catch(_=>ft(_,8)?_:Promise.reject(_))}function q(P,U,N){a.list().forEach(Y=>z(()=>Y(P,U,N)))}function L(P,U,N,Y,ce){const f=b(P,U);if(f)return f;const p=U===mt,_=nn?history.state:{};N&&(Y||p?o.replace(P.fullPath,ve({scroll:p&&_&&_.scroll},ce)):o.push(P.fullPath,ce)),l.value=P,Ue(P,U,N,p),Ve()}let M;function re(){M||(M=o.listen((P,U,N)=>{if(!st.listening)return;const Y=I(P),ce=J(Y);if(ce){$(ve(ce,{replace:!0}),Y).catch(kn);return}c=Y;const f=l.value;nn&&Zu(Fi(f.fullPath,N.delta),Vr()),C(Y,f).catch(p=>ft(p,12)?p:ft(p,2)?($(p.to,Y).then(_=>{ft(_,20)&&!N.delta&&N.type===Mn.pop&&o.go(-1,!1)}).catch(kn),Promise.reject()):(N.delta&&o.go(-N.delta,!1),K(p,Y,f))).then(p=>{p=p||L(Y,f,!1),p&&(N.delta&&!ft(p,8)?o.go(-N.delta,!1):N.type===Mn.pop&&ft(p,20)&&o.go(-1,!1)),q(Y,f,p)}).catch(kn)}))}let le=Tn(),S=Tn(),Q;function K(P,U,N){Ve(P);const Y=S.list();return Y.length?Y.forEach(ce=>ce(P,U,N)):console.error(P),Promise.reject(P)}function De(){return Q&&l.value!==mt?Promise.resolve():new Promise((P,U)=>{le.add([P,U])})}function Ve(P){return Q||(Q=!P,re(),le.list().forEach(([U,N])=>P?N(P):U()),le.reset()),P}function Ue(P,U,N,Y){const{scrollBehavior:ce}=e;if(!nn||!ce)return Promise.resolve();const f=!N&&Xu(Fi(P.fullPath,0))||(Y||!N)&&history.state&&history.state.scroll||null;return Un().then(()=>ce(P,U,f)).then(p=>p&&Qu(p)).catch(p=>K(p,P,U))}const Ne=P=>o.go(P);let Tt;const Lt=new Set,st={currentRoute:l,listening:!0,addRoute:v,removeRoute:E,hasRoute:R,getRoutes:w,resolve:I,options:e,push:y,replace:B,go:Ne,back:()=>Ne(-1),forward:()=>Ne(1),beforeEach:i.add,beforeResolve:s.add,afterEach:a.add,onError:S.add,isReady:De,install(P){const U=this;P.component("RouterLink",Vd),P.component("RouterView",Cl),P.config.globalProperties.$router=U,Object.defineProperty(P.config.globalProperties,"$route",{enumerable:!0,get:()=>ne(l)}),nn&&!Tt&&l.value===mt&&(Tt=!0,y(o.location).catch(ce=>{}));const N={};for(const ce in mt)Object.defineProperty(N,ce,{get:()=>l.value[ce],enumerable:!0});P.provide(Mr,U),P.provide(Wo,xs(N)),P.provide(po,l);const Y=P.unmount;Lt.add(P),P.unmount=function(){Lt.delete(P),Lt.size<1&&(c=mt,M&&M(),M=null,l.value=mt,Tt=!1,Q=!1),Y()}}};function Se(P){return P.reduce((U,N)=>U.then(()=>z(N)),Promise.resolve())}return st}function Bd(e,t){const n=[],r=[],o=[],i=Math.max(t.matched.length,e.matched.length);for(let s=0;smn(c,a))?r.push(a):n.push(a));const l=e.matched[s];l&&(t.matched.find(c=>mn(c,l))||o.push(l))}return[n,r,o]}function Qt(){return Pe(Mr)}function Zt(){return Pe(Wo)}const Fd=({headerLinkSelector:e,headerAnchorSelector:t,delay:n,offset:r=5})=>{const o=Qt(),s=Uo(()=>{var w,R;const a=Math.max(window.scrollY,document.documentElement.scrollTop,document.body.scrollTop);if(Math.abs(a-0) h.some(k=>k.hash===I.hash));for(let I=0;I =(((w=k.parentElement)==null?void 0:w.offsetTop)??0)-r,B=!b||a<(((R=b.parentElement)==null?void 0:R.offsetTop)??0)-r;if(!(y&&B))continue;const $=decodeURIComponent(o.currentRoute.value.hash),g=decodeURIComponent(k.hash);if($===g)return;if(d){for(let z=I+1;z {window.addEventListener("scroll",s)}),Cr(()=>{window.removeEventListener("scroll",s)})},ns=async(e,t)=>{const{scrollBehavior:n}=e.options;e.options.scrollBehavior=void 0,await e.replace({query:e.currentRoute.value.query,hash:t}).finally(()=>e.options.scrollBehavior=n)},jd="a.sidebar-item",Ud=".header-anchor",Kd=300,Wd=5,qd=yt({setup(){Fd({headerLinkSelector:jd,headerAnchorSelector:Ud,delay:Kd,offset:Wd})}}),rs=()=>window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,Gd=()=>window.scrollTo({top:0,behavior:"smooth"}),Yd=ue({name:"BackToTop",setup(){const e=Te(0),t=W(()=>e.value>300),n=Uo(()=>{e.value=rs()},100);je(()=>{e.value=rs(),window.addEventListener("scroll",()=>n())});const r=_e("div",{class:"back-to-top",onClick:Gd});return()=>_e(Wn,{name:"back-to-top"},()=>t.value?r:null)}}),Jd=yt({rootComponents:[Yd]}),Qd=_e("svg",{class:"external-link-icon",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"},[_e("path",{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}),_e("polygon",{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"})]),Zd=ue({name:"ExternalLinkIcon",props:{locales:{type:Object,required:!1,default:()=>({})}},setup(e){const t=Gn(),n=W(()=>e.locales[t.value]??{openInNewWindow:"open in new window"});return()=>_e("span",[Qd,_e("span",{class:"external-link-icon-sr-only"},n.value.openInNewWindow)])}});var Xd={"/":{openInNewWindow:"open in new window"},"/zh/":{openInNewWindow:"在新窗口打开"}};const ef=Xd,tf=yt({enhance({app:e}){e.component("ExternalLinkIcon",_e(Zd,{locales:ef}))}});/*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */var Ht=Object.assign||function(e){for(var t=1;t 1&&arguments[1]!==void 0?arguments[1]:{},r=window.Promise||function(L){function M(){}L(M,M)},o=function(L){var M=L.target;if(M===z){E();return}b.indexOf(M)!==-1&&w({target:M})},i=function(){if(!(B||!g.original)){var L=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(J-L)>$.scrollOffset&&setTimeout(E,150)}},s=function(L){var M=L.key||L.keyCode;(M==="Escape"||M==="Esc"||M===27)&&E()},a=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=L;if(L.background&&(z.style.background=L.background),L.container&&L.container instanceof Object&&(M.container=Ht({},$.container,L.container)),L.template){var re=ur(L.template)?L.template:document.querySelector(L.template);M.template=re}return $=Ht({},$,M),b.forEach(function(le){le.dispatchEvent(tn("medium-zoom:update",{detail:{zoom:C}}))}),C},l=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e(Ht({},$,L))},c=function(){for(var L=arguments.length,M=Array(L),re=0;re 0?M.reduce(function(S,Q){return[].concat(S,is(Q))},[]):b;return le.forEach(function(S){S.classList.remove("medium-zoom-image"),S.dispatchEvent(tn("medium-zoom:detach",{detail:{zoom:C}}))}),b=b.filter(function(S){return le.indexOf(S)===-1}),C},d=function(L,M){var re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return b.forEach(function(le){le.addEventListener("medium-zoom:"+L,M,re)}),y.push({type:"medium-zoom:"+L,listener:M,options:re}),C},h=function(L,M){var re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return b.forEach(function(le){le.removeEventListener("medium-zoom:"+L,M,re)}),y=y.filter(function(le){return!(le.type==="medium-zoom:"+L&&le.listener.toString()===M.toString())}),C},v=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=L.target,re=function(){var S={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},Q=void 0,K=void 0;if($.container)if($.container instanceof Object)S=Ht({},S,$.container),Q=S.width-S.left-S.right-$.margin*2,K=S.height-S.top-S.bottom-$.margin*2;else{var De=ur($.container)?$.container:document.querySelector($.container),Ve=De.getBoundingClientRect(),Ue=Ve.width,Ne=Ve.height,Tt=Ve.left,Lt=Ve.top;S=Ht({},S,{width:Ue,height:Ne,left:Tt,top:Lt})}Q=Q||S.width-$.margin*2,K=K||S.height-$.margin*2;var st=g.zoomedHd||g.original,Se=os(st)?Q:st.naturalWidth||Q,P=os(st)?K:st.naturalHeight||K,U=st.getBoundingClientRect(),N=U.top,Y=U.left,ce=U.width,f=U.height,p=Math.min(Math.max(ce,Se),Q)/ce,_=Math.min(Math.max(f,P),K)/f,T=Math.min(p,_),O=(-Y+(Q-ce)/2+$.margin+S.left)/T,x=(-N+(K-f)/2+$.margin+S.top)/T,F="scale("+T+") translate3d("+O+"px, "+x+"px, 0)";g.zoomed.style.transform=F,g.zoomedHd&&(g.zoomedHd.style.transform=F)};return new r(function(le){if(M&&b.indexOf(M)===-1){le(C);return}var S=function Ue(){B=!1,g.zoomed.removeEventListener("transitionend",Ue),g.original.dispatchEvent(tn("medium-zoom:opened",{detail:{zoom:C}})),le(C)};if(g.zoomed){le(C);return}if(M)g.original=M;else if(b.length>0){var Q=b;g.original=Q[0]}else{le(C);return}if(g.original.dispatchEvent(tn("medium-zoom:open",{detail:{zoom:C}})),J=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,B=!0,g.zoomed=of(g.original),document.body.appendChild(z),$.template){var K=ur($.template)?$.template:document.querySelector($.template);g.template=document.createElement("div"),g.template.appendChild(K.content.cloneNode(!0)),document.body.appendChild(g.template)}if(g.original.parentElement&&g.original.parentElement.tagName==="PICTURE"&&g.original.currentSrc&&(g.zoomed.src=g.original.currentSrc),document.body.appendChild(g.zoomed),window.requestAnimationFrame(function(){document.body.classList.add("medium-zoom--opened")}),g.original.classList.add("medium-zoom-image--hidden"),g.zoomed.classList.add("medium-zoom-image--opened"),g.zoomed.addEventListener("click",E),g.zoomed.addEventListener("transitionend",S),g.original.getAttribute("data-zoom-src")){g.zoomedHd=g.zoomed.cloneNode(),g.zoomedHd.removeAttribute("srcset"),g.zoomedHd.removeAttribute("sizes"),g.zoomedHd.removeAttribute("loading"),g.zoomedHd.src=g.zoomed.getAttribute("data-zoom-src"),g.zoomedHd.onerror=function(){clearInterval(De),console.warn("Unable to reach the zoom image target "+g.zoomedHd.src),g.zoomedHd=null,re()};var De=setInterval(function(){g.zoomedHd.complete&&(clearInterval(De),g.zoomedHd.classList.add("medium-zoom-image--opened"),g.zoomedHd.addEventListener("click",E),document.body.appendChild(g.zoomedHd),re())},10)}else if(g.original.hasAttribute("srcset")){g.zoomedHd=g.zoomed.cloneNode(),g.zoomedHd.removeAttribute("sizes"),g.zoomedHd.removeAttribute("loading");var Ve=g.zoomedHd.addEventListener("load",function(){g.zoomedHd.removeEventListener("load",Ve),g.zoomedHd.classList.add("medium-zoom-image--opened"),g.zoomedHd.addEventListener("click",E),document.body.appendChild(g.zoomedHd),re()})}else re()})},E=function(){return new r(function(L){if(B||!g.original){L(C);return}var M=function re(){g.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(g.zoomed),g.zoomedHd&&document.body.removeChild(g.zoomedHd),document.body.removeChild(z),g.zoomed.classList.remove("medium-zoom-image--opened"),g.template&&document.body.removeChild(g.template),B=!1,g.zoomed.removeEventListener("transitionend",re),g.original.dispatchEvent(tn("medium-zoom:closed",{detail:{zoom:C}})),g.original=null,g.zoomed=null,g.zoomedHd=null,g.template=null,L(C)};B=!0,document.body.classList.remove("medium-zoom--opened"),g.zoomed.style.transform="",g.zoomedHd&&(g.zoomedHd.style.transform=""),g.template&&(g.template.style.transition="opacity 150ms",g.template.style.opacity=0),g.original.dispatchEvent(tn("medium-zoom:close",{detail:{zoom:C}})),g.zoomed.addEventListener("transitionend",M)})},w=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=L.target;return g.original?E():v({target:M})},R=function(){return $},I=function(){return b},k=function(){return g.original},b=[],y=[],B=!1,J=0,$=n,g={original:null,zoomed:null,zoomedHd:null,template:null};Object.prototype.toString.call(t)==="[object Object]"?$=t:(t||typeof t=="string")&&c(t),$=Ht({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},$);var z=rf($.background);document.addEventListener("click",o),document.addEventListener("keyup",s),document.addEventListener("scroll",i),window.addEventListener("resize",E);var C={open:v,close:E,toggle:w,update:a,clone:l,attach:c,detach:u,on:d,off:h,getOptions:R,getImages:I,getZoomedImage:k};return C};function lf(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var af=".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";lf(af);const cf=sf,uf=Symbol("mediumZoom");var df={};const ff=".theme-default-content > img, .theme-default-content :not(a) > img",hf=df,mf=300,pf=yt({enhance({app:e,router:t}){const n=cf(hf);n.refresh=(r=ff)=>{n.detach(),n.attach(r)},e.provide(uf,n),t.afterEach(()=>{setTimeout(()=>n.refresh(),mf)})}});/** + * NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress + * @license MIT + */const de={settings:{minimum:.08,easing:"ease",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,barSelector:'[role="bar"]',parent:"body",template:''},status:null,set:e=>{const t=de.isStarted();e=Qr(e,de.settings.minimum,1),de.status=e===1?null:e;const n=de.render(!t),r=n.querySelector(de.settings.barSelector),o=de.settings.speed,i=de.settings.easing;return n.offsetWidth,vf(s=>{ir(r,{transform:"translate3d("+ss(e)+"%,0,0)",transition:"all "+o+"ms "+i}),e===1?(ir(n,{transition:"none",opacity:"1"}),n.offsetWidth,setTimeout(function(){ir(n,{transition:"all "+o+"ms linear",opacity:"0"}),setTimeout(function(){de.remove(),s()},o)},o)):setTimeout(()=>s(),o)}),de},isStarted:()=>typeof de.status=="number",start:()=>{de.status||de.set(0);const e=()=>{setTimeout(()=>{de.status&&(de.trickle(),e())},de.settings.trickleSpeed)};return de.settings.trickle&&e(),de},done:e=>!e&&!de.status?de:de.inc(.3+.5*Math.random()).set(1),inc:e=>{let t=de.status;return t?(typeof e!="number"&&(e=(1-t)*Qr(Math.random()*t,.1,.95)),t=Qr(t+e,0,.994),de.set(t)):de.start()},trickle:()=>de.inc(Math.random()*de.settings.trickleRate),render:e=>{if(de.isRendered())return document.getElementById("nprogress");ls(document.documentElement,"nprogress-busy");const t=document.createElement("div");t.id="nprogress",t.innerHTML=de.settings.template;const n=t.querySelector(de.settings.barSelector),r=e?"-100":ss(de.status||0),o=document.querySelector(de.settings.parent);return ir(n,{transition:"all 0 linear",transform:"translate3d("+r+"%,0,0)"}),o!==document.body&&ls(o,"nprogress-custom-parent"),o==null||o.appendChild(t),t},remove:()=>{as(document.documentElement,"nprogress-busy"),as(document.querySelector(de.settings.parent),"nprogress-custom-parent");const e=document.getElementById("nprogress");e&&_f(e)},isRendered:()=>!!document.getElementById("nprogress")},Qr=(e,t,n)=>e n?n:e,ss=e=>(-1+e)*100,vf=function(){const e=[];function t(){const n=e.shift();n&&n(t)}return function(n){e.push(n),e.length===1&&t()}}(),ir=function(){const e=["Webkit","O","Moz","ms"],t={};function n(s){return s.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(a,l){return l.toUpperCase()})}function r(s){const a=document.body.style;if(s in a)return s;let l=e.length;const c=s.charAt(0).toUpperCase()+s.slice(1);let u;for(;l--;)if(u=e[l]+c,u in a)return u;return s}function o(s){return s=n(s),t[s]??(t[s]=r(s))}function i(s,a,l){a=o(a),s.style[a]=l}return function(s,a){for(const l in a){const c=a[l];c!==void 0&&Object.prototype.hasOwnProperty.call(a,l)&&i(s,l,c)}}}(),Dl=(e,t)=>(typeof e=="string"?e:qo(e)).indexOf(" "+t+" ")>=0,ls=(e,t)=>{const n=qo(e),r=n+t;Dl(n,t)||(e.className=r.substring(1))},as=(e,t)=>{const n=qo(e);if(!Dl(e,t))return;const r=n.replace(" "+t+" "," ");e.className=r.substring(1,r.length-1)},qo=e=>(" "+(e.className||"")+" ").replace(/\s+/gi," "),_f=e=>{e&&e.parentNode&&e.parentNode.removeChild(e)},gf=()=>{je(()=>{const e=Qt(),t=new Set;t.add(e.currentRoute.value.path),e.beforeEach(n=>{t.has(n.path)||de.start()}),e.afterEach(n=>{t.add(n.path),de.done()})})},bf=yt({setup(){gf()}}),Ef=JSON.parse(`{"logo":"/images/hero.png","repo":"vuepress/vuepress-next","docsDir":"docs","locales":{"/":{"navbar":[{"text":"Guide","link":"/guide/"},{"text":"Reference","children":[{"text":"VuePress","children":[{"text":"CLI","link":"/reference/cli.html"},"/reference/config.md","/reference/frontmatter.md","/reference/components.md","/reference/plugin-api.md","/reference/theme-api.md","/reference/client-api.md","/reference/node-api.md"]},{"text":"Bundlers","children":["/reference/bundler/vite.md","/reference/bundler/webpack.md"]},{"text":"Default Theme","children":["/reference/default-theme/config.md","/reference/default-theme/frontmatter.md","/reference/default-theme/components.md","/reference/default-theme/markdown.md","/reference/default-theme/styles.md","/reference/default-theme/extending.md"]}]},{"text":"Plugins","children":[{"text":"Common Features","children":["/reference/plugin/back-to-top.md","/reference/plugin/container.md","/reference/plugin/external-link-icon.md","/reference/plugin/google-analytics.md","/reference/plugin/medium-zoom.md","/reference/plugin/nprogress.md","/reference/plugin/register-components.md"]},{"text":"Content Search","children":["/reference/plugin/docsearch.md","/reference/plugin/search.md"]},{"text":"PWA","children":["/reference/plugin/pwa.md","/reference/plugin/pwa-popup.md"]},{"text":"Syntax Highlighting","children":["/reference/plugin/prismjs.md","/reference/plugin/shiki.md"]},{"text":"Theme Development","children":["/reference/plugin/active-header-links.md","/reference/plugin/git.md","/reference/plugin/palette.md","/reference/plugin/theme-data.md","/reference/plugin/toc.md"]}]},{"text":"Learn More","children":[{"text":"Advanced","children":["/advanced/architecture.md","/advanced/plugin.md","/advanced/theme.md",{"text":"Cookbook","link":"/advanced/cookbook/"}]},{"text":"Resources","children":[{"text":"Contributing Guide","link":"https://github.com/vuepress/vuepress-next/blob/main/CONTRIBUTING.md"},{"text":"Awesome VuePress","link":"https://github.com/vuepress/awesome-vuepress"}]}]},{"text":"v2.0.0-rc.0","children":[{"text":"Changelog","link":"https://github.com/vuepress/vuepress-next/blob/main/CHANGELOG.md"},{"text":"v1.x","link":"https://v1.vuepress.vuejs.org"},{"text":"v0.x","link":"https://v0.vuepress.vuejs.org"}]}],"sidebar":{"/guide/":[{"text":"Guide","children":["/guide/README.md","/guide/getting-started.md","/guide/configuration.md","/guide/page.md","/guide/markdown.md","/guide/assets.md","/guide/i18n.md","/guide/deployment.md","/guide/theme.md","/guide/plugin.md","/guide/bundler.md","/guide/migration.md"]}],"/advanced/":[{"text":"Advanced","children":["/advanced/architecture.md","/advanced/plugin.md","/advanced/theme.md"]},{"text":"Cookbook","children":["/advanced/cookbook/README.md","/advanced/cookbook/usage-of-client-config.md","/advanced/cookbook/adding-extra-pages.md","/advanced/cookbook/making-a-theme-extendable.md","/advanced/cookbook/passing-data-to-client-code.md","/advanced/cookbook/markdown-and-vue-sfc.md"]}],"/reference/":[{"text":"VuePress Reference","collapsible":true,"children":["/reference/cli.md","/reference/config.md","/reference/frontmatter.md","/reference/components.md","/reference/plugin-api.md","/reference/theme-api.md","/reference/client-api.md","/reference/node-api.md"]},{"text":"Bundlers Reference","collapsible":true,"children":["/reference/bundler/vite.md","/reference/bundler/webpack.md"]},{"text":"Default Theme Reference","collapsible":true,"children":["/reference/default-theme/config.md","/reference/default-theme/frontmatter.md","/reference/default-theme/components.md","/reference/default-theme/markdown.md","/reference/default-theme/styles.md","/reference/default-theme/extending.md"]},{"text":"Official Plugins Reference","collapsible":true,"children":[{"text":"Common Features","children":["/reference/plugin/back-to-top.md","/reference/plugin/container.md","/reference/plugin/external-link-icon.md","/reference/plugin/google-analytics.md","/reference/plugin/medium-zoom.md","/reference/plugin/nprogress.md","/reference/plugin/register-components.md"]},{"text":"Content Search","children":["/reference/plugin/docsearch.md","/reference/plugin/search.md"]},{"text":"PWA","children":["/reference/plugin/pwa.md","/reference/plugin/pwa-popup.md"]},{"text":"Syntax Highlighting","children":["/reference/plugin/prismjs.md","/reference/plugin/shiki.md"]},{"text":"Theme Development","children":["/reference/plugin/active-header-links.md","/reference/plugin/git.md","/reference/plugin/palette.md","/reference/plugin/theme-data.md","/reference/plugin/toc.md"]}]}]},"editLinkText":"Edit this page on GitHub","selectLanguageName":"English"},"/zh/":{"navbar":[{"text":"指南","link":"/zh/guide/"},{"text":"参考","children":[{"text":"VuePress","children":["/zh/reference/cli.md","/zh/reference/config.md","/zh/reference/frontmatter.md","/zh/reference/components.md","/zh/reference/plugin-api.md","/zh/reference/theme-api.md","/zh/reference/client-api.md","/zh/reference/node-api.md"]},{"text":"打包工具","children":["/zh/reference/bundler/vite.md","/zh/reference/bundler/webpack.md"]},{"text":"默认主题","children":["/zh/reference/default-theme/config.md","/zh/reference/default-theme/frontmatter.md","/zh/reference/default-theme/components.md","/zh/reference/default-theme/markdown.md","/zh/reference/default-theme/styles.md","/zh/reference/default-theme/extending.md"]}]},{"text":"插件","children":[{"text":"常用功能","children":["/zh/reference/plugin/back-to-top.md","/zh/reference/plugin/container.md","/zh/reference/plugin/external-link-icon.md","/zh/reference/plugin/google-analytics.md","/zh/reference/plugin/medium-zoom.md","/zh/reference/plugin/nprogress.md","/zh/reference/plugin/register-components.md"]},{"text":"内容搜索","children":["/zh/reference/plugin/docsearch.md","/zh/reference/plugin/search.md"]},{"text":"PWA","children":["/zh/reference/plugin/pwa.md","/zh/reference/plugin/pwa-popup.md"]},{"text":"语法高亮","children":["/zh/reference/plugin/prismjs.md","/zh/reference/plugin/shiki.md"]},{"text":"主题开发","children":["/zh/reference/plugin/active-header-links.md","/zh/reference/plugin/git.md","/zh/reference/plugin/palette.md","/zh/reference/plugin/theme-data.md","/zh/reference/plugin/toc.md"]}]},{"text":"了解更多","children":[{"text":"深入","children":["/zh/advanced/architecture.md","/zh/advanced/plugin.md","/zh/advanced/theme.md",{"text":"Cookbook","link":"/zh/advanced/cookbook/"}]},{"text":"其他资源","children":[{"text":"贡献指南","link":"https://github.com/vuepress/vuepress-next/blob/main/CONTRIBUTING_zh.md"},{"text":"Awesome VuePress","link":"https://github.com/vuepress/awesome-vuepress"}]}]},{"text":"v2.0.0-rc.0","children":[{"text":"更新日志","link":"https://github.com/vuepress/vuepress-next/blob/main/CHANGELOG.md"},{"text":"v1.x","link":"https://v1.vuepress.vuejs.org/zh/"},{"text":"v0.x","link":"https://v0.vuepress.vuejs.org/zh/"}]}],"selectLanguageName":"简体中文","selectLanguageText":"选择语言","selectLanguageAriaLabel":"选择语言","sidebar":{"/zh/guide/":[{"text":"指南","children":["/zh/guide/README.md","/zh/guide/getting-started.md","/zh/guide/configuration.md","/zh/guide/page.md","/zh/guide/markdown.md","/zh/guide/assets.md","/zh/guide/i18n.md","/zh/guide/deployment.md","/zh/guide/theme.md","/zh/guide/plugin.md","/zh/guide/bundler.md","/zh/guide/migration.md"]}],"/zh/advanced/":[{"text":"深入","children":["/zh/advanced/architecture.md","/zh/advanced/plugin.md","/zh/advanced/theme.md"]},{"text":"Cookbook","children":["/zh/advanced/cookbook/README.md","/zh/advanced/cookbook/usage-of-client-config.md","/zh/advanced/cookbook/adding-extra-pages.md","/zh/advanced/cookbook/making-a-theme-extendable.md","/zh/advanced/cookbook/passing-data-to-client-code.md","/zh/advanced/cookbook/markdown-and-vue-sfc.md"]}],"/zh/reference/":[{"text":"VuePress 参考","collapsible":true,"children":["/zh/reference/cli.md","/zh/reference/config.md","/zh/reference/frontmatter.md","/zh/reference/components.md","/zh/reference/plugin-api.md","/zh/reference/theme-api.md","/zh/reference/client-api.md","/zh/reference/node-api.md"]},{"text":"打包工具参考","collapsible":true,"children":["/zh/reference/bundler/vite.md","/zh/reference/bundler/webpack.md"]},{"text":"默认主题参考","collapsible":true,"children":["/zh/reference/default-theme/config.md","/zh/reference/default-theme/frontmatter.md","/zh/reference/default-theme/components.md","/zh/reference/default-theme/markdown.md","/zh/reference/default-theme/styles.md","/zh/reference/default-theme/extending.md"]},{"text":"官方插件参考","collapsible":true,"children":[{"text":"常用功能","children":["/zh/reference/plugin/back-to-top.md","/zh/reference/plugin/container.md","/zh/reference/plugin/external-link-icon.md","/zh/reference/plugin/google-analytics.md","/zh/reference/plugin/medium-zoom.md","/zh/reference/plugin/nprogress.md","/zh/reference/plugin/register-components.md"]},{"text":"内容搜索","children":["/zh/reference/plugin/docsearch.md","/zh/reference/plugin/search.md"]},{"text":"PWA","children":["/zh/reference/plugin/pwa.md","/zh/reference/plugin/pwa-popup.md"]},{"text":"语法高亮","children":["/zh/reference/plugin/prismjs.md","/zh/reference/plugin/shiki.md"]},{"text":"主题开发","children":["/zh/reference/plugin/active-header-links.md","/zh/reference/plugin/git.md","/zh/reference/plugin/palette.md","/zh/reference/plugin/theme-data.md","/zh/reference/plugin/toc.md"]}]}]},"editLinkText":"在 GitHub 上编辑此页","lastUpdatedText":"上次更新","contributorsText":"贡献者","tip":"提示","warning":"注意","danger":"警告","notFound":["这里什么都没有","我们怎么到这来了?","这是一个 404 页面","看起来我们进入了错误的链接"],"backToHome":"返回首页","openInNewWindow":"在新窗口打开","toggleColorMode":"切换颜色模式","toggleSidebar":"切换侧边栏"}},"colorMode":"auto","colorModeSwitch":true,"navbar":[],"selectLanguageText":"Languages","selectLanguageAriaLabel":"Select language","sidebar":"auto","sidebarDepth":2,"editLink":true,"editLinkText":"Edit this page","lastUpdated":true,"lastUpdatedText":"Last Updated","contributors":true,"contributorsText":"Contributors","notFound":["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],"backToHome":"Take me home","openInNewWindow":"open in new window","toggleColorMode":"toggle color mode","toggleSidebar":"toggle sidebar"}`),yf=Te(Ef),Sl=()=>yf,zl=Symbol(""),Tf=()=>{const e=Pe(zl);if(!e)throw new Error("useThemeLocaleData() is called without provider.");return e},Lf=(e,t)=>{const{locales:n,...r}=e;return{...r,...n==null?void 0:n[t]}},wf=yt({enhance({app:e}){const t=Sl(),n=e._context.provides[Ho],r=W(()=>Lf(t.value,n.value));e.provide(zl,r),Object.defineProperties(e.config.globalProperties,{$theme:{get(){return t.value}},$themeLocale:{get(){return r.value}}})}}),Af=ue({__name:"Badge",props:{type:{type:String,required:!1,default:"tip"},text:{type:String,required:!1,default:""},vertical:{type:String,required:!1,default:void 0}},setup(e){return(t,n)=>(j(),te("span",{class:We(["badge",e.type]),style:Hn({verticalAlign:e.vertical})},[Ee(t.$slots,"default",{},()=>[Vt(xe(e.text),1)])],6))}}),Ae=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},Pf=Ae(Af,[["__file","Badge.vue"]]);function cs(e,t){var n;const r=Io();return js(()=>{r.value=e()},{...t,flush:(n=t==null?void 0:t.flush)!=null?n:"sync"}),Fn(r)}function Rf(e,t){let n,r,o;const i=Te(!0),s=()=>{i.value=!0,o()};qe(e,s,{flush:"sync"});const a=typeof t=="function"?t:t.get,l=typeof t=="function"?void 0:t.set,c=Ma((u,d)=>(r=u,o=d,{get(){return i.value&&(n=a(),i.value=!1),r(),n},set(h){l==null||l(h)}}));return Object.isExtensible(c)&&(c.trigger=s),c}function Vl(e){return Es()?(fa(e),!0):!1}function vn(e){return typeof e=="function"?e():ne(e)}const Of=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const If=Object.prototype.toString,kf=e=>If.call(e)==="[object Object]",xf=()=>{};function Cf(e,t){function n(...r){return new Promise((o,i)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(o).catch(i)})}return n}const Ml=e=>e();function Df(e=Ml){const t=Te(!0);function n(){t.value=!1}function r(){t.value=!0}const o=(...i)=>{t.value&&e(...i)};return{isActive:Fn(t),pause:n,resume:r,eventFilter:o}}function Sf(e,t,n={}){const{eventFilter:r=Ml,...o}=n;return qe(e,Cf(r,t),o)}function zf(e,t,n={}){const{eventFilter:r,...o}=n,{eventFilter:i,pause:s,resume:a,isActive:l}=Df(r);return{stop:Sf(e,t,{...o,eventFilter:i}),pause:s,resume:a,isActive:l}}function Vf(e,t=!0){Vo()?je(e):t?e():Un(e)}function Mf(e=!1,t={}){const{truthyValue:n=!0,falsyValue:r=!1}=t,o=ze(e),i=Te(e);function s(a){if(arguments.length)return i.value=a,i.value;{const l=vn(n);return i.value=i.value===l?vn(r):l,i.value}}return o?s:[i,s]}function $f(e){var t;const n=vn(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Lr=Of?window:void 0;function vo(...e){let t,n,r,o;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,o]=e,t=Lr):[t,n,r,o]=e,!t)return xf;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const i=[],s=()=>{i.forEach(u=>u()),i.length=0},a=(u,d,h,v)=>(u.addEventListener(d,h,v),()=>u.removeEventListener(d,h,v)),l=qe(()=>[$f(t),vn(o)],([u,d])=>{if(s(),!u)return;const h=kf(d)?{...d}:d;i.push(...n.flatMap(v=>r.map(E=>a(u,v,E,h))))},{immediate:!0,flush:"post"}),c=()=>{l(),s()};return Vl(c),c}function Nf(){const e=Te(!1);return Vo()&&je(()=>{e.value=!0}),e}function Hf(e){const t=Nf();return W(()=>(t.value,!!e()))}function Bf(e,t={}){const{window:n=Lr}=t,r=Hf(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let o;const i=Te(!1),s=c=>{i.value=c.matches},a=()=>{o&&("removeEventListener"in o?o.removeEventListener("change",s):o.removeListener(s))},l=js(()=>{r.value&&(a(),o=n.matchMedia(vn(e)),"addEventListener"in o?o.addEventListener("change",s):o.addListener(s),i.value=o.matches)});return Vl(()=>{l(),a(),o=void 0}),i}const sr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},lr="__vueuse_ssr_handlers__",Ff=jf();function jf(){return lr in sr||(sr[lr]=sr[lr]||{}),sr[lr]}function Uf(e,t){return Ff[e]||t}function Kf(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Wf={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},us="vueuse-storage";function $l(e,t,n,r={}){var o;const{flush:i="pre",deep:s=!0,listenToStorageChanges:a=!0,writeDefaults:l=!0,mergeDefaults:c=!1,shallow:u,window:d=Lr,eventFilter:h,onError:v=z=>{console.error(z)},initOnMounted:E}=r,w=(u?Io:Te)(typeof t=="function"?t():t);if(!n)try{n=Uf("getDefaultStorage",()=>{var z;return(z=Lr)==null?void 0:z.localStorage})()}catch(z){v(z)}if(!n)return w;const R=vn(t),I=Kf(R),k=(o=r.serializer)!=null?o:Wf[I],{pause:b,resume:y}=zf(w,()=>B(w.value),{flush:i,deep:s,eventFilter:h});return d&&a&&Vf(()=>{vo(d,"storage",g),vo(d,us,$),E&&g()}),E||g(),w;function B(z){try{if(z==null)n.removeItem(e);else{const C=k.write(z),q=n.getItem(e);q!==C&&(n.setItem(e,C),d&&d.dispatchEvent(new CustomEvent(us,{detail:{key:e,oldValue:q,newValue:C,storageArea:n}})))}}catch(C){v(C)}}function J(z){const C=z?z.newValue:n.getItem(e);if(C==null)return l&&R!==null&&n.setItem(e,k.write(R)),R;if(!z&&c){const q=k.read(C);return typeof c=="function"?c(q,R):I==="object"&&!Array.isArray(q)?{...R,...q}:q}else return typeof C!="string"?C:k.read(C)}function $(z){g(z.detail)}function g(z){if(!(z&&z.storageArea!==n)){if(z&&z.key==null){w.value=R;return}if(!(z&&z.key!==e)){b();try{(z==null?void 0:z.newValue)!==k.write(w.value)&&(w.value=J(z))}catch(C){v(C)}finally{z?Un(y):y()}}}}}function qf(e){return Bf("(prefers-color-scheme: dark)",e)}const Gf=ue({name:"CodeGroup",slots:Object,setup(e,{slots:t}){const n=Te([]),r=Te(-1),o=$l("vuepress-code-group",{}),i=W(()=>n.value.map(c=>c.innerText).join(","));je(()=>{qe(()=>o.value[i.value],(c=-1)=>{r.value!==c&&(r.value=c)},{immediate:!0}),qe(r,c=>{o.value[i.value]!==c&&(o.value[i.value]=c)})});const s=(c=r.value)=>{c {c>0?r.value=c-1:r.value=n.value.length-1,n.value[r.value].focus()},l=(c,u)=>{c.key===" "||c.key==="Enter"?(c.preventDefault(),r.value=u):c.key==="ArrowRight"?(c.preventDefault(),s(u)):c.key==="ArrowLeft"&&(c.preventDefault(),a(u))};return()=>{var u;const c=(((u=t.default)==null?void 0:u.call(t))||[]).filter(d=>d.type.name==="CodeGroupItem").map(d=>(d.props===null&&(d.props={}),d));return c.length===0?null:(r.value<0||r.value>c.length-1?(r.value=c.findIndex(d=>d.props.active===""||d.props.active===!0),r.value===-1&&(r.value=0)):c.forEach((d,h)=>{d.props.active=h===r.value}),_e("div",{class:"code-group"},[_e("div",{class:"code-group__nav"},_e("ul",{class:"code-group__ul"},c.map((d,h)=>{const v=h===r.value;return _e("li",{class:"code-group__li"},_e("button",{ref:E=>{E&&(n.value[h]=E)},class:{"code-group__nav-tab":!0,"code-group__nav-tab-active":v},ariaPressed:v,ariaExpanded:v,onClick:()=>r.value=h,onKeydown:E=>l(E,h)},d.props.title))}))),c]))}}}),Yf=["aria-selected"],Jf=ue({name:"CodeGroupItem"}),Qf=ue({...Jf,props:{title:{type:String,required:!0},active:{type:Boolean,required:!1,default:!1}},setup(e){return(t,n)=>(j(),te("div",{class:We(["code-group-item",{"code-group-item__active":e.active}]),"aria-selected":e.active},[Ee(t.$slots,"default")],10,Yf))}}),Zf=Ae(Qf,[["__file","CodeGroupItem.vue"]]),Xf=()=>Sl(),Fe=()=>Tf(),Nl=Symbol(""),Go=()=>{const e=Pe(Nl);if(!e)throw new Error("useDarkMode() is called without provider.");return e},eh=()=>{const e=Fe(),t=qf(),n=$l("vuepress-color-scheme",e.value.colorMode),r=W({get(){return e.value.colorModeSwitch?n.value==="auto"?t.value:n.value==="dark":e.value.colorMode==="dark"},set(o){o===t.value?n.value="auto":n.value=o?"dark":"light"}});Wt(Nl,r),th(r)},th=e=>{const t=(n=e.value)=>{const r=window==null?void 0:window.document.querySelector("html");r==null||r.classList.toggle("dark",n)};je(()=>{qe(e,t,{immediate:!0})}),Dr(()=>t())},Hl=(...e)=>{const n=Qt().resolve(...e),r=n.matched[n.matched.length-1];if(!(r!=null&&r.redirect))return n;const{redirect:o}=r,i=se(o)?o(n):o,s=pe(i)?{path:i}:i;return Hl({hash:n.hash,query:n.query,params:n.params,...s})},Yo=e=>{const t=Hl(encodeURI(e));return{text:t.meta.title||e,link:t.name==="404"?e:t.fullPath}};let Zr=null,Ln=null;const nh={wait:()=>Zr,pending:()=>{Zr=new Promise(e=>Ln=e)},resolve:()=>{Ln==null||Ln(),Zr=null,Ln=null}},Bl=()=>nh,Fl=Symbol("sidebarItems"),Jo=()=>{const e=Pe(Fl);if(!e)throw new Error("useSidebarItems() is called without provider.");return e},rh=()=>{const e=Fe(),t=_t(),n=W(()=>oh(t.value,e.value));Wt(Fl,n)},oh=(e,t)=>{const n=e.sidebar??t.sidebar??"auto",r=e.sidebarDepth??t.sidebarDepth??2;return e.home||n===!1?[]:n==="auto"?sh(r):Z(n)?jl(n,r):No(n)?lh(n,r):[]},ih=(e,t)=>({text:e.title,link:e.link,children:Qo(e.children,t)}),Qo=(e,t)=>t>0?e.map(n=>ih(n,t-1)):[],sh=e=>{const t=Gt();return[{text:t.value.title,children:Qo(t.value.headers,e)}]},jl=(e,t)=>{const n=Zt(),r=Gt(),o=i=>{var a;let s;if(pe(i)?s=Yo(i):s=i,s.children)return{...s,children:s.children.map(l=>o(l))};if(s.link===n.path){const l=((a=r.value.headers[0])==null?void 0:a.level)===1?r.value.headers[0].children:r.value.headers;return{...s,children:Qo(l,t)}}return s};return e.map(i=>o(i))},lh=(e,t)=>{const n=Zt(),r=fl(e,n.path),o=e[r]??[];return jl(o,t)},ah="719px",ch={mobile:ah};var $n;(function(e){e.MOBILE="mobile"})($n||($n={}));var hs;const uh={[$n.MOBILE]:Number.parseInt((hs=ch.mobile)==null?void 0:hs.replace("px",""),10)},Ul=(e,t)=>{const n=uh[e];Number.isInteger(n)&&je(()=>{t(n),window.addEventListener("resize",()=>t(n),!1),window.addEventListener("orientationchange",()=>t(n),!1)})},dh={},fh={class:"theme-default-content"};function hh(e,t){const n=bt("Content");return j(),te("div",fh,[oe(n)])}const mh=Ae(dh,[["render",hh],["__file","HomeContent.vue"]]),ph={key:0,class:"features"},vh=ue({__name:"HomeFeatures",setup(e){const t=_t(),n=W(()=>Z(t.value.features)?t.value.features:[]);return(r,o)=>n.value.length?(j(),te("div",ph,[(j(!0),te(ye,null,St(n.value,i=>(j(),te("div",{key:i.title,class:"feature"},[he("h2",null,xe(i.title),1),he("p",null,xe(i.details),1)]))),128))])):Ie("",!0)}}),_h=Ae(vh,[["__file","HomeFeatures.vue"]]),gh=["innerHTML"],bh=["textContent"],Eh=ue({__name:"HomeFooter",setup(e){const t=_t(),n=W(()=>t.value.footer),r=W(()=>t.value.footerHtml);return(o,i)=>n.value?(j(),te(ye,{key:0},[r.value?(j(),te("div",{key:0,class:"footer",innerHTML:n.value},null,8,gh)):(j(),te("div",{key:1,class:"footer",textContent:xe(n.value)},null,8,bh))],64)):Ie("",!0)}}),yh=Ae(Eh,[["__file","HomeFooter.vue"]]),Th=["href","rel","target","aria-label"],Lh=ue({inheritAttrs:!1}),wh=ue({...Lh,__name:"AutoLink",props:{item:{type:Object,required:!0}},setup(e){const t=e,n=Zt(),r=El(),{item:o}=ko(t),i=W(()=>qn(o.value.link)),s=W(()=>!i.value&&Iu(o.value.link)),a=W(()=>{if(!s.value){if(o.value.target)return o.value.target;if(i.value)return"_blank"}}),l=W(()=>a.value==="_blank"),c=W(()=>!i.value&&!s.value&&!l.value),u=W(()=>{if(!s.value){if(o.value.rel)return o.value.rel;if(l.value)return"noopener noreferrer"}}),d=W(()=>o.value.ariaLabel||o.value.text),h=W(()=>{const w=Object.keys(r.value.locales);return w.length?!w.some(R=>R===o.value.link):o.value.link!=="/"}),v=W(()=>h.value?n.path.startsWith(o.value.link):!1),E=W(()=>c.value?o.value.activeMatch?new RegExp(o.value.activeMatch).test(n.path):v.value:!1);return(w,R)=>{const I=bt("RouterLink"),k=bt("AutoLinkExternalIcon");return c.value?(j(),Oe(I,uo({key:0,class:{"router-link-active":E.value},to:ne(o).link,"aria-label":d.value},w.$attrs),{default:Me(()=>[Ee(w.$slots,"before"),Vt(" "+xe(ne(o).text)+" ",1),Ee(w.$slots,"after")]),_:3},16,["class","to","aria-label"])):(j(),te("a",uo({key:1,class:"external-link",href:ne(o).link,rel:u.value,target:a.value,"aria-label":d.value},w.$attrs),[Ee(w.$slots,"before"),Vt(" "+xe(ne(o).text)+" ",1),l.value?(j(),Oe(k,{key:0})):Ie("",!0),Ee(w.$slots,"after")],16,Th))}}}),gt=Ae(wh,[["__file","AutoLink.vue"]]),Ah={class:"hero"},Ph={key:0,id:"main-title"},Rh={key:1,class:"description"},Oh={key:2,class:"actions"},Ih=ue({__name:"HomeHero",setup(e){const t=_t(),n=Bo(),r=Go(),o=W(()=>r.value&&t.value.heroImageDark!==void 0?t.value.heroImageDark:t.value.heroImage),i=W(()=>t.value.heroAlt||a.value||"hero"),s=W(()=>t.value.heroHeight||280),a=W(()=>t.value.heroText===null?null:t.value.heroText||n.value.title||"Hello"),l=W(()=>t.value.tagline===null?null:t.value.tagline||n.value.description||"Welcome to your VuePress site"),c=W(()=>Z(t.value.actions)?t.value.actions.map(({text:d,link:h,type:v="primary"})=>({text:d,link:h,type:v})):[]),u=()=>{if(!o.value)return null;const d=_e("img",{src:jo(o.value),alt:i.value,height:s.value});return t.value.heroImageDark===void 0?d:_e(Fo,()=>d)};return(d,h)=>(j(),te("header",Ah,[oe(u),a.value?(j(),te("h1",Ph,xe(a.value),1)):Ie("",!0),l.value?(j(),te("p",Rh,xe(l.value),1)):Ie("",!0),c.value.length?(j(),te("p",Oh,[(j(!0),te(ye,null,St(c.value,v=>(j(),Oe(gt,{key:v.text,class:We(["action-button",[v.type]]),item:v},null,8,["class","item"]))),128))])):Ie("",!0)]))}}),kh=Ae(Ih,[["__file","HomeHero.vue"]]),xh={class:"home"},Ch=ue({__name:"Home",setup(e){return(t,n)=>(j(),te("main",xh,[oe(kh),oe(_h),oe(mh),oe(yh)]))}}),Dh=Ae(Ch,[["__file","Home.vue"]]),Sh=ue({__name:"NavbarBrand",setup(e){const t=Gn(),n=Bo(),r=Fe(),o=Go(),i=W(()=>r.value.home||t.value),s=W(()=>n.value.title),a=W(()=>o.value&&r.value.logoDark!==void 0?r.value.logoDark:r.value.logo),l=()=>{if(!a.value)return null;const c=_e("img",{class:"logo",src:jo(a.value),alt:s.value});return r.value.logoDark===void 0?c:_e(Fo,()=>c)};return(c,u)=>{const d=bt("RouterLink");return j(),Oe(d,{to:i.value},{default:Me(()=>[oe(l),s.value?(j(),te("span",{key:0,class:We(["site-name",{"can-hide":a.value}])},xe(s.value),3)):Ie("",!0)]),_:1},8,["to"])}}}),zh=Ae(Sh,[["__file","NavbarBrand.vue"]]),Vh=ue({__name:"DropdownTransition",setup(e){const t=r=>{r.style.height=r.scrollHeight+"px"},n=r=>{r.style.height=""};return(r,o)=>(j(),Oe(Wn,{name:"dropdown",onEnter:t,onAfterEnter:n,onBeforeLeave:t},{default:Me(()=>[Ee(r.$slots,"default")]),_:3}))}}),Kl=Ae(Vh,[["__file","DropdownTransition.vue"]]),Mh=["aria-label"],$h={class:"title"},Nh=he("span",{class:"arrow down"},null,-1),Hh=["aria-label"],Bh={class:"title"},Fh={class:"navbar-dropdown"},jh={class:"navbar-dropdown-subtitle"},Uh={key:1},Kh={class:"navbar-dropdown-subitem-wrapper"},Wh=ue({__name:"NavbarDropdown",props:{item:{type:Object,required:!0}},setup(e){const t=e,{item:n}=ko(t),r=W(()=>n.value.ariaLabel||n.value.text),o=Te(!1),i=Zt();qe(()=>i.path,()=>{o.value=!1});const s=l=>{l.detail===0?o.value=!o.value:o.value=!1},a=(l,c)=>c[c.length-1]===l;return(l,c)=>(j(),te("div",{class:We(["navbar-dropdown-wrapper",{open:o.value}])},[he("button",{class:"navbar-dropdown-title",type:"button","aria-label":r.value,onClick:s},[he("span",$h,xe(ne(n).text),1),Nh],8,Mh),he("button",{class:"navbar-dropdown-title-mobile",type:"button","aria-label":r.value,onClick:c[0]||(c[0]=u=>o.value=!o.value)},[he("span",Bh,xe(ne(n).text),1),he("span",{class:We(["arrow",o.value?"down":"right"])},null,2)],8,Hh),oe(Kl,null,{default:Me(()=>[vr(he("ul",Fh,[(j(!0),te(ye,null,St(ne(n).children,u=>(j(),te("li",{key:u.text,class:"navbar-dropdown-item"},[u.children?(j(),te(ye,{key:0},[he("h4",jh,[u.link?(j(),Oe(gt,{key:0,item:u,onFocusout:d=>a(u,ne(n).children)&&u.children.length===0&&(o.value=!1)},null,8,["item","onFocusout"])):(j(),te("span",Uh,xe(u.text),1))]),he("ul",Kh,[(j(!0),te(ye,null,St(u.children,d=>(j(),te("li",{key:d.link,class:"navbar-dropdown-subitem"},[oe(gt,{item:d,onFocusout:h=>a(d,u.children)&&a(u,ne(n).children)&&(o.value=!1)},null,8,["item","onFocusout"])]))),128))])],64)):(j(),Oe(gt,{key:1,item:u,onFocusout:d=>a(u,ne(n).children)&&(o.value=!1)},null,8,["item","onFocusout"]))]))),128))],512),[[yr,o.value]])]),_:1})],2))}}),qh=Ae(Wh,[["__file","NavbarDropdown.vue"]]),ds=e=>decodeURI(e).replace(/#.*$/,"").replace(/(index)?\.(md|html)$/,""),Gh=(e,t)=>{if(t.hash===e)return!0;const n=ds(t.path),r=ds(e);return n===r},Wl=(e,t)=>e.link&&Gh(e.link,t)?!0:e.children?e.children.some(n=>Wl(n,t)):!1,ql=e=>!qn(e)||/github\.com/.test(e)?"GitHub":/bitbucket\.org/.test(e)?"Bitbucket":/gitlab\.com/.test(e)?"GitLab":/gitee\.com/.test(e)?"Gitee":null,Yh={GitHub:":repo/edit/:branch/:path",GitLab:":repo/-/edit/:branch/:path",Gitee:":repo/edit/:branch/:path",Bitbucket:":repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default"},Jh=({docsRepo:e,editLinkPattern:t})=>{if(t)return t;const n=ql(e);return n!==null?Yh[n]:null},Qh=({docsRepo:e,docsBranch:t,docsDir:n,filePathRelative:r,editLinkPattern:o})=>{if(!r)return null;const i=Jh({docsRepo:e,editLinkPattern:o});return i?i.replace(/:repo/,qn(e)?e:`https://github.com/${e}`).replace(/:branch/,t).replace(/:path/,dl(`${ul(n)}/${r}`)):null},Zh={key:0,class:"navbar-items"},Xh=ue({__name:"NavbarItems",setup(e){const t=()=>{const u=Qt(),d=Gn(),h=El(),v=Bo(),E=Xf(),w=Fe();return W(()=>{const R=Object.keys(h.value.locales);if(R.length<2)return[];const I=u.currentRoute.value.path,k=u.currentRoute.value.fullPath;return[{text:`${w.value.selectLanguageText}`,ariaLabel:`${w.value.selectLanguageAriaLabel??w.value.selectLanguageText}`,children:R.map(y=>{var C,q;const B=((C=h.value.locales)==null?void 0:C[y])??{},J=((q=E.value.locales)==null?void 0:q[y])??{},$=`${B.lang}`,g=J.selectLanguageName??$;let z;if($===v.value.lang)z=k;else{const L=I.replace(d.value,y);u.getRoutes().some(M=>M.path===L)?z=k.replace(I,L):z=J.home??y}return{text:g,link:z}})}]})},n=()=>{const u=Fe(),d=W(()=>u.value.repo),h=W(()=>d.value?ql(d.value):null),v=W(()=>d.value&&!qn(d.value)?`https://github.com/${d.value}`:d.value),E=W(()=>v.value?u.value.repoLabel?u.value.repoLabel:h.value===null?"Source":h.value:null);return W(()=>!v.value||!E.value?[]:[{text:E.value,link:v.value}])},r=u=>pe(u)?Yo(u):u.children?{...u,children:u.children.map(r)}:u,o=()=>{const u=Fe();return W(()=>(u.value.navbar||[]).map(r))},i=Te(!1),s=o(),a=t(),l=n(),c=W(()=>[...s.value,...a.value,...l.value]);return Ul($n.MOBILE,u=>{window.innerWidthc.value.length?(j(),te("nav",Zh,[(j(!0),te(ye,null,St(c.value,h=>(j(),te("div",{key:h.text,class:"navbar-item"},[h.children?(j(),Oe(qh,{key:0,item:h,class:We(i.value?"mobile":"")},null,8,["item","class"])):(j(),Oe(gt,{key:1,item:h},null,8,["item"]))]))),128))])):Ie("",!0)}}),Gl=Ae(Xh,[["__file","NavbarItems.vue"]]),em=["title"],tm={class:"icon",focusable:"false",viewBox:"0 0 32 32"},nm=Vc(' ',9),rm=[nm],om={class:"icon",focusable:"false",viewBox:"0 0 32 32"},im=he("path",{d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z",fill:"currentColor"},null,-1),sm=[im],lm=ue({__name:"ToggleColorModeButton",setup(e){const t=Fe(),n=Go(),r=()=>{n.value=!n.value};return(o,i)=>(j(),te("button",{class:"toggle-color-mode-button",title:ne(t).toggleColorMode,onClick:r},[vr((j(),te("svg",tm,rm,512)),[[yr,!ne(n)]]),vr((j(),te("svg",om,sm,512)),[[yr,ne(n)]])],8,em))}}),am=Ae(lm,[["__file","ToggleColorModeButton.vue"]]),cm=["title"],um=he("div",{class:"icon","aria-hidden":"true"},[he("span"),he("span"),he("span")],-1),dm=[um],fm=ue({__name:"ToggleSidebarButton",emits:["toggle"],setup(e){const t=Fe();return(n,r)=>(j(),te("div",{class:"toggle-sidebar-button",title:ne(t).toggleSidebar,"aria-expanded":"false",role:"button",tabindex:"0",onClick:r[0]||(r[0]=o=>n.$emit("toggle"))},dm,8,cm))}}),hm=Ae(fm,[["__file","ToggleSidebarButton.vue"]]),mm=ue({__name:"Navbar",emits:["toggle-sidebar"],setup(e){const t=Fe(),n=Te(null),r=Te(null),o=Te(0),i=W(()=>o.value?{maxWidth:o.value+"px"}:{});Ul($n.MOBILE,a=>{var c;const l=s(n.value,"paddingLeft")+s(n.value,"paddingRight");window.innerWidth{const c=bt("NavbarSearch");return j(),te("header",{ref_key:"navbar",ref:n,class:"navbar"},[oe(hm,{onToggle:l[0]||(l[0]=u=>a.$emit("toggle-sidebar"))}),he("span",{ref_key:"navbarBrand",ref:r},[oe(zh)],512),he("div",{class:"navbar-items-wrapper",style:Hn(i.value)},[Ee(a.$slots,"before"),oe(Gl,{class:"can-hide"}),Ee(a.$slots,"after"),ne(t).colorModeSwitch?(j(),Oe(am,{key:0})):Ie("",!0),oe(c)],4)],512)}}}),pm=Ae(mm,[["__file","Navbar.vue"]]),vm={class:"page-meta"},_m={key:0,class:"meta-item edit-link"},gm={key:1,class:"meta-item last-updated"},bm={class:"meta-item-label"},Em={class:"meta-item-info"},ym={key:2,class:"meta-item contributors"},Tm={class:"meta-item-label"},Lm={class:"meta-item-info"},wm=["title"],Am=ue({__name:"PageMeta",setup(e){const t=()=>{const l=Fe(),c=Gt(),u=_t();return W(()=>{if(!(u.value.editLink??l.value.editLink??!0))return null;const{repo:h,docsRepo:v=h,docsBranch:E="main",docsDir:w="",editLinkText:R}=l.value;if(!v)return null;const I=Qh({docsRepo:v,docsBranch:E,docsDir:w,filePathRelative:c.value.filePathRelative,editLinkPattern:u.value.editLinkPattern??l.value.editLinkPattern});return I?{text:R??"Edit this page",link:I}:null})},n=()=>{const l=Fe(),c=Gt(),u=_t();return W(()=>{var v,E;return!(u.value.lastUpdated??l.value.lastUpdated??!0)||!((v=c.value.git)!=null&&v.updatedTime)?null:new Date((E=c.value.git)==null?void 0:E.updatedTime).toLocaleString()})},r=()=>{const l=Fe(),c=Gt(),u=_t();return W(()=>{var h;return u.value.contributors??l.value.contributors??!0?((h=c.value.git)==null?void 0:h.contributors)??null:null})},o=Fe(),i=t(),s=n(),a=r();return(l,c)=>{const u=bt("ClientOnly");return j(),te("footer",vm,[ne(i)?(j(),te("div",_m,[oe(gt,{class:"meta-item-label",item:ne(i)},null,8,["item"])])):Ie("",!0),ne(s)?(j(),te("div",gm,[he("span",bm,xe(ne(o).lastUpdatedText)+": ",1),oe(u,null,{default:Me(()=>[he("span",Em,xe(ne(s)),1)]),_:1})])):Ie("",!0),ne(a)&&ne(a).length?(j(),te("div",ym,[he("span",Tm,xe(ne(o).contributorsText)+": ",1),he("span",Lm,[(j(!0),te(ye,null,St(ne(a),(d,h)=>(j(),te(ye,{key:h},[he("span",{class:"contributor",title:`email: ${d.email}`},xe(d.name),9,wm),h!==ne(a).length-1?(j(),te(ye,{key:0},[Vt(", ")],64)):Ie("",!0)],64))),128))])])):Ie("",!0)])}}}),Pm=Ae(Am,[["__file","PageMeta.vue"]]),Rm={key:0,class:"page-nav"},Om={class:"inner"},Im={key:0,class:"prev"},km={key:1,class:"next"},xm=ue({__name:"PageNav",setup(e){const t=l=>l===!1?null:pe(l)?Yo(l):No(l)?l:!1,n=(l,c,u)=>{const d=l.findIndex(h=>h.link===c);if(d!==-1){const h=l[d+u];return h!=null&&h.link?h:null}for(const h of l)if(h.children){const v=n(h.children,c,u);if(v)return v}return null},r=_t(),o=Jo(),i=Zt(),s=W(()=>{const l=t(r.value.prev);return l!==!1?l:n(o.value,i.path,-1)}),a=W(()=>{const l=t(r.value.next);return l!==!1?l:n(o.value,i.path,1)});return(l,c)=>s.value||a.value?(j(),te("nav",Rm,[he("p",Om,[s.value?(j(),te("span",Im,[oe(gt,{item:s.value},null,8,["item"])])):Ie("",!0),a.value?(j(),te("span",km,[oe(gt,{item:a.value},null,8,["item"])])):Ie("",!0)])])):Ie("",!0)}}),Cm=Ae(xm,[["__file","PageNav.vue"]]),Dm={class:"page"},Sm={class:"theme-default-content"},zm=ue({__name:"Page",setup(e){return(t,n)=>{const r=bt("Content");return j(),te("main",Dm,[Ee(t.$slots,"top"),he("div",Sm,[Ee(t.$slots,"content-top"),oe(r),Ee(t.$slots,"content-bottom")]),oe(Pm),oe(Cm),Ee(t.$slots,"bottom")])}}}),Vm=Ae(zm,[["__file","Page.vue"]]),Mm=["onKeydown"],$m={class:"sidebar-item-children"},Nm=ue({__name:"SidebarItem",props:{item:{type:Object,required:!0},depth:{type:Number,required:!1,default:0}},setup(e){const t=e,{item:n,depth:r}=ko(t),o=Zt(),i=Qt(),s=W(()=>Wl(n.value,o)),a=W(()=>({"sidebar-item":!0,"sidebar-heading":r.value===0,active:s.value,collapsible:n.value.collapsible})),l=W(()=>n.value.collapsible?s.value:!0),[c,u]=Mf(l.value),d=v=>{n.value.collapsible&&(v.preventDefault(),u())},h=i.afterEach(v=>{Un(()=>{c.value=l.value})});return Cr(()=>{h()}),(v,E)=>{var R;const w=bt("SidebarItem",!0);return j(),te("li",null,[ne(n).link?(j(),Oe(gt,{key:0,class:We(a.value),item:ne(n)},null,8,["class","item"])):(j(),te("p",{key:1,tabindex:"0",class:We(a.value),onClick:d,onKeydown:gu(d,["enter"])},[Vt(xe(ne(n).text)+" ",1),ne(n).collapsible?(j(),te("span",{key:0,class:We(["arrow",ne(c)?"down":"right"])},null,2)):Ie("",!0)],42,Mm)),(R=ne(n).children)!=null&&R.length?(j(),Oe(Kl,{key:2},{default:Me(()=>[vr(he("ul",$m,[(j(!0),te(ye,null,St(ne(n).children,I=>(j(),Oe(w,{key:`${ne(r)}${I.text}${I.link}`,item:I,depth:ne(r)+1},null,8,["item","depth"]))),128))],512),[[yr,ne(c)]])]),_:1})):Ie("",!0)])}}}),Hm=Ae(Nm,[["__file","SidebarItem.vue"]]),Bm={key:0,class:"sidebar-items"},Fm=ue({__name:"SidebarItems",setup(e){const t=Zt(),n=Jo();return je(()=>{qe(()=>t.hash,r=>{const o=document.querySelector(".sidebar");if(!o)return;const i=document.querySelector(`.sidebar a.sidebar-item[href="${t.path}${r}"]`);if(!i)return;const{top:s,height:a}=o.getBoundingClientRect(),{top:l,height:c}=i.getBoundingClientRect();l s+a&&i.scrollIntoView(!1)})}),(r,o)=>ne(n).length?(j(),te("ul",Bm,[(j(!0),te(ye,null,St(ne(n),i=>(j(),Oe(Hm,{key:`${i.text}${i.link}`,item:i},null,8,["item"]))),128))])):Ie("",!0)}}),jm=Ae(Fm,[["__file","SidebarItems.vue"]]),Um={class:"sidebar"},Km=ue({__name:"Sidebar",setup(e){return(t,n)=>(j(),te("aside",Um,[oe(Gl),Ee(t.$slots,"top"),oe(jm),Ee(t.$slots,"bottom")]))}}),Wm=Ae(Km,[["__file","Sidebar.vue"]]),qm=ue({__name:"Layout",setup(e){const t=Gt(),n=_t(),r=Fe(),o=W(()=>n.value.navbar!==!1&&r.value.navbar!==!1),i=Jo(),s=Te(!1),a=R=>{s.value=typeof R=="boolean"?R:!s.value},l={x:0,y:0},c=R=>{l.x=R.changedTouches[0].clientX,l.y=R.changedTouches[0].clientY},u=R=>{const I=R.changedTouches[0].clientX-l.x,k=R.changedTouches[0].clientY-l.y;Math.abs(I)>Math.abs(k)&&Math.abs(I)>40&&(I>0&&l.x<=80?a(!0):a(!1))},d=W(()=>[{"no-navbar":!o.value,"no-sidebar":!i.value.length,"sidebar-open":s.value},n.value.pageClass]);let h;je(()=>{h=Qt().afterEach(()=>{a(!1)})}),Dr(()=>{h()});const v=Bl(),E=v.resolve,w=v.pending;return(R,I)=>(j(),te("div",{class:We(["theme-container",d.value]),onTouchstart:c,onTouchend:u},[Ee(R.$slots,"navbar",{},()=>[o.value?(j(),Oe(pm,{key:0,onToggleSidebar:a},{before:Me(()=>[Ee(R.$slots,"navbar-before")]),after:Me(()=>[Ee(R.$slots,"navbar-after")]),_:3})):Ie("",!0)]),he("div",{class:"sidebar-mask",onClick:I[0]||(I[0]=k=>a(!1))}),Ee(R.$slots,"sidebar",{},()=>[oe(Wm,null,{top:Me(()=>[Ee(R.$slots,"sidebar-top")]),bottom:Me(()=>[Ee(R.$slots,"sidebar-bottom")]),_:3})]),Ee(R.$slots,"page",{},()=>[ne(n).home?(j(),Oe(Dh,{key:0})):(j(),Oe(Wn,{key:1,name:"fade-slide-y",mode:"out-in",onBeforeEnter:ne(E),onBeforeLeave:ne(w)},{default:Me(()=>[(j(),Oe(Vm,{key:ne(t).path},{top:Me(()=>[Ee(R.$slots,"page-top")]),"content-top":Me(()=>[Ee(R.$slots,"page-content-top")]),"content-bottom":Me(()=>[Ee(R.$slots,"page-content-bottom")]),bottom:Me(()=>[Ee(R.$slots,"page-bottom")]),_:3}))]),_:3},8,["onBeforeEnter","onBeforeLeave"]))])],34))}}),Gm=Ae(qm,[["__file","Layout.vue"]]),Ym={class:"theme-container"},Jm={class:"page"},Qm={class:"theme-default-content"},Zm=he("h1",null,"404",-1),Xm=ue({__name:"NotFound",setup(e){const t=Gn(),n=Fe(),r=n.value.notFound??["Not Found"],o=()=>r[Math.floor(Math.random()*r.length)],i=n.value.home??t.value,s=n.value.backToHome??"Back to home";return(a,l)=>{const c=bt("RouterLink");return j(),te("div",Ym,[he("main",Jm,[he("div",Qm,[Zm,he("blockquote",null,xe(o()),1),oe(c,{to:ne(i)},{default:Me(()=>[Vt(xe(ne(s)),1)]),_:1},8,["to"])])])])}}}),ep=Ae(Xm,[["__file","NotFound.vue"]]),tp=yt({enhance({app:e,router:t}){e.component("Badge",Pf),e.component("CodeGroup",Gf),e.component("CodeGroupItem",Zf),e.component("AutoLinkExternalIcon",()=>{const r=e.component("ExternalLinkIcon");return r?_e(r):null}),e.component("NavbarSearch",()=>{const r=e.component("Docsearch")||e.component("SearchBox");return r?_e(r):null});const n=t.options.scrollBehavior;t.options.scrollBehavior=async(...r)=>(await Bl().wait(),n(...r))},setup(){eh(),rh()},layouts:{Layout:Gm,NotFound:ep}}),np=e=>{const t=vo("keydown",n=>{const r=n.key==="k"&&(n.ctrlKey||n.metaKey);!(n.key==="/")&&!r||(n.preventDefault(),e(),t())})},rp=e=>e.button===1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey,op=()=>{const e=Qt();return{hitComponent:({hit:t,children:n})=>({type:"a",ref:void 0,constructor:void 0,key:void 0,props:{href:t.url,onClick:r=>{rp(r)||(r.preventDefault(),e.push(Ni(t.url,"/")))},children:n},__v:null}),navigator:{navigate:({itemUrl:t})=>{e.push(Ni(t,"/"))}},transformSearchClient:t=>{const n=Uo(t.search,500);return{...t,search:async(...r)=>n(...r)}}}},ip=(e=[],t)=>[`lang:${t}`,...Z(e)?e:[e]],sp=({buttonText:e="Search",buttonAriaLabel:t=e}={})=>``,lp=16,Yl=()=>{if(document.querySelector(".DocSearch-Modal"))return;const e=new Event("keydown");e.key="k",e.metaKey=!0,window.dispatchEvent(e),setTimeout(Yl,lp)},ap=e=>{const t="algolia-preconnect";(window.requestIdleCallback||setTimeout)(()=>{if(document.head.querySelector(`#${t}`))return;const r=document.createElement("link");r.id=t,r.rel="preconnect",r.href=`https://${e}-dsn.algolia.net`,r.crossOrigin="",document.head.appendChild(r)})};var cp={appId:"34YFD9IUQ2",apiKey:"9a9058b8655746634e01071411c366b8",indexName:"vuepress",searchParameters:{facetFilters:["tags:v2"]},locales:{"/zh/":{placeholder:"搜索文档",translations:{button:{buttonText:"搜索文档",buttonAriaLabel:"搜索文档"},modal:{searchBox:{resetButtonTitle:"清除查询条件",resetButtonAriaLabel:"清除查询条件",cancelButtonText:"取消",cancelButtonAriaLabel:"取消"},startScreen:{recentSearchesTitle:"搜索历史",noRecentSearchesText:"没有搜索历史",saveRecentSearchButtonTitle:"保存至搜索历史",removeRecentSearchButtonTitle:"从搜索历史中移除",favoriteSearchesTitle:"收藏",removeFavoriteSearchButtonTitle:"从收藏中移除"},errorScreen:{titleText:"无法获取结果",helpText:"你可能需要检查你的网络连接"},footer:{selectText:"选择",navigateText:"切换",closeText:"关闭",searchByText:"搜索提供者"},noResultsScreen:{noResultsText:"无法找到相关结果",suggestedQueryText:"你可以尝试查询",reportMissingResultsText:"你认为该查询应该有结果?",reportMissingResultsLinkText:"点击反馈"}}}}}};const up=cp;m(()=>import("./style-w40geAFS.js"),__vite__mapDeps([])),m(()=>import("./docsearch-w40geAFS.js"),__vite__mapDeps([]));const dp=ue({name:"Docsearch",props:{containerId:{type:String,required:!1,default:"docsearch-container"},options:{type:Object,required:!1,default:()=>up}},setup(e){const t=op(),n=gl(),r=Gn(),o=Te(!1),i=Te(!1),s=W(()=>{var c;return{...e.options,...(c=e.options.locales)==null?void 0:c[r.value]}}),a=async()=>{var u;const{default:c}=await m(()=>import("./index-QOy62Fup.js"),__vite__mapDeps([]));c({...t,...s.value,container:`#${e.containerId}`,searchParameters:{...s.value.searchParameters,facetFilters:ip((u=s.value.searchParameters)==null?void 0:u.facetFilters,n.value)}}),o.value=!0},l=()=>{i.value||o.value||(i.value=!0,a(),Yl(),qe(r,a))};return np(l),je(()=>ap(s.value.appId)),()=>{var c;return[_e("div",{id:e.containerId,style:{display:o.value?"block":"none"}}),o.value?null:_e("div",{onClick:l,innerHTML:sp((c=s.value.translations)==null?void 0:c.button)})]}}}),fp=yt({enhance({app:e}){e.component("Docsearch",dp)}}),hp=e=>{if(window.dataLayer&&window.gtag)return;const t=document.createElement("script");t.src=`https://www.googletagmanager.com/gtag/js?id=${e.id}`,t.async=!0,document.head.appendChild(t),window.dataLayer=window.dataLayer||[],window.gtag=function(){dataLayer.push(arguments)},gtag("js",new Date),e.debug?gtag("config",e.id,{debug_mode:!0}):gtag("config",e.id)};var mp={id:"G-CTB8FQ7VMW"};const pp=mp,vp=yt({enhance(){hp(pp)}}),_p={enhance:({app:e})=>{e.component("NpmBadge",A(()=>m(()=>import("./NpmBadge--lRFx50g.js"),__vite__mapDeps([]))))}},ar=[qd,Jd,tf,pf,bf,wf,tp,fp,vp,_p],gp=[["v-8daa1a0e","/",{title:"Home"},["/README.md"]],["v-b4ed4f1c","/advanced/architecture.html",{title:"Architecture"},[":md"]],["v-301ab792","/advanced/plugin.html",{title:"Writing a Plugin"},[":md"]],["v-06329db8","/advanced/theme.html",{title:"Writing a Theme"},[":md"]],["v-fffb8e28","/guide/",{title:"Introduction"},["/guide/README.md"]],["v-3c32c2ca","/guide/assets.html",{title:"Assets"},[":md"]],["v-6f1f3595","/guide/bundler.html",{title:"Bundler"},[":md"]],["v-4f4ccb8f","/guide/configuration.html",{title:"Configuration"},[":md"]],["v-e8a66a70","/guide/deployment.html",{title:"Deployment"},[":md"]],["v-fb0f0066","/guide/getting-started.html",{title:"Getting Started"},[":md"]],["v-acb10be2","/guide/i18n.html",{title:"I18n"},[":md"]],["v-0978b044","/guide/markdown.html",{title:"Markdown"},[":md"]],["v-d0112c92","/guide/migration.html",{title:"Migrating from v1"},[":md"]],["v-4eaf9f84","/guide/page.html",{title:"Page"},[":md"]],["v-1d14d5cc","/guide/plugin.html",{title:"Plugin"},[":md"]],["v-4d76029c","/guide/theme.html",{title:"Theme"},[":md"]],["v-a951be94","/reference/cli.html",{title:"Command Line Interface"},[":md"]],["v-a84e51b8","/reference/client-api.html",{title:"Client API"},[":md"]],["v-55453034","/reference/components.html",{title:"Built-in Components"},[":md"]],["v-b249668c","/reference/config.html",{title:"Config"},[":md"]],["v-3590f0ec","/reference/frontmatter.html",{title:"Frontmatter"},[":md"]],["v-4986678d","/reference/node-api.html",{title:"Node API"},[":md"]],["v-51569e88","/reference/plugin-api.html",{title:"Plugin API"},[":md"]],["v-6b76c1c0","/reference/theme-api.html",{title:"Theme API"},[":md"]],["v-2d0ad528","/zh/",{title:"首页"},["/zh/README.md"]],["v-03c9312a","/advanced/cookbook/",{title:"Introduction"},["/advanced/cookbook/README.md"]],["v-2a57b498","/advanced/cookbook/adding-extra-pages.html",{title:"Adding Extra Pages"},[":md"]],["v-06adec7d","/advanced/cookbook/making-a-theme-extendable.html",{title:"Making a Theme Extendable"},[":md"]],["v-4e3c9b8c","/advanced/cookbook/markdown-and-vue-sfc.html",{title:"Markdown and Vue SFC"},[":md"]],["v-3bc3633f","/advanced/cookbook/passing-data-to-client-code.html",{title:"Passing Data to Client Code"},[":md"]],["v-3d6c80f5","/advanced/cookbook/usage-of-client-config.html",{title:"Usage of Client Config"},[":md"]],["v-cf5a290e","/reference/bundler/vite.html",{title:"Vite"},[":md"]],["v-d4319af0","/reference/bundler/webpack.html",{title:"Webpack"},[":md"]],["v-2e97e858","/reference/default-theme/components.html",{title:"Built-in Components"},[":md"]],["v-0f0d17a8","/reference/default-theme/config.html",{title:"Config"},[":md"]],["v-6175ace0","/reference/default-theme/extending.html",{title:"Extending"},[":md"]],["v-e5e26a84","/reference/default-theme/frontmatter.html",{title:"Frontmatter"},[":md"]],["v-176c9c4a","/reference/default-theme/markdown.html",{title:"Markdown"},[":md"]],["v-31e08608","/reference/default-theme/styles.html",{title:"Styles"},[":md"]],["v-3ba02eb8","/reference/plugin/active-header-links.html",{title:"active-header-links"},[":md"]],["v-6474e88f","/reference/plugin/back-to-top.html",{title:"back-to-top"},[":md"]],["v-3df91977","/reference/plugin/container.html",{title:"container"},[":md"]],["v-ec0baf10","/reference/plugin/docsearch.html",{title:"docsearch"},[":md"]],["v-5c864690","/reference/plugin/external-link-icon.html",{title:"external-link-icon"},[":md"]],["v-0f9e4c06","/reference/plugin/git.html",{title:"git"},[":md"]],["v-b3f1b470","/reference/plugin/google-analytics.html",{title:"google-analytics"},[":md"]],["v-2ad6454d","/reference/plugin/medium-zoom.html",{title:"medium-zoom"},[":md"]],["v-46d4f19d","/reference/plugin/nprogress.html",{title:"nprogress"},[":md"]],["v-37c5e106","/reference/plugin/palette.html",{title:"palette"},[":md"]],["v-35ebfb0e","/reference/plugin/prismjs.html",{title:"prismjs"},[":md"]],["v-5f86289f","/reference/plugin/pwa-popup.html",{title:"pwa-popup"},[":md"]],["v-7ab4099e","/reference/plugin/pwa.html",{title:"pwa"},[":md"]],["v-7f8fee18","/reference/plugin/register-components.html",{title:"register-components"},[":md"]],["v-260e1012","/reference/plugin/search.html",{title:"search"},[":md"]],["v-bb2079f4","/reference/plugin/shiki.html",{title:"shiki"},[":md"]],["v-18fd0fcc","/reference/plugin/theme-data.html",{title:"theme-data"},[":md"]],["v-76709450","/reference/plugin/toc.html",{title:"toc"},[":md"]],["v-0754cde1","/zh/advanced/architecture.html",{title:"架构"},[":md"]],["v-574aac41","/zh/advanced/plugin.html",{title:"开发插件"},[":md"]],["v-66c42ad6","/zh/advanced/theme.html",{title:"开发主题"},[":md"]],["v-47357bdb","/zh/guide/",{title:"介绍"},["/zh/guide/README.md"]],["v-029ba47b","/zh/guide/assets.html",{title:"静态资源"},[":md"]],["v-75d28a04","/zh/guide/bundler.html",{title:"打包工具"},[":md"]],["v-81f65e84","/zh/guide/configuration.html",{title:"配置"},[":md"]],["v-4a7b6bf9","/zh/guide/deployment.html",{title:"部署"},[":md"]],["v-37781588","/zh/guide/getting-started.html",{title:"快速上手"},[":md"]],["v-4b8f1400","/zh/guide/i18n.html",{title:"多语言支持"},[":md"]],["v-6a0a3d62","/zh/guide/markdown.html",{title:"Markdown"},[":md"]],["v-81b14334","/zh/guide/migration.html",{title:"从 v1 迁移"},[":md"]],["v-7a8fca2f","/zh/guide/page.html",{title:"页面"},[":md"]],["v-9043126a","/zh/guide/plugin.html",{title:"插件"},[":md"]],["v-2efcb26a","/zh/guide/theme.html",{title:"主题"},[":md"]],["v-9beb15b6","/zh/reference/cli.html",{title:"命令行接口"},[":md"]],["v-332177d5","/zh/reference/client-api.html",{title:"客户端 API"},[":md"]],["v-5ca60897","/zh/reference/components.html",{title:"内置组件"},[":md"]],["v-65a9edeb","/zh/reference/config.html",{title:"配置"},[":md"]],["v-d147334a","/zh/reference/frontmatter.html",{title:"Frontmatter"},[":md"]],["v-e19cff04","/zh/reference/node-api.html",{title:"Node API"},[":md"]],["v-5e9d516d","/zh/reference/plugin-api.html",{title:"插件 API"},[":md"]],["v-49a27222","/zh/reference/theme-api.html",{title:"主题 API"},[":md"]],["v-0a7c8599","/zh/advanced/cookbook/",{title:"介绍"},["/zh/advanced/cookbook/README.md"]],["v-5b617736","/zh/advanced/cookbook/adding-extra-pages.html",{title:"添加额外页面"},[":md"]],["v-04c514ac","/zh/advanced/cookbook/making-a-theme-extendable.html",{title:"开发一个可继承的主题"},[":md"]],["v-63e02eaa","/zh/advanced/cookbook/markdown-and-vue-sfc.html",{title:"Markdown 与 Vue SFC"},[":md"]],["v-10b13bae","/zh/advanced/cookbook/passing-data-to-client-code.html",{title:"向客户端代码传递数据"},[":md"]],["v-c03241b4","/zh/advanced/cookbook/usage-of-client-config.html",{title:"客户端配置的使用方法"},[":md"]],["v-6ff623ea","/zh/reference/bundler/vite.html",{title:"Vite"},[":md"]],["v-dde74f12","/zh/reference/bundler/webpack.html",{title:"Webpack"},[":md"]],["v-551922c5","/zh/reference/default-theme/components.html",{title:"内置组件"},[":md"]],["v-03a561ce","/zh/reference/default-theme/config.html",{title:"配置"},[":md"]],["v-90ed1862","/zh/reference/default-theme/extending.html",{title:"继承"},[":md"]],["v-a566dc26","/zh/reference/default-theme/frontmatter.html",{title:"Frontmatter"},[":md"]],["v-c78c5de8","/zh/reference/default-theme/markdown.html",{title:"Markdown"},[":md"]],["v-2100bd79","/zh/reference/default-theme/styles.html",{title:"样式"},[":md"]],["v-231b4d69","/zh/reference/plugin/active-header-links.html",{title:"active-header-links"},[":md"]],["v-6c6e4840","/zh/reference/plugin/back-to-top.html",{title:"back-to-top"},[":md"]],["v-b10e9d30","/zh/reference/plugin/container.html",{title:"container"},[":md"]],["v-190c7f2e","/zh/reference/plugin/docsearch.html",{title:"docsearch"},[":md"]],["v-7cc40dbf","/zh/reference/plugin/external-link-icon.html",{title:"external-link-icon"},[":md"]],["v-d2322692","/zh/reference/plugin/git.html",{title:"git"},[":md"]],["v-07ca2692","/zh/reference/plugin/google-analytics.html",{title:"google-analytics"},[":md"]],["v-32cfa4fe","/zh/reference/plugin/medium-zoom.html",{title:"medium-zoom"},[":md"]],["v-9f56ece4","/zh/reference/plugin/nprogress.html",{title:"nprogress"},[":md"]],["v-5fd3efae","/zh/reference/plugin/palette.html",{title:"palette"},[":md"]],["v-9cba4982","/zh/reference/plugin/prismjs.html",{title:"prismjs"},[":md"]],["v-6df47ee0","/zh/reference/plugin/pwa-popup.html",{title:"pwa-popup"},[":md"]],["v-01fcaa4f","/zh/reference/plugin/pwa.html",{title:"pwa"},[":md"]],["v-670b0cc9","/zh/reference/plugin/register-components.html",{title:"register-components"},[":md"]],["v-42d1e5c1","/zh/reference/plugin/search.html",{title:"search"},[":md"]],["v-7a12fb77","/zh/reference/plugin/shiki.html",{title:"shiki"},[":md"]],["v-411f140a","/zh/reference/plugin/theme-data.html",{title:"theme-data"},[":md"]],["v-048d95fe","/zh/reference/plugin/toc.html",{title:"toc"},[":md"]],["v-3706649a","/404.html",{title:""},[]]];var fs=ue({name:"Vuepress",setup(){const e=Su();return()=>_e(e.value)}}),bp=()=>gp.reduce((e,[t,n,r,o])=>(e.push({name:t,path:n,component:fs,meta:r},{path:n.endsWith("/")?n+"index.html":n.substring(0,n.length-5),redirect:n},...o.map(i=>({path:i===":md"?n.substring(0,n.length-5)+".md":i,redirect:n}))),e),[{name:"404",path:"/:catchAll(.*)",component:fs}]),Ep=rd,yp=()=>{const e=Hd({history:Ep(ul("/")),routes:bp(),scrollBehavior:(t,n,r)=>r||(t.hash?{el:t.hash}:{top:0})});return e.beforeResolve(async(t,n)=>{var r;(t.path!==n.path||n===mt)&&([t.meta._data]=await Promise.all([ht.resolvePageData(t.name),(r=hl[t.name])==null?void 0:r.__asyncLoader()]))}),e},Tp=e=>{e.component("ClientOnly",Fo),e.component("Content",Nu)},Lp=(e,t,n)=>{const r=cs(()=>t.currentRoute.value.path),o=cs(()=>ht.resolveRouteLocale(rn.value.locales,r.value)),i=Rf(r,()=>t.currentRoute.value.meta._data),s=W(()=>ht.resolveLayouts(n)),a=W(()=>ht.resolveSiteLocaleData(rn.value,o.value)),l=W(()=>ht.resolvePageFrontmatter(i.value)),c=W(()=>ht.resolvePageHeadTitle(i.value,a.value)),u=W(()=>ht.resolvePageHead(c.value,l.value,a.value)),d=W(()=>ht.resolvePageLang(i.value,a.value)),h=W(()=>ht.resolvePageLayout(i.value,s.value));return e.provide(ku,s),e.provide(ml,i),e.provide(pl,l),e.provide(Du,c),e.provide(vl,u),e.provide(_l,d),e.provide(bl,h),e.provide(Ho,o),e.provide(yl,a),Object.defineProperties(e.config.globalProperties,{$frontmatter:{get:()=>l.value},$head:{get:()=>u.value},$headTitle:{get:()=>c.value},$lang:{get:()=>d.value},$page:{get:()=>i.value},$routeLocale:{get:()=>o.value},$site:{get:()=>rn.value},$siteLocale:{get:()=>a.value},$withBase:{get:()=>jo}}),{layouts:s,pageData:i,pageFrontmatter:l,pageHead:u,pageHeadTitle:c,pageLang:d,pageLayout:h,routeLocale:o,siteData:rn,siteLocaleData:a}},wp=()=>{const e=Cu(),t=gl(),n=Te([]),r=()=>{e.value.forEach(i=>{const s=Ap(i);s&&n.value.push(s)})},o=()=>{document.documentElement.lang=t.value,n.value.forEach(i=>{i.parentNode===document.head&&document.head.removeChild(i)}),n.value.splice(0,n.value.length),e.value.forEach(i=>{const s=Pp(i);s!==null&&(document.head.appendChild(s),n.value.push(s))})};Wt(Vu,o),je(()=>{r(),o(),qe(()=>e.value,o)})},Ap=([e,t,n=""])=>{const r=Object.entries(t).map(([a,l])=>pe(l)?`[${a}=${JSON.stringify(l)}]`:l===!0?`[${a}]`:"").join(""),o=`head > ${e}${r}`;return Array.from(document.querySelectorAll(o)).find(a=>a.innerText===n)||null},Pp=([e,t,n])=>{if(!pe(e))return null;const r=document.createElement(e);return No(t)&&Object.entries(t).forEach(([o,i])=>{pe(i)?r.setAttribute(o,i):i===!0&&r.setAttribute(o,"")}),pe(n)&&r.appendChild(document.createTextNode(n)),r},Rp=yu,Op=async()=>{var n;const e=Rp({name:"VuepressApp",setup(){var r;wp();for(const o of ar)(r=o.setup)==null||r.call(o);return()=>[_e(Cl),...ar.flatMap(({rootComponents:o=[]})=>o.map(i=>_e(i)))]}}),t=yp();Tp(e),Lp(e,t,ar);for(const r of ar)await((n=r.enhance)==null?void 0:n.call(r,{app:e,router:t,siteData:rn}));return e.use(t),{app:e,router:t}};Op().then(({app:e,router:t})=>{t.isReady().then(()=>{e.mount("#app")})});export{ye as F,Ae as _,he as a,Vt as b,te as c,Op as createVueApp,oe as d,Vc as e,St as f,Te as g,_e as h,ue as i,W as j,j as o,bt as r,xe as t,Me as w}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/architecture.html-jLHymeGV.js","assets/vuepress-core-process-9C1P9KT4.js","assets/assets.html-jGDJJiJc.js","assets/hero-RIx3NWRP.js","assets/extending.html-wJrHlIH8.js","assets/extending-a-theme-01-xmIu-MPG.js","assets/architecture.html-UaR5cFj_.js","assets/assets.html-_UpsFxx-.js","assets/extending.html-w7Kv_9tW.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/assets/architecture.html-50nO3U30.js b/assets/architecture.html-50nO3U30.js new file mode 100644 index 000000000..a1f23182d --- /dev/null +++ b/assets/architecture.html-50nO3U30.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0754cde1","path":"/zh/advanced/architecture.html","title":"架构","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"概览","slug":"概览","link":"#概览","children":[]},{"level":2,"title":"核心流程与 Hooks","slug":"核心流程与-hooks","link":"#核心流程与-hooks","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/advanced/architecture.md"}');export{e as data}; diff --git a/assets/architecture.html-Ef-WWi97.js b/assets/architecture.html-Ef-WWi97.js new file mode 100644 index 000000000..a09562f1d --- /dev/null +++ b/assets/architecture.html-Ef-WWi97.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-b4ed4f1c","path":"/advanced/architecture.html","title":"Architecture","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Overview","slug":"overview","link":"#overview","children":[]},{"level":2,"title":"Core Process and Hooks","slug":"core-process-and-hooks","link":"#core-process-and-hooks","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"advanced/architecture.md"}');export{e as data}; diff --git a/assets/architecture.html-UaR5cFj_.js b/assets/architecture.html-UaR5cFj_.js new file mode 100644 index 000000000..f76c817c8 --- /dev/null +++ b/assets/architecture.html-UaR5cFj_.js @@ -0,0 +1 @@ +import{_ as r,a as i}from"./vuepress-core-process-9C1P9KT4.js";import{_ as a,r as s,o as u,c as d,a as l,b as e,d as t,w as o,e as p}from"./app-eU2v8o1B.js";const c={},h=p('# 架构
# 概览
上图展示了 VuePress 的简要架构:
- Node App 会生成临时文件,包括页面、路由等。
- Bundler 会将 Client App 和临时文件一起进行打包,就像处理一个普通的 Vue SPA 一样。
作为开发者,你必须要意识到 VuePress 分为两个主要部分: Node App 和 Client App ,这一点对于开发插件和主题来说都十分重要。
- 插件或者主题的入口文件会在 Node App 中被加载。
- 客户端文件会在 Client App 中被加载,也就是会被 Bundler 处理。比如组件、客户端配置文件等。
# 核心流程与 Hooks
',9),_=l("strong",null,"init",-1),f=l("li",null,"主题和插件会被加载。这意味着插件需要在初始化之前使用。",-1),m=l("li",null,[e("在 "),l("strong",null,"prepare"),e(" 阶段: "),l("ul",null,[l("li",null,"临时文件会被生成,因此所有和客户端文件相关的 Hooks 会在此处调用。")])],-1),k=l("strong",null,"dev / build",-1);function g(x,w){const n=s("RouterLink");return u(),d("div",null,[h,l("p",null,[e("上图展示了 VuePress 的核心流程以及 "),t(n,{to:"/zh/reference/plugin-api.html"},{default:o(()=>[e("插件 API")]),_:1}),e(" 的 Hooks :")]),l("ul",null,[l("li",null,[e("在 "),_,e(" 阶段: "),l("ul",null,[f,l("li",null,[e("由于我们要使用 markdown-it 来解析 Markdown 文件,因此需要在加载页面文件之前创建 markdown-it 实例: "),l("ul",null,[l("li",null,[t(n,{to:"/zh/reference/plugin-api.html#extendsmarkdownoptions"},{default:o(()=>[e("extendsMarkdownOptions")]),_:1}),e(" Hook 会被调用,用以创建 markdown-it 实例。")]),l("li",null,[t(n,{to:"/zh/reference/plugin-api.html#extendsmarkdown"},{default:o(()=>[e("extendsMarkdown")]),_:1}),e(" Hook 会被调用,用以扩展 markdown-it 实例。")])])]),l("li",null,[e("页面文件会被加载: "),l("ul",null,[l("li",null,[t(n,{to:"/zh/reference/plugin-api.html#extendspageoptions"},{default:o(()=>[e("extendsPageOptions")]),_:1}),e(" Hook 会被调用,用以创建页面。")]),l("li",null,[t(n,{to:"/zh/reference/plugin-api.html#extendspage"},{default:o(()=>[e("extendsPage")]),_:1}),e(" Hook 会被调用,用以扩展页面对象。")])])])])]),m,l("li",null,[e("在 "),k,e(" 阶段: "),l("ul",null,[l("li",null,[e("Bundler 会被加载: "),l("ul",null,[l("li",null,[t(n,{to:"/zh/reference/plugin-api.html#extendsbundleroptions"},{default:o(()=>[e("extendsBundlerOptions")]),_:1}),e(" Hook 会被调用,用以生成 Bundler 的配置。")]),l("li",null,[t(n,{to:"/zh/reference/plugin-api.html#alias"},{default:o(()=>[e("alias")]),_:1}),e(" Hook 和 "),t(n,{to:"/zh/reference/plugin-api.html#define"},{default:o(()=>[e("define")]),_:1}),e(" Hook 会被用在 Bundler 的配置中,所以它们会在此处调用。")])])])])])])])}const v=a(c,[["render",g],["__file","architecture.html.vue"]]);export{v as default}; diff --git a/assets/architecture.html-jLHymeGV.js b/assets/architecture.html-jLHymeGV.js new file mode 100644 index 000000000..5e0f0a2f9 --- /dev/null +++ b/assets/architecture.html-jLHymeGV.js @@ -0,0 +1 @@ +import{_ as i,a as r}from"./vuepress-core-process-9C1P9KT4.js";import{_ as s,r as a,o as d,c as u,a as l,b as e,d as n,w as o,e as c}from"./app-eU2v8o1B.js";const p={},h=c('# Architecture
# Overview
The above figure shows a brief overview of the VuePress architecture:
- Node App will generate temp files, including the pages, routes, etc.
- Bundler will handle Client App together with the temp files, just like a common Vue SPA.
As a developer, you must be aware of that VuePress has two main parts: Node App and Client App, which is important when developing plugins and themes:
- The entry file of a plugin or a theme will be loaded in Node App.
- Client files will be loaded in Client App, which will be handled by bundler. For example, components, client config files, etc.
# Core Process and Hooks
',9),f=l("strong",null,"init",-1),g=l("li",null,"Theme and plugins will be loaded. That means all the plugins should be used before initialization.",-1),m=l("li",null,[e("In the "),l("strong",null,"prepare"),e(" stage: "),l("ul",null,[l("li",null,"Temp files will be generated, so all hooks related to client files will be processed here.")])],-1),w=l("strong",null,"dev / build",-1);function _(b,k){const t=a("RouterLink");return d(),u("div",null,[h,l("p",null,[e("The above figure shows the core process of VuePress Node App and the hooks of "),n(t,{to:"/reference/plugin-api.html"},{default:o(()=>[e("Plugin API")]),_:1}),e(":")]),l("ul",null,[l("li",null,[e("In the "),f,e(" stage: "),l("ul",null,[g,l("li",null,[e("As we are using markdown-it to parse the markdown file, so we need to create markdown-it instance before loading pages: "),l("ul",null,[l("li",null,[n(t,{to:"/reference/plugin-api.html#extendsmarkdownoptions"},{default:o(()=>[e("extendsMarkdownOptions")]),_:1}),e(" hook will be processed to create markdown-it instance.")]),l("li",null,[n(t,{to:"/reference/plugin-api.html#extendsmarkdown"},{default:o(()=>[e("extendsMarkdown")]),_:1}),e(" hook will be processed extends markdown-it instance.")])])]),l("li",null,[e("Page files will be loaded: "),l("ul",null,[l("li",null,[n(t,{to:"/reference/plugin-api.html#extendspageoptions"},{default:o(()=>[e("extendsPageOptions")]),_:1}),e(" hook will be processed to create pages.")]),l("li",null,[n(t,{to:"/reference/plugin-api.html#extendspage"},{default:o(()=>[e("extendsPage")]),_:1}),e(" hook will be processed to extends page object.")])])])])]),m,l("li",null,[e("In the "),w,e(" stage: "),l("ul",null,[l("li",null,[e("Bundler will be resolved: "),l("ul",null,[l("li",null,[n(t,{to:"/reference/plugin-api.html#extendsbundleroptions"},{default:o(()=>[e("extendsBundlerOptions")]),_:1}),e(" hook will be processed to create bundler configuration.")]),l("li",null,[n(t,{to:"/reference/plugin-api.html#alias"},{default:o(()=>[e("alias")]),_:1}),e(" hook and "),n(t,{to:"/reference/plugin-api.html#define"},{default:o(()=>[e("define")]),_:1}),e(" hook would be used in bundler configuration, so they will be processed here.")])])])])])])])}const A=s(p,[["render",_],["__file","architecture.html.vue"]]);export{A as default}; diff --git a/assets/assets.html-1j54Fvx1.js b/assets/assets.html-1j54Fvx1.js new file mode 100644 index 000000000..2526189c5 --- /dev/null +++ b/assets/assets.html-1j54Fvx1.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-029ba47b","path":"/zh/guide/assets.html","title":"静态资源","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"相对路径","slug":"相对路径","link":"#相对路径","children":[]},{"level":2,"title":"Public 文件","slug":"public-文件","link":"#public-文件","children":[{"level":3,"title":"Base Helper","slug":"base-helper","link":"#base-helper","children":[]}]},{"level":2,"title":"依赖包和路径别名","slug":"依赖包和路径别名","link":"#依赖包和路径别名","children":[]}],"git":{"updatedTime":1703048697000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":2},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"filePathRelative":"zh/guide/assets.md"}');export{e as data}; diff --git a/assets/assets.html-4ukTXhdM.js b/assets/assets.html-4ukTXhdM.js new file mode 100644 index 000000000..6c68141fd --- /dev/null +++ b/assets/assets.html-4ukTXhdM.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3c32c2ca","path":"/guide/assets.html","title":"Assets","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Relative URLs","slug":"relative-urls","link":"#relative-urls","children":[]},{"level":2,"title":"Public Files","slug":"public-files","link":"#public-files","children":[{"level":3,"title":"Base Helper","slug":"base-helper","link":"#base-helper","children":[]}]},{"level":2,"title":"Packages and Path Aliases","slug":"packages-and-path-aliases","link":"#packages-and-path-aliases","children":[]}],"git":{"updatedTime":1703048697000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":2},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"filePathRelative":"guide/assets.md"}');export{e as data}; diff --git a/assets/assets.html-_UpsFxx-.js b/assets/assets.html-_UpsFxx-.js new file mode 100644 index 000000000..3bc32e43a --- /dev/null +++ b/assets/assets.html-_UpsFxx-.js @@ -0,0 +1,34 @@ +import{_ as p}from"./hero-RIx3NWRP.js";import{_ as r,r as c,o as t,c as i,a,b as s,d as e,w as l,e as o}from"./app-eU2v8o1B.js";const d={},D=o(`# 静态资源
# 相对路径
你可以在你的 Markdown 内容中使用相对路径来引用静态资源:
![图片](./image.png) +
或
![图片](image.png) +
一般情况下,我们推荐你使用这种方式来引用图片,因为人们通常会把图片放在引用它的 Markdown 文件附近。
# Public 文件
你可以把一些静态资源放在 Public 目录中,它们会被复制到最终生成的网站的根目录下。
`,9),u=a("code",null,".vuepress/public",-1),y=o(`在下列这些情况中,你可能会用到它:
- 你可能需要提供一些静态资源,但是它们并不直接被你的 Markdown 文件引用,比如 favicon 和 PWA 图标。
- 你可能想要托管一些共享的静态资源,甚至可能需要在你的网站外部引用它,比如 Logo 图片。
- 你可能想在你的 Markdown 内容中通过绝对路径来引入图片。
以我们文档的源文件为例,我们把 VuePress 的 Logo 放在了 Public 目录下:
└─ docs + ├─ .vuepress + | └─ public + | └─ images + | └─ hero.png # <- Logo 文件 + └─ guide + └─ assets.md # <- 我们在这里 +
我们可以这样在当前页面引用 Logo :
Input
![VuePress Logo](/images/hero.png) +
Output
# Base Helper
',10),m=a("code",null,"https://foo.github.io/bar/",-1),v=a("code",null,"'/bar/'",-1),b=a("code",null,"https://foo.github.io/bar/images/hero.png",-1),h=o('在大多数情况下,你不需要担心这些 Public 文件的引用路径,因为 VuePress 会自动帮你处理
base
前缀:',2),g={class:"custom-container tip"},C=a("p",{class:"custom-container-title"},"提示",-1),E=a("code",null,"true",-1),_=a("code",null,"base",-1),k=a("code",null,"base",-1),f=a("code",null,"base",-1),x=o(`<!-- 你不需要给 `/images/hero.png` 手动添加 `/bar/` 前缀 -->\n\n![VuePress Logo](/images/hero.png)\n
<template> + <img :src="withBase(logoPath)" /> +</template> + +<script setup> +import { ref } from 'vue' +import { withBase } from '@vuepress/client' + +const logoPath = ref('/images/hero.png') +</script> +
你也可以通过
$withBase
来直接使用这个工具函数:<img :src="$withBase('/images/hero.png')" alt="VuePress Logo"> +
# 依赖包和路径别名
尽管这不是常见用法,但是你可以从依赖包中引用图片:
npm install -D package-name +
由于 Markdown 会默认将图片链接视为相对链接,你需要使用
<img>
标签:<img src="package-name/image.png" alt="来自依赖包的图片"> +
在配置文件中设置的路径别名也同样支持:
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + alias: { + '@alias': path.resolve(__dirname, './path/to/some/dir'), + }, +} +
`,11),A={class:"custom-container tip"},w=a("p",{class:"custom-container-title"},"提示",-1);function P(F,q){const n=c("RouterLink");return t(),i("div",null,[D,a("p",null,[s("默认的 Public 目录是 "),u,s(" ,可以通过 "),e(n,{to:"/zh/reference/config.html#public"},{default:l(()=>[s("public")]),_:1}),s(" 配置项来修改。")]),y,a("p",null,[s("如果你的网站部署在非根路径下,例如 "),m,s(" ,那么你应该把 "),e(n,{to:"/zh/reference/config.html#base"},{default:l(()=>[s("base")]),_:1}),s(" 设置为 "),v,s("。显然,此时你的 Public 文件会被部署在 "),b,s(" 这样的链接下。")]),h,a("div",g,[C,a("p",null,[s("在使用 "),e(n,{to:"/zh/reference/bundler/webpack.html"},{default:l(()=>[s("Webpack 打包工具")]),_:1}),s(" 时,你需要将 "),e(n,{to:"/zh/reference/config.html#markdown-assets"},{default:l(()=>[s("markdown.assets.absolutePathPrependBase")]),_:1}),s(" 设置为 "),E,s(" 来给 Markdown 图片自动添加 "),_,s(" 前缀。")])]),a("p",null,[s("然而,有些情况下,你可能会有一些指向 Public 文件的动态路径,尤其是在你开发一个自定义主题的时候。在这种情况下, "),k,s(" 无法被自动处理。为了解决这个问题,VuePress 提供了 "),e(n,{to:"/zh/reference/client-api.html#withbase"},{default:l(()=>[s("withBase")]),_:1}),s(" 工具函数,它可以帮助你添加 "),f,s(" 前缀:")]),x,a("div",A,[w,a("p",null,[s("配置参考: "),e(n,{to:"/zh/reference/plugin-api.html#alias"},{default:l(()=>[s("alias")]),_:1})])])])}const L=r(d,[["render",P],["__file","assets.html.vue"]]);export{L as default}; diff --git a/assets/assets.html-jGDJJiJc.js b/assets/assets.html-jGDJJiJc.js new file mode 100644 index 000000000..e0bfcfa04 --- /dev/null +++ b/assets/assets.html-jGDJJiJc.js @@ -0,0 +1,34 @@ +import{_ as p}from"./hero-RIx3NWRP.js";import{_ as t,r,o as i,c,a as e,b as s,d as n,w as l,e as o}from"./app-eU2v8o1B.js";const d={},D=o(`<img src="@alias/image.png" alt="来自路径别名的图片"> +
# Assets
# Relative URLs
You can reference any assets using relative URLs in your Markdown content:
![An image](./image.png) +
or
![An image](image.png) +
This is generally the suggested way to import images, as users usually place images near the Markdown file that references them.
# Public Files
You can put some static assets inside public directory, and they will be copied to the root of the generated directory.
`,9),u=e("code",null,".vuepress/public",-1),y=o(`It would be useful in some cases:
- You may need to provide static assets that are not directly referenced in any of your Markdown files, for example, favicon and PWA icons.
- You may need to serve some shared static assets, which may even be referenced outside your site, for example, logo images.
- You may want to reference images using absolute URLs in your Markdown content.
Take our documentation source files as an example, we are putting the logo of VuePress inside the public directory:
└─ docs + ├─ .vuepress + | └─ public + | └─ images + | └─ hero.png # <- Logo file + └─ guide + └─ assets.md # <- Here we are +
We can reference our logo in current page like this:
Input
![VuePress Logo](/images/hero.png) +
Output
# Base Helper
',10),m=e("code",null,"https://foo.github.io/bar/",-1),h=e("code",null,"'/bar/'",-1),v=e("code",null,"https://foo.github.io/bar/images/hero.png",-1),b=o('In most cases, you don't need to worry about the reference path of those public files, as VuePress will automatically handle
base
for you:',2),g={class:"custom-container tip"},C=e("p",{class:"custom-container-title"},"TIP",-1),f=e("code",null,"true",-1),E=e("code",null,"base",-1),k=e("code",null,"base",-1),_=o(`<!-- you don't need to prepend `/bar/` to `/images/hero.png` manually -->\n\n![VuePress Logo](/images/hero.png)\n
<template> + <img :src="withBase(logoPath)" /> +</template> + +<script setup> +import { ref } from 'vue' +import { withBase } from '@vuepress/client' + +const logoPath = ref('/images/hero.png') +</script> +
You can also access the helper by
$withBase
directly:<img :src="$withBase('/images/hero.png')" alt="VuePress Logo"> +
# Packages and Path Aliases
Although it is not a common usage, you can reference images from dependent packages:
npm install -D package-name +
Since markdown image syntax regards image links as relative paths by default, you need to use
<img>
tag:<img src="package-name/image.png" alt="Image from dependency"> +
The path aliases that set in config file are also supported:
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + alias: { + '@alias': path.resolve(__dirname, './path/to/some/dir'), + }, +} +
`,11),x={class:"custom-container tip"},w=e("p",{class:"custom-container-title"},"TIP",-1);function A(F,P){const a=r("RouterLink");return i(),c("div",null,[D,e("p",null,[s("The default public directory is "),u,s(", which can be changed by "),n(a,{to:"/reference/config.html#public"},{default:l(()=>[s("public")]),_:1}),s(" option.")]),y,e("p",null,[s("If your site is deployed to a non-root URL, for example, "),m,s(", then the "),n(a,{to:"/reference/config.html#base"},{default:l(()=>[s("base")]),_:1}),s(" should be set to "),h,s(". Obviously, your public files would be served like "),v,s(" after deployment.")]),b,e("div",g,[C,e("p",null,[s("When using "),n(a,{to:"/reference/bundler/webpack.html"},{default:l(()=>[s("webpack bundler")]),_:1}),s(", you need to set "),n(a,{to:"/reference/config.html#markdown-assets"},{default:l(()=>[s("markdown.assets.absolutePathPrependBase")]),_:1}),s(" to "),f,s(" to automatically prepend base to markdown images.")])]),e("p",null,[s("However, sometimes you may have some dynamical links referencing public files, especially when you are authoring a custom theme. In such case, the "),E,s(" could not be handled automatically. To help with that, VuePress provides a "),n(a,{to:"/reference/client-api.html#withbase"},{default:l(()=>[s("withBase")]),_:1}),s(" helper to prepend "),k,s(" for you:")]),_,e("div",x,[w,e("p",null,[s("Config reference: "),n(a,{to:"/reference/plugin-api.html#alias"},{default:l(()=>[s("alias")]),_:1})])])])}const V=t(d,[["render",A],["__file","assets.html.vue"]]);export{V as default}; diff --git a/assets/back-to-top.html-3mn9vy9t.js b/assets/back-to-top.html-3mn9vy9t.js new file mode 100644 index 000000000..f6415273c --- /dev/null +++ b/assets/back-to-top.html-3mn9vy9t.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6c6e4840","path":"/zh/reference/plugin/back-to-top.html","title":"back-to-top","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"样式","slug":"样式","link":"#样式","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/back-to-top.md"}');export{e as data}; diff --git a/assets/back-to-top.html-ETMm9zTr.js b/assets/back-to-top.html-ETMm9zTr.js new file mode 100644 index 000000000..0b12d48e9 --- /dev/null +++ b/assets/back-to-top.html-ETMm9zTr.js @@ -0,0 +1,13 @@ +import{_ as n,r as e,o as l,c as o,d as p,a as s,b as t,e as c}from"./app-eU2v8o1B.js";const i={},r=s("h1",{id:"back-to-top",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#back-to-top","aria-hidden":"true"},"#"),t(" back-to-top")],-1),d=c(`<img src="@alias/image.png" alt="Image from path alias"> +
This plugin will add a back to top button to your site. The button will be displayed in the bottom right corner of the page when scrolling down. By clicking the button, the page will scroll to the top.
This plugin has been integrated into the default theme.
# Usage
npm i -D @vuepress/plugin-back-to-top@next +
import { backToTopPlugin } from '@vuepress/plugin-back-to-top' + +export default { + plugins: [backToTopPlugin()], +} +
# Styles
You can customize the style of the back to top button via CSS variables:
`,8);function D(u,y){const a=e("NpmBadge");return l(),o("div",null,[r,p(a,{package:"@vuepress/plugin-back-to-top"}),d])}const h=n(i,[["render",D],["__file","back-to-top.html.vue"]]);export{h as default}; diff --git a/assets/back-to-top.html-SBrZWHGE.js b/assets/back-to-top.html-SBrZWHGE.js new file mode 100644 index 000000000..26f46af9d --- /dev/null +++ b/assets/back-to-top.html-SBrZWHGE.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6474e88f","path":"/reference/plugin/back-to-top.html","title":"back-to-top","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Styles","slug":"styles","link":"#styles","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/back-to-top.md"}');export{e as data}; diff --git a/assets/back-to-top.html-U82tNcMw.js b/assets/back-to-top.html-U82tNcMw.js new file mode 100644 index 000000000..0f4d54b88 --- /dev/null +++ b/assets/back-to-top.html-U82tNcMw.js @@ -0,0 +1,13 @@ +import{_ as n,r as e,o as l,c as o,d as p,a as s,b as c,e as r}from"./app-eU2v8o1B.js";const t={},i=s("h1",{id:"back-to-top",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#back-to-top","aria-hidden":"true"},"#"),c(" back-to-top")],-1),d=r(`:root { + --back-to-top-z-index: 5; + + --back-to-top-color: #3eaf7c; + --back-to-top-color-hover: #71cda3; +} +
该插件会给你的站点添加一个 返回顶部 按钮。当页面向下滚动时,该按钮会显示在页面的右下角,点击它就会滚动到页面顶部。
该插件已经集成到默认主题中。
# 使用方法
npm i -D @vuepress/plugin-back-to-top@next +
import { backToTopPlugin } from '@vuepress/plugin-back-to-top' + +export default { + plugins: [backToTopPlugin()], +} +
# 样式
你可以通过 CSS 变量来自定义 返回顶部 按钮的样式:
`,8);function D(u,y){const a=e("NpmBadge");return l(),o("div",null,[i,p(a,{package:"@vuepress/plugin-back-to-top"}),d])}const b=n(t,[["render",D],["__file","back-to-top.html.vue"]]);export{b as default}; diff --git a/assets/bundler.html-1Lcboibq.js b/assets/bundler.html-1Lcboibq.js new file mode 100644 index 000000000..fab5d033c --- /dev/null +++ b/assets/bundler.html-1Lcboibq.js @@ -0,0 +1,21 @@ +import{_ as c,r as o,o as i,c as d,a as s,b as e,d as n,w as a,e as u}from"./app-eU2v8o1B.js";const D={},y=s("h1",{id:"bundler",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#bundler","aria-hidden":"true"},"#"),e(" Bundler")],-1),b={href:"https://webpack.js.org/",target:"_blank",rel:"noopener noreferrer"},h={href:"https://vitejs.dev/",target:"_blank",rel:"noopener noreferrer"},v=s("h2",{id:"choose-a-bundler",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#choose-a-bundler","aria-hidden":"true"},"#"),e(" Choose a Bundler")],-1),m={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},C={href:"https://www.npmjs.com/package/vuepress-webpack",target:"_blank",rel:"noopener noreferrer"},_=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"pnpm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"remove"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress")]),e(` +`),s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"pnpm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"add"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#569CD6"}},"-D"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress-webpack@next")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),f=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"yarn"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"remove"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress")]),e(` +`),s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"yarn"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"add"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#569CD6"}},"-D"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress-webpack@next")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),k=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"npm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"uninstall"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress")]),e(` +`),s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"npm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"install"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#569CD6"}},"-D"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress-webpack@next")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),g={class:"custom-container tip"},E=s("p",{class:"custom-container-title"},"TIP",-1),w={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},x={href:"https://www.npmjs.com/package/vuepress-vite",target:"_blank",rel:"noopener noreferrer"},A=s("h2",{id:"configure-bundler",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#configure-bundler","aria-hidden":"true"},"#"),e(" Configure Bundler")],-1),B=s("p",null,"Generally, you could use a bundler without extra configuration, because we have already configured them properly to work with VuePress.",-1),V=u(`:root { + --back-to-top-z-index: 5; + + --back-to-top-color: #3eaf7c; + --back-to-top-color-hover: #71cda3; +} +
`,1);function F(P,j){const l=o("ExternalLinkIcon"),r=o("CodeGroupItem"),p=o("CodeGroup"),t=o("RouterLink");return i(),d("div",null,[y,s("p",null,[e("VuePress has been using "),s("a",b,[e("Webpack"),n(l)]),e(" as the bundler to dev and build sites. Since VuePress v2, other bundlers are also supported, and now we are using "),s("a",h,[e("Vite"),n(l)]),e(" as the default bundler. Of course, you can still choose to use Webpack.")]),v,s("p",null,[e("When using the "),s("a",m,[e("vuepress"),n(l)]),e(" package, Vite bundler is installed and used automatically.")]),s("p",null,[e("If you want to use Webpack bundler instead, you can remove it and install the "),s("a",C,[e("vuepress-webpack"),n(l)]),e(" package instead:")]),n(p,null,{default:a(()=>[n(r,{title:"PNPM",active:""},{default:a(()=>[_]),_:1}),n(r,{title:"YARN"},{default:a(()=>[f]),_:1}),n(r,{title:"NPM"},{default:a(()=>[k]),_:1})]),_:1}),s("div",g,[E,s("p",null,[e("In fact, the "),s("a",w,[e("vuepress"),n(l)]),e(" package is just a wrapper of the "),s("a",x,[e("vuepress-vite"),n(l)]),e(" package.")])]),A,B,s("p",null,[e("You can configure bundler for advanced usage via the "),n(t,{to:"/reference/config.html#bundler"},{default:a(()=>[e("bundler")]),_:1}),e(" option:")]),V,s("p",null,[e("You can refer to "),n(t,{to:"/reference/bundler/vite.html"},{default:a(()=>[e("Bundlers > Vite")]),_:1}),e(" and "),n(t,{to:"/reference/bundler/webpack.html"},{default:a(()=>[e("Bundlers > Webpack")]),_:1}),e(" to check out all options of the corresponding bundler.")])])}const N=c(D,[["render",F],["__file","bundler.html.vue"]]);export{N as default}; diff --git a/assets/bundler.html-3HPSreHe.js b/assets/bundler.html-3HPSreHe.js new file mode 100644 index 000000000..ffc3d13a6 --- /dev/null +++ b/assets/bundler.html-3HPSreHe.js @@ -0,0 +1,21 @@ +import{_ as c,r as o,o as i,c as D,a as s,b as e,d as n,w as l,e as d}from"./app-eU2v8o1B.js";const u={},y=s("h1",{id:"打包工具",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#打包工具","aria-hidden":"true"},"#"),e(" 打包工具")],-1),v={href:"https://webpack.js.org/",target:"_blank",rel:"noopener noreferrer"},m={href:"https://vitejs.dev/",target:"_blank",rel:"noopener noreferrer"},b=s("h2",{id:"选择一个打包工具",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#选择一个打包工具","aria-hidden":"true"},"#"),e(" 选择一个打包工具")],-1),h={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},C={href:"https://www.npmjs.com/package/vuepress-webpack",target:"_blank",rel:"noopener noreferrer"},_=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"pnpm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"uninstall"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress")]),e(` +`),s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"pnpm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"add"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#569CD6"}},"-D"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress-webpack@next")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),k=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"yarn"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"remove"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress")]),e(` +`),s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"yarn"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"add"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#569CD6"}},"-D"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress-webpack@next")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),E=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"npm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"uninstall"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress")]),e(` +`),s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"npm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"install"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#569CD6"}},"-D"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress-webpack@next")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),f={class:"custom-container tip"},g=s("p",{class:"custom-container-title"},"提示",-1),w={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},x={href:"https://www.npmjs.com/package/vuepress-vite",target:"_blank",rel:"noopener noreferrer"},A=s("h2",{id:"配置打包工具",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#配置打包工具","aria-hidden":"true"},"#"),e(" 配置打包工具")],-1),V=s("p",null,"一般情况下,你不要任何额外配置就可以使用打包工具,因为我们已经帮你配置好了它们。",-1),F=d(`import { viteBundler } from 'vuepress' +// import { webpackBundler } from 'vuepress-webpack' + +export default { + bundler: viteBundler({ + vuePluginOptions: { + template: { + compilerOptions: { + isCustomElement: (tag) => tag === 'center', + }, + }, + }, + }), +} +
`,1);function N(j,B){const a=o("ExternalLinkIcon"),r=o("CodeGroupItem"),p=o("CodeGroup"),t=o("RouterLink");return i(),D("div",null,[y,s("p",null,[e("VuePress 一直以来都在使用 "),s("a",v,[e("Webpack"),n(a)]),e(" 作为打包工具来进行网站的开发和构建。从 VuePress v2 开始,我们还支持使用其他的打包工具,并且现在使用 "),s("a",m,[e("Vite"),n(a)]),e(" 作为默认的打包工具。当然,你仍然可以选择使用 Webpack 。")]),b,s("p",null,[e("在使用 "),s("a",h,[e("vuepress"),n(a)]),e(" 包时,会自动安装和使用 Vite 打包工具。")]),s("p",null,[e("如果你想改为使用 Webpack 打包工具,那么你可以移除它,改为安装 "),s("a",C,[e("vuepress-webpack"),n(a)]),e(" 包:")]),n(p,null,{default:l(()=>[n(r,{title:"PNPM",active:""},{default:l(()=>[_]),_:1}),n(r,{title:"YARN"},{default:l(()=>[k]),_:1}),n(r,{title:"NPM"},{default:l(()=>[E]),_:1})]),_:1}),s("div",f,[g,s("p",null,[e("实际上, "),s("a",w,[e("vuepress"),n(a)]),e(" 包只是 "),s("a",x,[e("vuepress-vite"),n(a)]),e(" 包的一个封装而已。")])]),A,V,s("p",null,[e("通过 "),n(t,{to:"/zh/reference/config.html#bundler"},{default:l(()=>[e("bundler")]),_:1}),e(" 配置项,你可以对打包工具进行进阶配置:")]),F,s("p",null,[e("你可以参考 "),n(t,{to:"/zh/reference/bundler/vite.html"},{default:l(()=>[e("打包工具 > Vite")]),_:1}),e(" 和 "),n(t,{to:"/zh/reference/bundler/webpack.html"},{default:l(()=>[e("打包工具 > Webpack")]),_:1}),e(" 来查看对应打包工具的所有配置项。")])])}const G=c(u,[["render",N],["__file","bundler.html.vue"]]);export{G as default}; diff --git a/assets/bundler.html-S4_5muti.js b/assets/bundler.html-S4_5muti.js new file mode 100644 index 000000000..4d306d9da --- /dev/null +++ b/assets/bundler.html-S4_5muti.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6f1f3595","path":"/guide/bundler.html","title":"Bundler","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Choose a Bundler","slug":"choose-a-bundler","link":"#choose-a-bundler","children":[]},{"level":2,"title":"Configure Bundler","slug":"configure-bundler","link":"#configure-bundler","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"guide/bundler.md"}');export{e as data}; diff --git a/assets/bundler.html-vrL6KUGX.js b/assets/bundler.html-vrL6KUGX.js new file mode 100644 index 000000000..f7bd19751 --- /dev/null +++ b/assets/bundler.html-vrL6KUGX.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-75d28a04","path":"/zh/guide/bundler.html","title":"打包工具","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"选择一个打包工具","slug":"选择一个打包工具","link":"#选择一个打包工具","children":[]},{"level":2,"title":"配置打包工具","slug":"配置打包工具","link":"#配置打包工具","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/guide/bundler.md"}');export{e as data}; diff --git a/assets/cli.html-LDAEB0aD.js b/assets/cli.html-LDAEB0aD.js new file mode 100644 index 000000000..2e3817131 --- /dev/null +++ b/assets/cli.html-LDAEB0aD.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-9beb15b6","path":"/zh/reference/cli.html","title":"命令行接口","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"dev","slug":"dev","link":"#dev","children":[]},{"level":2,"title":"build","slug":"build","link":"#build","children":[]},{"level":2,"title":"info","slug":"info","link":"#info","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/cli.md"}');export{e as data}; diff --git a/assets/cli.html-UOo9rMKI.js b/assets/cli.html-UOo9rMKI.js new file mode 100644 index 000000000..baf9f6cb6 --- /dev/null +++ b/assets/cli.html-UOo9rMKI.js @@ -0,0 +1,46 @@ +import{_ as c,r as p,o as t,c as r,d as a,a as n,b as s,w as y,e as o}from"./app-eU2v8o1B.js";const i={},C=n("h1",{id:"command-line-interface",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#command-line-interface","aria-hidden":"true"},"#"),s(" Command Line Interface")],-1),d={href:"https://www.npmjs.com/package/@vuepress/cli",target:"_blank",rel:"noopener noreferrer"},E={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},u=o(`import { viteBundler } from 'vuepress' +// import { webpackBundler } from 'vuepress-webpack' + +export default { + bundler: viteBundler({ + vuePluginOptions: { + template: { + compilerOptions: { + isCustomElement: (tag) => tag === 'center', + }, + }, + }, + }), +} +
Run
vuepress --help
to get following help messages:`,2),v={class:"custom-container tip"},m=n("p",{class:"custom-container-title"},"TIP",-1),h={href:"https://www.npmjs.com/package/debug",target:"_blank",rel:"noopener noreferrer"},b=n("p",null,[s("Set environment variable "),n("code",null,"DEBUG=vuepress*"),s(" to enable debug logs.")],-1),A=o(`Usage: + $ vuepress <command> [options] + +Commands: + dev [sourceDir] Start development server + build [sourceDir] Build to static site + info Display environment information + +For more info, run any command with the \`--help\` flag: + $ vuepress dev --help + $ vuepress build --help + $ vuepress info --help + +Options: + -v, --version Display version number + -h, --help Display this message +
# dev
Start a development server to develop your VuePress site locally.
Usage: + $ vuepress dev [sourceDir] + +Options: + -c, --config <config> Set path to config file + -p, --port <port> Use specified port (default: 8080) + -t, --temp <temp> Set the directory of the temporary files + --host <host> Use specified host (default: 0.0.0.0) + --cache <cache> Set the directory of the cache files + --clean-temp Clean the temporary files before dev + --clean-cache Clean the cache files before dev + --open Open browser when ready + --debug Enable debug mode + --no-watch Disable watching page and config files (default: true) + -v, --version Display version number + -h, --help Display this message +
TIP
Options set by CLI will override those options with the same name in your config file.
# build
`,5),f=o(`Usage: + $ vuepress build [sourceDir] + +Options: + -c, --config <config> Set path to config file + -d, --dest <dest> Set the directory build output (default: .vuepress/dist) + -t, --temp <temp> Set the directory of the temporary files + --cache <cache> Set the directory of the cache files + --clean-temp Clean the temporary files before build + --clean-cache Clean the cache files before build + --debug Enable debug mode + -v, --version Display version number + -h, --help Display this message +
TIP
Options set by CLI will override those options with the same name in your config file.
# info
Outputs information about your system and dependencies.
This command would be helpful when you want to check your environment or report an issue.
`,5);function g(_,k){const e=p("NpmBadge"),l=p("ExternalLinkIcon"),D=p("RouterLink");return t(),r("div",null,[C,a(e,{package:"@vuepress/cli"}),n("p",null,[s("VuePress CLI is provided by "),n("a",d,[s("@vuepress/cli"),a(l)]),s(" package. It is included by the "),n("a",E,[s("vuepress"),a(l)]),s(" package, and you can also install it separately.")]),u,n("div",v,[m,n("p",null,[s("VuePress is using "),n("a",h,[s("debug"),a(l)]),s(" module.")]),b]),A,n("p",null,[s("Build your VuePress site to static files, which are ready for "),a(D,{to:"/guide/deployment.html"},{default:y(()=>[s("deployment")]),_:1}),s(".")]),f])}const x=c(i,[["render",g],["__file","cli.html.vue"]]);export{x as default}; diff --git a/assets/cli.html-oJwwPLzh.js b/assets/cli.html-oJwwPLzh.js new file mode 100644 index 000000000..debe5258c --- /dev/null +++ b/assets/cli.html-oJwwPLzh.js @@ -0,0 +1,46 @@ +import{_ as c,r as p,o as r,c as t,d as a,a as n,b as s,w as y,e as o}from"./app-eU2v8o1B.js";const i={},C=n("h1",{id:"命令行接口",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#命令行接口","aria-hidden":"true"},"#"),s(" 命令行接口")],-1),d={href:"https://www.npmjs.com/package/@vuepress/cli",target:"_blank",rel:"noopener noreferrer"},E={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},v=o(`执行
vuepress --help
来获取下列帮助信息:`,2),u={class:"custom-container tip"},m=n("p",{class:"custom-container-title"},"提示",-1),h={href:"https://www.npmjs.com/package/debug",target:"_blank",rel:"noopener noreferrer"},b=n("p",null,[s("设置环境变量 "),n("code",null,"DEBUG=vuepress*"),s(" 可以启用调试日志。")],-1),A=o(`Usage: + $ vuepress <command> [options] + +Commands: + dev [sourceDir] Start development server + build [sourceDir] Build to static site + info Display environment information + +For more info, run any command with the \`--help\` flag: + $ vuepress dev --help + $ vuepress build --help + $ vuepress info --help + +Options: + -v, --version Display version number + -h, --help Display this message +
# dev
启动一个开发服务器,在本地开发你的 VuePress 站点。
Usage: + $ vuepress dev [sourceDir] + +Options: + -c, --config <config> Set path to config file + -p, --port <port> Use specified port (default: 8080) + -t, --temp <temp> Set the directory of the temporary files + --host <host> Use specified host (default: 0.0.0.0) + --cache <cache> Set the directory of the cache files + --clean-temp Clean the temporary files before dev + --clean-cache Clean the cache files before dev + --open Open browser when ready + --debug Enable debug mode + --no-watch Disable watching page and config files (default: true) + -v, --version Display version number + -h, --help Display this message +
提示
通过命令行设置的配置项,会覆盖你配置文件中的同名配置项。
# build
`,5),f=o(`Usage: + $ vuepress build [sourceDir] + +Options: + -c, --config <config> Set path to config file + -d, --dest <dest> Set the directory build output (default: .vuepress/dist) + -t, --temp <temp> Set the directory of the temporary files + --cache <cache> Set the directory of the cache files + --clean-temp Clean the temporary files before build + --clean-cache Clean the cache files before build + --debug Enable debug mode + -v, --version Display version number + -h, --help Display this message +
提示
通过命令行设置的配置项,会覆盖你配置文件中的同名配置项。
# info
输出当前系统和依赖相关的信息。
在你想要检查你的环境,或者提交 Issue 时候,可以使用该命令。
`,5);function g(_,k){const e=p("NpmBadge"),l=p("ExternalLinkIcon"),D=p("RouterLink");return r(),t("div",null,[C,a(e,{package:"@vuepress/cli"}),n("p",null,[s("VuePress 命令行接口是由 "),n("a",d,[s("@vuepress/cli"),a(l)]),s(" 包提供的。它包含在 "),n("a",E,[s("vuepress"),a(l)]),s(" 包之中,当然你也可以单独安装它。")]),v,n("div",u,[m,n("p",null,[s("VuePress 使用了 "),n("a",h,[s("debug"),a(l)]),s(" 模块。")]),b]),A,n("p",null,[s("将你的 VuePress 站点构建成静态文件,以便你进行后续"),a(D,{to:"/zh/guide/deployment.html"},{default:y(()=>[s("部署")]),_:1}),s("。")]),f])}const w=c(i,[["render",g],["__file","cli.html.vue"]]);export{w as default}; diff --git a/assets/cli.html-t2GuSTvN.js b/assets/cli.html-t2GuSTvN.js new file mode 100644 index 000000000..3ae0edf80 --- /dev/null +++ b/assets/cli.html-t2GuSTvN.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-a951be94","path":"/reference/cli.html","title":"Command Line Interface","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"dev","slug":"dev","link":"#dev","children":[]},{"level":2,"title":"build","slug":"build","link":"#build","children":[]},{"level":2,"title":"info","slug":"info","link":"#info","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/cli.md"}');export{e as data}; diff --git a/assets/client-api.html-5X1GY6z7.js b/assets/client-api.html-5X1GY6z7.js new file mode 100644 index 000000000..70fa09aa5 --- /dev/null +++ b/assets/client-api.html-5X1GY6z7.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-332177d5","path":"/zh/reference/client-api.html","title":"客户端 API","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","children":[{"level":3,"title":"usePageData","slug":"usepagedata","link":"#usepagedata","children":[]},{"level":3,"title":"usePageFrontmatter","slug":"usepagefrontmatter","link":"#usepagefrontmatter","children":[]},{"level":3,"title":"usePageHead","slug":"usepagehead","link":"#usepagehead","children":[]},{"level":3,"title":"usePageHeadTitle","slug":"usepageheadtitle","link":"#usepageheadtitle","children":[]},{"level":3,"title":"usePageLang","slug":"usepagelang","link":"#usepagelang","children":[]},{"level":3,"title":"useRouteLocale","slug":"useroutelocale","link":"#useroutelocale","children":[]},{"level":3,"title":"useSiteData","slug":"usesitedata","link":"#usesitedata","children":[]},{"level":3,"title":"useSiteLocaleData","slug":"usesitelocaledata","link":"#usesitelocaledata","children":[]}]},{"level":2,"title":"工具函数","slug":"工具函数","link":"#工具函数","children":[{"level":3,"title":"defineClientConfig","slug":"defineclientconfig","link":"#defineclientconfig","children":[]},{"level":3,"title":"withBase","slug":"withbase","link":"#withbase","children":[]}]},{"level":2,"title":"常量","slug":"常量","link":"#常量","children":[{"level":3,"title":"__VUEPRESS_VERSION__","slug":"vuepress-version","link":"#vuepress-version","children":[]},{"level":3,"title":"__VUEPRESS_BASE__","slug":"vuepress-base","link":"#vuepress-base","children":[]},{"level":3,"title":"__VUEPRESS_DEV__","slug":"vuepress-dev","link":"#vuepress-dev","children":[]},{"level":3,"title":"__VUEPRESS_SSR__","slug":"vuepress-ssr","link":"#vuepress-ssr","children":[]}]},{"level":2,"title":"进阶能力","slug":"进阶能力","link":"#进阶能力","children":[{"level":3,"title":"resolvers","slug":"resolvers","link":"#resolvers","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/client-api.md"}');export{e as data}; diff --git a/assets/client-api.html-Hz3O_EAk.js b/assets/client-api.html-Hz3O_EAk.js new file mode 100644 index 000000000..acde0bea9 --- /dev/null +++ b/assets/client-api.html-Hz3O_EAk.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-a84e51b8","path":"/reference/client-api.html","title":"Client API","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","children":[{"level":3,"title":"usePageData","slug":"usepagedata","link":"#usepagedata","children":[]},{"level":3,"title":"usePageFrontmatter","slug":"usepagefrontmatter","link":"#usepagefrontmatter","children":[]},{"level":3,"title":"usePageHead","slug":"usepagehead","link":"#usepagehead","children":[]},{"level":3,"title":"usePageHeadTitle","slug":"usepageheadtitle","link":"#usepageheadtitle","children":[]},{"level":3,"title":"usePageLang","slug":"usepagelang","link":"#usepagelang","children":[]},{"level":3,"title":"useRouteLocale","slug":"useroutelocale","link":"#useroutelocale","children":[]},{"level":3,"title":"useSiteData","slug":"usesitedata","link":"#usesitedata","children":[]},{"level":3,"title":"useSiteLocaleData","slug":"usesitelocaledata","link":"#usesitelocaledata","children":[]}]},{"level":2,"title":"Helpers","slug":"helpers","link":"#helpers","children":[{"level":3,"title":"defineClientConfig","slug":"defineclientconfig","link":"#defineclientconfig","children":[]},{"level":3,"title":"withBase","slug":"withbase","link":"#withbase","children":[]}]},{"level":2,"title":"Constants","slug":"constants","link":"#constants","children":[{"level":3,"title":"__VUEPRESS_VERSION__","slug":"vuepress-version","link":"#vuepress-version","children":[]},{"level":3,"title":"__VUEPRESS_BASE__","slug":"vuepress-base","link":"#vuepress-base","children":[]},{"level":3,"title":"__VUEPRESS_DEV__","slug":"vuepress-dev","link":"#vuepress-dev","children":[]},{"level":3,"title":"__VUEPRESS_SSR__","slug":"vuepress-ssr","link":"#vuepress-ssr","children":[]}]},{"level":2,"title":"Advanced","slug":"advanced","link":"#advanced","children":[{"level":3,"title":"resolvers","slug":"resolvers","link":"#resolvers","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/client-api.md"}');export{e as data}; diff --git a/assets/client-api.html-jr_tX_nU.js b/assets/client-api.html-jr_tX_nU.js new file mode 100644 index 000000000..61ebd8451 --- /dev/null +++ b/assets/client-api.html-jr_tX_nU.js @@ -0,0 +1,14 @@ +import{_ as c,r as o,o as d,c as u,d as a,a as e,b as s,w as l,e as t}from"./app-eU2v8o1B.js";const h={},D=e("h1",{id:"client-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#client-api","aria-hidden":"true"},"#"),s(" Client API")],-1),f={href:"https://www.npmjs.com/package/@vuepress/client",target:"_blank",rel:"noopener noreferrer"},_=e("h2",{id:"composition-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#composition-api","aria-hidden":"true"},"#"),s(" Composition API")],-1),g=e("h3",{id:"usepagedata",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#usepagedata","aria-hidden":"true"},"#"),s(" usePageData")],-1),v=e("li",null,[e("p",null,"Details:"),e("p",null,"Returns the page data ref object of current page.")],-1),y=e("p",null,"Also see:",-1),b=e("h3",{id:"usepagefrontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#usepagefrontmatter","aria-hidden":"true"},"#"),s(" usePageFrontmatter")],-1),m=e("ul",null,[e("li",null,[e("p",null,"Details:"),e("p",null,"Returns the frontmatter ref object of current page."),e("p",null,[s("The value is the "),e("code",null,"frontmatter"),s(" property of the page data.")])])],-1),C=e("h3",{id:"usepagehead",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#usepagehead","aria-hidden":"true"},"#"),s(" usePageHead")],-1),E=e("p",null,"Details:",-1),x=e("p",null,"Returns the head config ref object of current page.",-1),k=t('# usePageHeadTitle
Details:
Returns the head title ref object of current page.
The value is obtained by joining the page title and site title.
# usePageLang
Details:
Returns the language ref object of current page.
The value is the
lang
property of the page data.# useRouteLocale
',5),A=e("p",null,"Details:",-1),P=e("p",null,"Returns the locale path ref object of current route.",-1),R=t('# useSiteData
Details:
Returns the site data ref object.
# useSiteLocaleData
Details:
Returns the site data ref object of current locale.
The properties of current locale have been merged into the root-level properties.
# Helpers
# defineClientConfig
',6),F=e("p",null,"Details:",-1),S=e("p",null,"Also see:",-1),T=e("h3",{id:"withbase",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#withbase","aria-hidden":"true"},"#"),s(" withBase")],-1),w=e("p",null,"Details:",-1),j=e("p",null,"Also see:",-1),V=t(`# Constants
There are some constants that available in the client side code.
To shim the types of these constants in client side code, add
@vuepress/client/types
to yourtsconfig.json
:{ + "compilerOptions": { + "types": ["@vuepress/client/types"] + } +} +
#
__VUEPRESS_VERSION__
Type:
string
Details:
Version of VuePress core package.
#
`,7),B=e("li",null,[e("p",null,[s("Type: "),e("code",null,"string")])],-1),L=e("p",null,"Details:",-1),N=t('__VUEPRESS_BASE__
#
__VUEPRESS_DEV__
Type:
boolean
Details:
An environment flag indicating whether it is currently running in
dev
mode.#
__VUEPRESS_SSR__
Type:
boolean
Details:
An environment flag indicating whether it is currently running in server-side-rendering (SSR) build.
# Advanced
',5),I={id:"resolvers",tabindex:"-1"},q=e("a",{class:"header-anchor",href:"#resolvers","aria-hidden":"true"},"#",-1),H=t(`
Type:
Record<string, Function>
Details:
An reactive object, methods of which determining how to resolve global computed.
Example:
Customizing the format of
<title>
in client config file:import { defineClientConfig, resolvers } from '@vuepress/client' + +export default defineClientConfig({ + enhance({ app, router, siteData }) { + resolvers.resolvePageHeadTitle = (page, siteLocale) => + \`\${siteLocale.title} > \${page.title}\` + }, +}) +
`,4);function U(G,O){const i=o("NpmBadge"),r=o("ExternalLinkIcon"),n=o("RouterLink"),p=o("Badge");return d(),u("div",null,[D,a(i,{package:"@vuepress/client"}),e("p",null,[s("Client API is provided by "),e("a",f,[s("@vuepress/client"),a(r)]),s(" package, which is used for developing client files.")]),_,g,e("ul",null,[v,e("li",null,[y,e("ul",null,[e("li",null,[a(n,{to:"/reference/node-api.html#data"},{default:l(()=>[s("Node API > Page Properties > data")]),_:1})]),e("li",null,[a(n,{to:"/reference/plugin-api.html#extendspage"},{default:l(()=>[s("Plugin API > extendsPage")]),_:1})])])])]),b,m,C,e("ul",null,[e("li",null,[E,x,e("p",null,[s("The value is obtained by merging and deduplicating "),a(n,{to:"/reference/frontmatter.html#head"},{default:l(()=>[s("head")]),_:1}),s(" frontmatter and "),a(n,{to:"/reference/config.html#head"},{default:l(()=>[s("head")]),_:1}),s(" config.")])])]),k,e("ul",null,[e("li",null,[A,P,e("p",null,[s("The value is one of the keys of the "),a(n,{to:"/reference/config.html#locales"},{default:l(()=>[s("locales")]),_:1}),s(" config.")])])]),R,e("ul",null,[e("li",null,[F,e("p",null,[s("Helper for creating "),a(n,{to:"/reference/plugin-api.html#clientconfigfile"},{default:l(()=>[s("clientConfigFile")]),_:1}),s(".")])]),e("li",null,[S,e("ul",null,[e("li",null,[a(n,{to:"/advanced/cookbook/usage-of-client-config.html"},{default:l(()=>[s("Advanced > Cookbook > Usage of Client Config")]),_:1})])])])]),T,e("ul",null,[e("li",null,[w,e("p",null,[s("Prefix URL with site "),a(n,{to:"/reference/config.html#base"},{default:l(()=>[s("base")]),_:1}),s(".")])]),e("li",null,[j,e("ul",null,[e("li",null,[a(n,{to:"/guide/assets.html#base-helper"},{default:l(()=>[s("Guide > Assets > Base Helper")]),_:1})])])])]),V,e("ul",null,[B,e("li",null,[L,e("p",null,[s("The "),a(n,{to:"/reference/config.html#base"},{default:l(()=>[s("base")]),_:1}),s(" option from config.")])])]),N,e("h3",I,[q,s(" resolvers "),a(p,{text:"experimental"})]),H])}const z=c(h,[["render",U],["__file","client-api.html.vue"]]);export{z as default}; diff --git a/assets/client-api.html-uhd2B6Du.js b/assets/client-api.html-uhd2B6Du.js new file mode 100644 index 000000000..270d2f74b --- /dev/null +++ b/assets/client-api.html-uhd2B6Du.js @@ -0,0 +1,14 @@ +import{_ as c,r as t,o as d,c as u,d as a,a as e,b as s,w as n,e as o}from"./app-eU2v8o1B.js";const h={},D=e("h1",{id:"客户端-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#客户端-api","aria-hidden":"true"},"#"),s(" 客户端 API")],-1),_={href:"https://www.npmjs.com/package/@vuepress/client",target:"_blank",rel:"noopener noreferrer"},f=e("h2",{id:"composition-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#composition-api","aria-hidden":"true"},"#"),s(" Composition API")],-1),y=e("h3",{id:"usepagedata",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#usepagedata","aria-hidden":"true"},"#"),s(" usePageData")],-1),v=e("li",null,[e("p",null,"详情:"),e("p",null,"返回当前页面数据的 Ref 对象。")],-1),g=e("p",null,"参考:",-1),C=e("h3",{id:"usepagefrontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#usepagefrontmatter","aria-hidden":"true"},"#"),s(" usePageFrontmatter")],-1),m=e("ul",null,[e("li",null,[e("p",null,"详情:"),e("p",null,"返回当前页面 Frontmatter 的 Ref 对象。"),e("p",null,[s("它的值是页面数据的 "),e("code",null,"frontmatter"),s(" 属性。")])])],-1),b=e("h3",{id:"usepagehead",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#usepagehead","aria-hidden":"true"},"#"),s(" usePageHead")],-1),E=e("p",null,"详情:",-1),x=e("p",null,"返回当前页面 Head 配置的 Ref 对象。",-1),k=o('DANGER
resolvers
will affect the basic functionality of VuePress. Please make sure you have fully understood its purpose before modifying it.# usePageHeadTitle
详情:
返回当前页面 Head 中的标题的 Ref 对象。
它的值是连接页面标题和站点标题后得到的。
# usePageLang
详情:
返回当前页面语言的 Ref 对象。
它的值是页面数据的
lang
属性。# useRouteLocale
',5),P=e("p",null,"详情:",-1),R=e("p",null,"返回当前路由对应的 locale path 的 Ref 对象。",-1),F=o('# useSiteData
详情:
返回站点数据的 Ref 对象。
# useSiteLocaleData
详情:
返回当前 locale 的站点数据的 Ref 对象。
当前 locale 中的配置已经合并到顶层配置中。
# 工具函数
# defineClientConfig
',6),S=e("p",null,"详情:",-1),A=e("p",null,"参考:",-1),V=e("h3",{id:"withbase",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#withbase","aria-hidden":"true"},"#"),s(" withBase")],-1),z=e("p",null,"详情:",-1),B=e("p",null,"参考:",-1),L=o(`# 常量
在客户端代码中有一些常量可以使用。
如果想要把这些常量的类型定义补充到你的代码环境中,请将
@vuepress/client/types
添加到你的tsconfig.json
里:{ + "compilerOptions": { + "types": ["@vuepress/client/types"] + } +} +
#
__VUEPRESS_VERSION__
类型:
string
详情:
VuePress Core 的版本号。
#
`,7),w=e("li",null,[e("p",null,[s("类型: "),e("code",null,"string")])],-1),I=e("p",null,"详情:",-1),N=o('__VUEPRESS_BASE__
#
__VUEPRESS_DEV__
类型:
boolean
详情:
一个环境标记,用于标识当前是否运行在
dev
模式下。#
__VUEPRESS_SSR__
类型:
boolean
详情:
一个环境标记,用于标识当前是否运行在服务端渲染 (SSR) 环境下。
# 进阶能力
',5),q={id:"resolvers",tabindex:"-1"},H=e("a",{class:"header-anchor",href:"#resolvers","aria-hidden":"true"},"#",-1),U=o(`
类型:
Record<string, Function>
详情:
一个响应式对象,其中的方法决定了如何获取全局计算属性。
示例:
在客户端配置文件中自定义
<title>
的格式:import { defineClientConfig, resolvers } from '@vuepress/client' + +export default defineClientConfig({ + enhance({ app, router, siteData }) { + resolvers.resolvePageHeadTitle = (page, siteLocale) => + \`\${siteLocale.title} > \${page.title}\` + }, +}) +
`,4);function j(T,O){const i=t("NpmBadge"),p=t("ExternalLinkIcon"),l=t("RouterLink"),r=t("Badge");return d(),u("div",null,[D,a(i,{package:"@vuepress/client"}),e("p",null,[s("客户端 API 是由 "),e("a",_,[s("@vuepress/client"),a(p)]),s(" Package 提供的,用于开发客户端文件。")]),f,y,e("ul",null,[v,e("li",null,[g,e("ul",null,[e("li",null,[a(l,{to:"/zh/reference/node-api.html#data"},{default:n(()=>[s("Node API > Page 属性 > data")]),_:1})]),e("li",null,[a(l,{to:"/zh/reference/plugin-api.html#extendspage"},{default:n(()=>[s("插件 API > extendsPage")]),_:1})])])])]),C,m,b,e("ul",null,[e("li",null,[E,x,e("p",null,[s("它的值是合并 "),a(l,{to:"/zh/reference/frontmatter.html#head"},{default:n(()=>[s("head")]),_:1}),s(" Frontmatter 和 "),a(l,{to:"/zh/reference/config.html#head"},{default:n(()=>[s("head")]),_:1}),s(" 配置,并进行去重后得到的。")])])]),k,e("ul",null,[e("li",null,[P,R,e("p",null,[s("它的值是 "),a(l,{to:"/zh/reference/config.html#locales"},{default:n(()=>[s("locales")]),_:1}),s(" 配置的键之一。")])])]),F,e("ul",null,[e("li",null,[S,e("p",null,[s("帮助你创建 "),a(l,{to:"/zh/reference/plugin-api.html#clientconfigfile"},{default:n(()=>[s("clientConfigFile")]),_:1}),s(" 的工具函数。")])]),e("li",null,[A,e("ul",null,[e("li",null,[a(l,{to:"/zh/advanced/cookbook/usage-of-client-config.html"},{default:n(()=>[s("深入 > Cookbook > 客户端配置的使用方法")]),_:1})])])])]),V,e("ul",null,[e("li",null,[z,e("p",null,[s("在 URL 前添加站点 "),a(l,{to:"/zh/reference/config.html#base"},{default:n(()=>[s("base")]),_:1}),s(" 前缀。")])]),e("li",null,[B,e("ul",null,[e("li",null,[a(l,{to:"/zh/guide/assets.html#base-helper"},{default:n(()=>[s("指南 > 静态资源 > Base Helper")]),_:1})])])])]),L,e("ul",null,[w,e("li",null,[I,e("p",null,[s("配置中的 "),a(l,{to:"/zh/reference/config.html#base"},{default:n(()=>[s("base")]),_:1}),s(" 字段。")])])]),N,e("h3",q,[H,s(" resolvers "),a(r,{text:"实验性能力"})]),U])}const G=c(h,[["render",j],["__file","client-api.html.vue"]]);export{G as default}; diff --git a/assets/components.html-3ku0oebd.js b/assets/components.html-3ku0oebd.js new file mode 100644 index 000000000..4f934d478 --- /dev/null +++ b/assets/components.html-3ku0oebd.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2e97e858","path":"/reference/default-theme/components.html","title":"Built-in Components","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Badge","slug":"badge","link":"#badge","children":[]},{"level":2,"title":"CodeGroup","slug":"codegroup","link":"#codegroup","children":[]},{"level":2,"title":"CodeGroupItem","slug":"codegroupitem","link":"#codegroupitem","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/default-theme/components.md"}');export{e as data}; diff --git a/assets/components.html-4IDj5RAr.js b/assets/components.html-4IDj5RAr.js new file mode 100644 index 000000000..6196d1ef2 --- /dev/null +++ b/assets/components.html-4IDj5RAr.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-55453034","path":"/reference/components.html","title":"Built-in Components","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"ClientOnly","slug":"clientonly","link":"#clientonly","children":[]},{"level":2,"title":"Content","slug":"content","link":"#content","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/components.md"}');export{e as data}; diff --git a/assets/components.html-8e6s9jyW.js b/assets/components.html-8e6s9jyW.js new file mode 100644 index 000000000..57aef59df --- /dev/null +++ b/assets/components.html-8e6s9jyW.js @@ -0,0 +1,5 @@ +import{_ as a,r as l,o as r,c,d as o,a as e,b as n,w as d,e as p}from"./app-eU2v8o1B.js";const u={},h=e("h1",{id:"built-in-components",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#built-in-components","aria-hidden":"true"},"#"),n(" Built-in Components")],-1),m=p(`警告
resolvers
会直接影响 VuePress 的基础功能,在修改前请确保你已充分了解其用途。# ClientOnly
- Usage:
<ClientOnly> + <NonSsrFriendlyComponent /> +</ClientOnly> +
Details:
This component and its children will only be rendered in client-side. That means, it will not be rendered to HTML during build (SSR).
If a component is trying to access Browser / DOM APIs directly in
setup()
, an error will occur during build because those APIs are unavailable in Node.js environment. In such case, you could do either:
- Modify the component to only access Browser / DOM APIs in
onBeforeMount()
oronMounted()
hook.- Wrap the component with
<ClientOnly>
.# Content
Props:
- pageKey
- Type:
string
- Required:
false
Usage:
`,7),_=e("p",null,"Details:",-1),g=e("p",null,"This component will render the Markdown content of a page.",-1),y={href:"https://router.vuejs.org/api/#name-2",target:"_blank",rel:"noopener noreferrer"},v=e("code",null,"pageKey",-1),b=e("p",null,"This component is mainly for developing themes. You won't need it in most cases.",-1),f=e("p",null,"Also see:",-1);function k(x,D){const t=l("NpmBadge"),s=l("ExternalLinkIcon"),i=l("RouterLink");return r(),c("div",null,[h,o(t,{package:"@vuepress/client"}),m,e("ul",null,[e("li",null,[_,g,e("p",null,[n("The page key is the "),e("a",y,[n("name"),o(s)]),n(" of the page route. If the "),v,n(" prop is not provided, it will render the page of current route.")]),b]),e("li",null,[f,e("ul",null,[e("li",null,[o(i,{to:"/reference/node-api.html#key"},{default:d(()=>[n("Node API > Page Properties > key")]),_:1})])])])])])}const C=a(u,[["render",k],["__file","components.html.vue"]]);export{C as default}; diff --git a/assets/components.html-9ZVeijmS.js b/assets/components.html-9ZVeijmS.js new file mode 100644 index 000000000..53392885c --- /dev/null +++ b/assets/components.html-9ZVeijmS.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-551922c5","path":"/zh/reference/default-theme/components.html","title":"内置组件","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"Badge","slug":"badge","link":"#badge","children":[]},{"level":2,"title":"CodeGroup","slug":"codegroup","link":"#codegroup","children":[]},{"level":2,"title":"CodeGroupItem","slug":"codegroupitem","link":"#codegroupitem","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/default-theme/components.md"}');export{e as data}; diff --git a/assets/components.html-WqkyAXws.js b/assets/components.html-WqkyAXws.js new file mode 100644 index 000000000..03368f1e0 --- /dev/null +++ b/assets/components.html-WqkyAXws.js @@ -0,0 +1,32 @@ +import{_ as r,r as a,o as u,c as v,d as n,a as s,b as e,w as l,e as p}from"./app-eU2v8o1B.js";const m={},D=s("h1",{id:"内置组件",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#内置组件","aria-hidden":"true"},"#"),e(" 内置组件")],-1),b={id:"badge",tabindex:"-1"},h=s("a",{class:"header-anchor",href:"#badge","aria-hidden":"true"},"#",-1),g=p(`<Content page-key="v-xxxxxx" /> +
Props:
- type
- 类型:
'tip' | 'warning' | 'danger'
- 默认值:
'tip'
- text
- 类型:
string
- 默认值:
''
- vertical
- 类型:
'top' | 'middle' | 'bottom' | undefined
- 默认值:
undefined
示例:
输入
- VuePress - <Badge type="tip" text="v2" vertical="top" /> +- VuePress - <Badge type="warning" text="v2" vertical="middle" /> +- VuePress - <Badge type="danger" text="v2" vertical="bottom" /> +
输出
`,4),y=p(`# CodeGroup
详情:
CodeGroupItem 组件的 Wrapper 。
# CodeGroupItem
Props:
- title
- 类型:
string
- 是否必需:
true
- active
- 类型:
boolean
- 默认值:
false
详情:
该组件必须放置在 CodeGroup 组件的内部。
可以通过
active
Prop 来设置初始激活的元素。如果不设置,默认激活第一个元素。示例:
输入
<CodeGroup> + <CodeGroupItem title="PNPM"> + +\`\`\`bash:no-line-numbers +pnpm install +\`\`\` + + </CodeGroupItem> + + <CodeGroupItem title="YARN"> + +\`\`\`bash:no-line-numbers +yarn install +\`\`\` + + </CodeGroupItem> + + <CodeGroupItem title="NPM" active> + +\`\`\`bash:no-line-numbers +npm install +\`\`\` + + </CodeGroupItem> +</CodeGroup> +
输出
`,7),_=s("div",{class:"language-bash","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"pnpm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"install")]),e(` +`),s("span",{class:"line"})])])],-1),C=s("div",{class:"language-bash","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"yarn"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"install")]),e(` +`),s("span",{class:"line"})])])],-1),E=s("div",{class:"language-bash","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"npm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"install")]),e(` +`),s("span",{class:"line"})])])],-1),k={class:"custom-container warning"},x=s("p",{class:"custom-container-title"},"注意",-1),f=s("p",null,[e("你必须在 "),s("code",null,""),e(" 的开始标签和代码块之间添加一个空行,否则代码块无法被 Markdown 正确解析。")],-1),q=s("p",null,"所有内容首先都必须是合法的 Markdown ,然后才是一个 Vue SFC 。",-1);function A(G,P){const c=a("NpmBadge"),o=a("Badge"),t=a("CodeGroupItem"),d=a("CodeGroup"),i=a("RouterLink");return u(),v("div",null,[D,n(c,{package:"@vuepress/theme-default"}),s("h2",b,[h,e(" Badge "),n(o,{text:"badge"})]),g,s("ul",null,[s("li",null,[e("VuePress - "),n(o,{type:"tip",text:"v2",vertical:"top"})]),s("li",null,[e("VuePress - "),n(o,{type:"warning",text:"v2",vertical:"middle"})]),s("li",null,[e("VuePress - "),n(o,{type:"danger",text:"v2",vertical:"bottom"})])]),y,n(d,null,{default:l(()=>[n(t,{title:"PNPM"},{default:l(()=>[_]),_:1}),n(t,{title:"YARN"},{default:l(()=>[C]),_:1}),n(t,{title:"NPM",active:""},{default:l(()=>[E]),_:1})]),_:1}),s("div",k,[x,f,q,s("p",null,[e("了解更多: "),n(i,{to:"/zh/advanced/cookbook/markdown-and-vue-sfc.html"},{default:l(()=>[e("Cookbook > Markdown 与 Vue SFC")]),_:1})]),s("p",null,[e("或者你可以选择使用 "),n(i,{to:"/zh/reference/default-theme/markdown.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8"},{default:l(()=>[e("自定义容器")]),_:1}),e(" 。")])])])}const B=r(m,[["render",A],["__file","components.html.vue"]]);export{B as default}; diff --git a/assets/components.html-_1ap8ZIq.js b/assets/components.html-_1ap8ZIq.js new file mode 100644 index 000000000..e0558c53e --- /dev/null +++ b/assets/components.html-_1ap8ZIq.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5ca60897","path":"/zh/reference/components.html","title":"内置组件","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"ClientOnly","slug":"clientonly","link":"#clientonly","children":[]},{"level":2,"title":"Content","slug":"content","link":"#content","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/components.md"}');export{e as data}; diff --git a/assets/components.html-j4FRcZu1.js b/assets/components.html-j4FRcZu1.js new file mode 100644 index 000000000..7531e2417 --- /dev/null +++ b/assets/components.html-j4FRcZu1.js @@ -0,0 +1,5 @@ +import{_ as i,r as l,o as d,c,d as a,a as e,b as n,w as r,e as p}from"./app-eU2v8o1B.js";const u={},h=e("h1",{id:"内置组件",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#内置组件","aria-hidden":"true"},"#"),n(" 内置组件")],-1),_=p(` # ClientOnly
- 使用:
<ClientOnly> + <NonSsrFriendlyComponent /> +</ClientOnly> +
详情:
该组件和它的子元素只会在客户端被渲染。也就是说,它不会在构建 (SSR) 过程中被渲染到 HTML 内。
如果一个组件在
setup()
中直接使用 浏览器 / DOM API ,它会导致构建过程报错,因为这些 API 在 Node.js 的环境中是无法使用的。在这种情况下,你可以选择一种方式:
- 修改这个组件,只在
onBeforeMount()
或onMounted()
Hook 中使用 浏览器 / DOM API 。- 使用
<ClientOnly>
包裹这个组件。# Content
Props:
- pageKey
- 类型:
string
- 是否必须:
false
使用:
`,7),m=e("p",null,"详情:",-1),v=e("p",null,"该组件会渲染页面的 Markdown 内容。",-1),g={href:"https://router.vuejs.org/zh/api/#name-2",target:"_blank",rel:"noopener noreferrer"},k=e("code",null,"pageKey",-1),x=e("p",null,"该组件主要是为了开发主题时使用。在绝大多数情况下你不会用到它。",-1),y=e("p",null,"参考:",-1);function b(f,D){const s=l("NpmBadge"),o=l("ExternalLinkIcon"),t=l("RouterLink");return d(),c("div",null,[h,a(s,{package:"@vuepress/client"}),_,e("ul",null,[e("li",null,[m,v,e("p",null,[n("页面 Key 是页面路由的 "),e("a",g,[n("name"),a(o)]),n(" 。如果没有传入 "),k,n(" Prop ,它会渲染当前路由下的页面。")]),x]),e("li",null,[y,e("ul",null,[e("li",null,[a(t,{to:"/zh/reference/node-api.html#key"},{default:r(()=>[n("Node API > Page 属性 > key")]),_:1})])])])])])}const E=i(u,[["render",b],["__file","components.html.vue"]]);export{E as default}; diff --git a/assets/components.html-zMFdbMQ-.js b/assets/components.html-zMFdbMQ-.js new file mode 100644 index 000000000..62f446884 --- /dev/null +++ b/assets/components.html-zMFdbMQ-.js @@ -0,0 +1,32 @@ +import{_ as r,r as a,o as u,c as m,d as n,a as e,b as s,w as l,e as p}from"./app-eU2v8o1B.js";const v={},D=e("h1",{id:"built-in-components",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#built-in-components","aria-hidden":"true"},"#"),s(" Built-in Components")],-1),b={id:"badge",tabindex:"-1"},h=e("a",{class:"header-anchor",href:"#badge","aria-hidden":"true"},"#",-1),g=p(`<Content page-key="v-xxxxxx" /> +
Props:
- type
- Type:
'tip' | 'warning' | 'danger'
- Default:
'tip'
- text
- Type:
string
- Default:
''
- vertical
- Type:
'top' | 'middle' | 'bottom' | undefined
- Default:
undefined
Example:
Input
- VuePress - <Badge type="tip" text="v2" vertical="top" /> +- VuePress - <Badge type="warning" text="v2" vertical="middle" /> +- VuePress - <Badge type="danger" text="v2" vertical="bottom" /> +
Output
`,4),y=p(`# CodeGroup
Details:
Wrapper of the CodeGroupItem components.
# CodeGroupItem
Props:
- title
- Type:
string
- Required:
true
- active
- Type:
boolean
- Default:
false
Details:
This component must be placed inside a CodeGroup component.
Use the
active
prop to set the initial active item, or the first item will be activated by default.Example:
Input
<CodeGroup> + <CodeGroupItem title="PNPM"> + +\`\`\`bash:no-line-numbers +pnpm install +\`\`\` + + </CodeGroupItem> + + <CodeGroupItem title="YARN"> + +\`\`\`bash:no-line-numbers +yarn install +\`\`\` + + </CodeGroupItem> + + <CodeGroupItem title="NPM" active> + +\`\`\`bash:no-line-numbers +npm install +\`\`\` + + </CodeGroupItem> +</CodeGroup> +
Output
`,7),_=e("div",{class:"language-bash","data-ext":"sh"},[e("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[e("code",null,[e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"pnpm"),e("span",{style:{color:"#D4D4D4"}}," "),e("span",{style:{color:"#CE9178"}},"install")]),s(` +`),e("span",{class:"line"})])])],-1),C=e("div",{class:"language-bash","data-ext":"sh"},[e("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[e("code",null,[e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"yarn"),e("span",{style:{color:"#D4D4D4"}}," "),e("span",{style:{color:"#CE9178"}},"install")]),s(` +`),e("span",{class:"line"})])])],-1),f=e("div",{class:"language-bash","data-ext":"sh"},[e("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[e("code",null,[e("span",{class:"line"},[e("span",{style:{color:"#DCDCAA"}},"npm"),e("span",{style:{color:"#D4D4D4"}}," "),e("span",{style:{color:"#CE9178"}},"install")]),s(` +`),e("span",{class:"line"})])])],-1),k={class:"custom-container warning"},x=e("p",{class:"custom-container-title"},"WARNING",-1),E=e("p",null,[s("You must add an empty line between the starting tag of "),e("code",null,""),s(" and the code fence, otherwise the code fence will not be parsed correctly by Markdown.")],-1),q=e("p",null,"All content must be valid Markdown first, and then a Vue SFC.",-1);function G(w,A){const c=a("NpmBadge"),t=a("Badge"),o=a("CodeGroupItem"),d=a("CodeGroup"),i=a("RouterLink");return u(),m("div",null,[D,n(c,{package:"@vuepress/theme-default"}),e("h2",b,[h,s(" Badge "),n(t,{text:"badge"})]),g,e("ul",null,[e("li",null,[s("VuePress - "),n(t,{type:"tip",text:"v2",vertical:"top"})]),e("li",null,[s("VuePress - "),n(t,{type:"warning",text:"v2",vertical:"middle"})]),e("li",null,[s("VuePress - "),n(t,{type:"danger",text:"v2",vertical:"bottom"})])]),y,n(d,null,{default:l(()=>[n(o,{title:"PNPM"},{default:l(()=>[_]),_:1}),n(o,{title:"YARN"},{default:l(()=>[C]),_:1}),n(o,{title:"NPM",active:""},{default:l(()=>[f]),_:1})]),_:1}),e("div",k,[x,E,q,e("p",null,[s("Learn more: "),n(i,{to:"/advanced/cookbook/markdown-and-vue-sfc.html"},{default:l(()=>[s("Cookbook > Markdown and Vue SFC")]),_:1})]),e("p",null,[s("Alternatively, you can use the "),n(i,{to:"/reference/default-theme/markdown.html#custom-containers"},{default:l(()=>[s("custom containers")]),_:1}),s(".")])])])}const N=r(v,[["render",G],["__file","components.html.vue"]]);export{N as default}; diff --git a/assets/config.html-3uFubqIm.js b/assets/config.html-3uFubqIm.js new file mode 100644 index 000000000..3b1ac6272 --- /dev/null +++ b/assets/config.html-3uFubqIm.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0f0d17a8","path":"/reference/default-theme/config.html","title":"Config","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Basic Config","slug":"basic-config","link":"#basic-config","children":[{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"Locale Config","slug":"locale-config","link":"#locale-config","children":[{"level":3,"title":"colorMode","slug":"colormode","link":"#colormode","children":[]},{"level":3,"title":"colorModeSwitch","slug":"colormodeswitch","link":"#colormodeswitch","children":[]},{"level":3,"title":"home","slug":"home","link":"#home","children":[]},{"level":3,"title":"navbar","slug":"navbar","link":"#navbar","children":[]},{"level":3,"title":"logo","slug":"logo","link":"#logo","children":[]},{"level":3,"title":"logoDark","slug":"logodark","link":"#logodark","children":[]},{"level":3,"title":"repo","slug":"repo","link":"#repo","children":[]},{"level":3,"title":"repoLabel","slug":"repolabel","link":"#repolabel","children":[]},{"level":3,"title":"selectLanguageText","slug":"selectlanguagetext","link":"#selectlanguagetext","children":[]},{"level":3,"title":"selectLanguageAriaLabel","slug":"selectlanguagearialabel","link":"#selectlanguagearialabel","children":[]},{"level":3,"title":"selectLanguageName","slug":"selectlanguagename","link":"#selectlanguagename","children":[]},{"level":3,"title":"sidebar","slug":"sidebar","link":"#sidebar","children":[]},{"level":3,"title":"sidebarDepth","slug":"sidebardepth","link":"#sidebardepth","children":[]},{"level":3,"title":"editLink","slug":"editlink","link":"#editlink","children":[]},{"level":3,"title":"editLinkText","slug":"editlinktext","link":"#editlinktext","children":[]},{"level":3,"title":"editLinkPattern","slug":"editlinkpattern","link":"#editlinkpattern","children":[]},{"level":3,"title":"docsRepo","slug":"docsrepo","link":"#docsrepo","children":[]},{"level":3,"title":"docsBranch","slug":"docsbranch","link":"#docsbranch","children":[]},{"level":3,"title":"docsDir","slug":"docsdir","link":"#docsdir","children":[]},{"level":3,"title":"lastUpdated","slug":"lastupdated","link":"#lastupdated","children":[]},{"level":3,"title":"lastUpdatedText","slug":"lastupdatedtext","link":"#lastupdatedtext","children":[]},{"level":3,"title":"contributors","slug":"contributors","link":"#contributors","children":[]},{"level":3,"title":"contributorsText","slug":"contributorstext","link":"#contributorstext","children":[]},{"level":3,"title":"tip","slug":"tip","link":"#tip","children":[]},{"level":3,"title":"warning","slug":"warning","link":"#warning","children":[]},{"level":3,"title":"danger","slug":"danger","link":"#danger","children":[]},{"level":3,"title":"notFound","slug":"notfound","link":"#notfound","children":[]},{"level":3,"title":"backToHome","slug":"backtohome","link":"#backtohome","children":[]},{"level":3,"title":"openInNewWindow","slug":"openinnewwindow","link":"#openinnewwindow","children":[]},{"level":3,"title":"toggleColorMode","slug":"togglecolormode","link":"#togglecolormode","children":[]},{"level":3,"title":"toggleSidebar","slug":"togglesidebar","link":"#togglesidebar","children":[]}]},{"level":2,"title":"Plugins Config","slug":"plugins-config","link":"#plugins-config","children":[{"level":3,"title":"themePlugins","slug":"themeplugins","link":"#themeplugins","children":[]},{"level":3,"title":"themePlugins.activeHeaderLinks","slug":"themeplugins-activeheaderlinks","link":"#themeplugins-activeheaderlinks","children":[]},{"level":3,"title":"themePlugins.backToTop","slug":"themeplugins-backtotop","link":"#themeplugins-backtotop","children":[]},{"level":3,"title":"themePlugins.container","slug":"themeplugins-container","link":"#themeplugins-container","children":[]},{"level":3,"title":"themePlugins.externalLinkIcon","slug":"themeplugins-externallinkicon","link":"#themeplugins-externallinkicon","children":[]},{"level":3,"title":"themePlugins.git","slug":"themeplugins-git","link":"#themeplugins-git","children":[]},{"level":3,"title":"themePlugins.mediumZoom","slug":"themeplugins-mediumzoom","link":"#themeplugins-mediumzoom","children":[]},{"level":3,"title":"themePlugins.nprogress","slug":"themeplugins-nprogress","link":"#themeplugins-nprogress","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/default-theme/config.md"}');export{e as data}; diff --git a/assets/config.html-QsTvJZys.js b/assets/config.html-QsTvJZys.js new file mode 100644 index 000000000..afe2f0c45 --- /dev/null +++ b/assets/config.html-QsTvJZys.js @@ -0,0 +1,173 @@ +import{_ as t,r as p,o as r,c as d,d as n,a as s,b as l,w as a,e as o}from"./app-eU2v8o1B.js";const D={},u=s("h1",{id:"配置",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#配置","aria-hidden":"true"},"#"),l(" 配置")],-1),h=o(` import { defaultTheme } from '@vuepress/theme-default' + +export default { + theme: defaultTheme({ + // 在这里进行配置 + }), +} +
# 基础配置
# locales
`,3),y=s("li",null,[s("p",null,[l("类型: "),s("code",null,"{ [path: string]: Partial}")])],-1),m=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"{}")])],-1),v=s("p",null,"详情:",-1),b=s("p",null,"多语言支持的各个语言 locales 。",-1),C=s("p",null,[l("所有在 "),s("a",{href:"#locale-%E9%85%8D%E7%BD%AE"},"Locale 配置"),l(" 章节内的配置项都可以在 locales 中使用。")],-1),_=s("code",null,"locales",-1),g=s("p",null,"参考:",-1),E=o(' # Locale 配置
该章节内的配置项可以作为一般配置使用,也可以使用在 locales 内。
# colorMode
',3),f=s("li",null,[s("p",null,[l("类型: "),s("code",null,"'auto' | 'light' | 'dark'")])],-1),x=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"'auto'")])],-1),k=s("p",null,"详情:",-1),A=s("p",null,"默认颜色模式。",-1),F=s("code",null,"'auto'",-1),L={href:"https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme",target:"_blank",rel:"noopener noreferrer"},w=s("li",null,[s("p",null,"参考:"),s("ul",null,[s("li",null,[s("a",{href:"#colormodeswitch"},"默认主题 > 配置 > colorModeSwitch")])])],-1),z=o(`# colorModeSwitch
类型:
boolean
默认值:
true
详情:
是否启用切换颜色模式的功能。
如果设置为
true
,将会在导航栏展示一个切换颜色模式的按钮。参考:
# home
类型:
string
默认值:
/
详情:
首页的路径。
它将被用于:
- 导航栏中 Logo 的链接
- 404 页面的 返回首页 链接
# navbar
类型:
false | (NavbarItem | NavbarGroup | string)[]
默认值:
[]
详情:
导航栏配置。
设置为
false
可以禁用导航栏。为了配置导航栏元素,你可以将其设置为 导航栏数组 ,其中的每个元素是
NavbarItem
对象、NavbarGroup
对象、或者字符串:
NavbarItem
对象应该有一个text
字段和一个link
字段,还有一个可选的activeMatch
字段。NavbarGroup
对象应该有一个text
字段和一个children
字段。children
字段同样是一个 导航栏数组 。- 字符串应为目标页面文件的路径。它将会被转换为
NavbarItem
对象,将页面标题作为text
,将页面路由路径作为link
。示例 1:
export default { + theme: defaultTheme({ + navbar: [ + // NavbarItem + { + text: 'Foo', + link: '/foo/', + }, + // NavbarGroup + { + text: 'Group', + children: ['/group/foo.md', '/group/bar.md'], + }, + // 字符串 - 页面文件路径 + '/bar/README.md', + ], + }), +} +
- 示例 2:
export default { + theme: defaultTheme({ + navbar: [ + // 嵌套 Group - 最大深度为 2 + { + text: 'Group', + children: [ + { + text: 'SubGroup', + children: ['/group/sub/foo.md', '/group/sub/bar.md'], + }, + ], + }, + // 控制元素何时被激活 + { + text: 'Group 2', + children: [ + { + text: 'Always active', + link: '/', + // 该元素将一直处于激活状态 + activeMatch: '/', + }, + { + text: 'Active on /foo/', + link: '/not-foo/', + // 该元素在当前路由路径是 /foo/ 开头时激活 + // 支持正则表达式 + activeMatch: '^/foo/', + }, + ], + }, + ], + }), +} +
# logo
类型:
null | string
详情:
Logo 图片的 URL。
Logo 图片将会显示在导航栏的左端。
设置为
null
可以禁用 Logo 。示例:
`,12),N=o(`export default { + theme: defaultTheme({ + // Public 文件路径 + logo: '/images/hero.png', + // URL + logo: 'https://vuejs.org/images/logo.png', + }), +} +
# logoDark
类型:
null | string
详情:
在夜间模式中使用的 Logo 图片的 URL。
如果你想在夜间模式中使用不同的 Logo 图片,就可以使用该配置项。
设置为
null
可以在夜间模式下禁用 Logo 。忽略该配置项将会在夜间模式中使用 logo 配置。参考:
# repo
类型:
string
详情:
项目仓库的 URL。
它将被用作 仓库链接 的链接。仓库链接 将会显示为导航栏的最后一个元素。
export default { + theme: defaultTheme({ + // 如果你按照 \`organization/repository\` 的格式设置它 + // 我们会将它作为一个 GitHub 仓库 + repo: 'vuejs/vuepress', + // 你也可以直接将它设置为一个 URL + repo: 'https://gitlab.com/foo/bar', + }), +} +
# repoLabel
类型:
string
详情:
项目仓库的标签。
它将被用作 仓库链接 的文字。仓库链接 将会显示为导航栏的最后一个元素。
如果你不明确指定该配置项,它将会根据 repo 配置项自动推断。
# selectLanguageText
`,8),T=s("li",null,[s("p",null,[l("类型: "),s("code",null,"string")])],-1),B=s("p",null,"详情:",-1),R=s("p",null,[s("em",null,"选择语言菜单"),l(" 的文字。")],-1),I=s("em",null,"选择语言菜单",-1),P=o(`# selectLanguageAriaLabel
类型:
string
详情:
选择语言菜单 的
aria-label
属性。它主要是为了站点的可访问性 (a11y) 。
# selectLanguageName
类型:
string
详情:
Locale 的语言名称。
该配置项 仅能在主题配置的 locales 的内部生效 。它将被用作 locale 的语言名称,展示在 选择语言菜单 内。
示例:
export default { + locales: { + '/': { + lang: 'en-US', + }, + '/zh/': { + lang: 'zh-CN', + }, + }, + theme: defaultTheme({ + locales: { + '/': { + selectLanguageName: 'English', + }, + '/zh/': { + selectLanguageName: '简体中文', + }, + }, + }), +} +
# sidebar
`,6),G=s("li",null,[s("p",null,[l("类型: "),s("code",null,"false | 'auto' | SidebarConfigArray | SidebarConfigObject")])],-1),S=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"'auto'")])],-1),M=s("p",null,"详情:",-1),U=s("p",null,"侧边栏配置。",-1),V=o("设置为
false
可以禁用侧边栏。如果你设置为
'auto'
,侧边栏会根据页面标题自动生成。为了手动配置侧边栏元素,你可以将其设置为 侧边栏数组 ,其中的每个元素是一个
SidebarItem
对象或者一个字符串:
SidebarItem
对象应该有一个text
字段,有一个可选的link
字段、一个可选的children
字段和一个可选的collapsible
字段。children
字段同样是一个 侧边栏数组 。collapsible
字段来控制它是否可折叠。- 字符串应为目标页面文件的路径。它将会被转换为
SidebarItem
对象,将页面标题作为text
,将页面路由路径作为link
,并根据页面小标题自动生成children
。如果你想在不同子路径中使用不同的侧边栏,你可以将该配置项设置为 侧边栏对象 :
",6),H=s("li",null,[s("p",null,"示例 1:")],-1),W=o(`
- Key 为路径前缀。
- Value 为 侧边栏数组 。
export default { + theme: defaultTheme({ + // 侧边栏数组 + // 所有页面会使用相同的侧边栏 + sidebar: [ + // SidebarItem + { + text: 'Foo', + link: '/foo/', + children: [ + // SidebarItem + { + text: 'github', + link: 'https://github.com', + children: [], + }, + // 字符串 - 页面文件路径 + '/foo/bar.md', + ], + }, + // 字符串 - 页面文件路径 + '/bar/README.md', + ], + }), +} +
- 示例 2:
export default { + theme: defaultTheme({ + // 侧边栏对象 + // 不同子路径下的页面会使用不同的侧边栏 + sidebar: { + '/guide/': [ + { + text: 'Guide', + children: ['/guide/README.md', '/guide/getting-started.md'], + }, + ], + '/reference/': [ + { + text: 'Reference', + children: ['/reference/cli.md', '/reference/config.md'], + }, + ], + }, + }), +} +
- 示例 3:
export default { + theme: defaultTheme({ + // 可折叠的侧边栏 + sidebar: { + '/reference/': [ + { + text: 'VuePress Reference', + collapsible: true, + children: ['/reference/cli.md', '/reference/config.md'], + }, + { + text: 'Bundlers Reference', + collapsible: true, + children: [ + '/reference/bundler/vite.md', + '/reference/bundler/webpack.md', + ], + }, + ], + }, + }), +} +
# sidebarDepth
`,6),j=s("li",null,[s("p",null,[l("类型: "),s("code",null,"number")])],-1),K=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"2")])],-1),O=o("详情:
设置根据页面标题自动生成的侧边栏的最大深度。
",3),Z=s("p",null,[l("由于 "),s("code",null,"markdown.headers.level"),l(" 的默认值是 "),s("code",null,"[2, 3]"),l(" ,因此 "),s("code",null,"sidebarDepth"),l(" 的默认最大值是 "),s("code",null,"2"),l(" 。")],-1),q=s("h3",{id:"editlink",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#editlink","aria-hidden":"true"},"#"),l(" editLink")],-1),J=s("li",null,[s("p",null,[l("类型: "),s("code",null,"boolean")])],-1),Q=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"true")])],-1),X=s("p",null,"详情:",-1),Y=s("p",null,[l("是否启用 "),s("em",null,"编辑此页"),l(" 链接。")],-1),$=o(`
- 设为
0
来禁用所有级别的页面标题。- 设为
1
来包含<h2>
标题。- 设为
2
来包含<h2>
和<h3>
标题。- ...
# editLinkText
类型:
string
默认值:
'Edit this page'
详情:
编辑此页 链接的文字。
# editLinkPattern
类型:
string
详情:
编辑此页 链接的 Pattern 。
它将会用于生成 编辑此页 的链接。
如果你不设置该选项,则会根据 docsRepo 配置项来推断 Pattern 。但是如果你的文档仓库没有托管在常用的平台上,比如 GitHub 、 GitLab 、 Bitbucket 、 Gitee 等,那么你必须设置该选项才能使 编辑此页 链接正常工作。
用法:
Pattern 描述 :repo
文档仓库 URL ,即 docsRepo :branch
文档仓库分支 ,即 docsBranch :path
页面源文件的路径,即 docsDir 拼接上页面文件的相对路径 示例:
export default { + theme: defaultTheme({ + docsRepo: 'https://gitlab.com/owner/name', + docsBranch: 'master', + docsDir: 'docs', + editLinkPattern: ':repo/-/edit/:branch/:path', + }), +} +
则会生成类似于
'https://gitlab.com/owner/name/-/edit/master/docs/path/to/file.md'
的链接。# docsRepo
类型:
string
详情:
文档源文件的仓库 URL 。
它将会用于生成 编辑此页 的链接。
如果你不设置该选项,则默认会使用 repo 配置项。但是如果你的文档源文件是在一个不同的仓库内,你就需要设置该配置项了。
# docsBranch
类型:
string
默认值:
'main'
详情:
文档源文件的仓库分支。
它将会用于生成 编辑此页 的链接。
# docsDir
类型:
string
默认值:
''
详情:
文档源文件存放在仓库中的目录名。
它将会用于生成 编辑此页 的链接。
# lastUpdated
`,13),ss=s("li",null,[s("p",null,[l("类型: "),s("code",null,"boolean")])],-1),ls=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"true")])],-1),ns=s("p",null,"详情:",-1),es=s("p",null,[l("是否启用 "),s("em",null,"最近更新时间戳"),l(" 。")],-1),as=s("code",null,"false",-1),os=o('# lastUpdatedText
类型:
string
默认值:
'Last Updated'
详情:
最近更新时间戳 标签的文字。
# contributors
',3),ps=s("li",null,[s("p",null,[l("类型: "),s("code",null,"boolean")])],-1),is=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"true")])],-1),cs=s("p",null,"详情:",-1),ts=s("p",null,[l("是否启用 "),s("em",null,"贡献者列表"),l(" 。")],-1),rs=s("code",null,"false",-1),ds=o('# contributorsText
类型:
string
默认值:
'Contributors'
详情:
贡献者列表 标签的文字。
# tip
',3),Ds=s("li",null,[s("p",null,[l("类型: "),s("code",null,"string")])],-1),us=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"'TIP'")])],-1),hs=s("p",null,"详情:",-1),ys=s("h3",{id:"warning",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#warning","aria-hidden":"true"},"#"),l(" warning")],-1),ms=s("li",null,[s("p",null,[l("类型: "),s("code",null,"string")])],-1),vs=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"'WARNING'")])],-1),bs=s("p",null,"详情:",-1),Cs=s("h3",{id:"danger",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#danger","aria-hidden":"true"},"#"),l(" danger")],-1),_s=s("li",null,[s("p",null,[l("类型: "),s("code",null,"string")])],-1),gs=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"'DANGER'")])],-1),Es=s("p",null,"详情:",-1),fs=o('# notFound
类型:
string[]
默认值:
['Not Found']
详情:
404 页面的提示信息。
当用户进入 404 页面时,会从数组中随机选取一条信息进行展示。
# backToHome
类型:
string
默认值:
'Back to home'
详情:
404 页面中 返回首页 链接的文字。
# openInNewWindow
',5),xs=s("li",null,[s("p",null,[l("类型: "),s("code",null,"string")])],-1),ks=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"'open in new window'")])],-1),As=s("p",null,"详情:",-1),Fs=s("code",null,"sr-only",-1),Ls=s("p",null,"它主要是为了站点的可访问性 (a11y) 。",-1),ws=s("li",null,[s("p",null,"参考:"),s("ul",null,[s("li",null,[s("a",{href:"#themeplugins-externallinkicon"},"默认主题 > 配置 > themePlugins.externalLinkIcon")])])],-1),zs=o('# toggleColorMode
类型:
string
默认值:
'toggle color mode'
详情:
切换颜色模式按钮的标题文字。
它主要是为了站点的可访问性 (a11y) 。
参考:
# toggleSidebar
类型:
string
默认值:
'toggle sidebar'
详情:
切换侧边栏按钮的标题文字。
它主要是为了站点的可访问性 (a11y) 。
# 插件配置
# themePlugins
详情:
设置默认主题使用的插件。
默认主题使用了一些插件,如果你确实不需要该插件,你可以选择禁用它。在禁用插件之前,请确保你已了解它的用途。
# themePlugins.activeHeaderLinks
',8),Ns=s("li",null,[s("p",null,[l("类型: "),s("code",null,"boolean")])],-1),Ts=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"true")])],-1),Bs=s("p",null,"详情:",-1),Rs=s("h4",{id:"themeplugins-backtotop",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#themeplugins-backtotop","aria-hidden":"true"},"#"),l(" themePlugins.backToTop")],-1),Is=s("li",null,[s("p",null,[l("类型: "),s("code",null,"boolean")])],-1),Ps=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"true")])],-1),Gs=s("p",null,"详情:",-1),Ss=s("h3",{id:"themeplugins-container",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#themeplugins-container","aria-hidden":"true"},"#"),l(" themePlugins.container")],-1),Ms=s("li",null,[s("p",null,[l("类型: "),s("code",null,"Record")])],-1),Us=s("p",null,"详情:",-1),Vs=o("
ContainerType
类型为:",2),Hs=s("p",null,"参考:",-1),Ws=s("h3",{id:"themeplugins-externallinkicon",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#themeplugins-externallinkicon","aria-hidden":"true"},"#"),l(" themePlugins.externalLinkIcon")],-1),js=s("li",null,[s("p",null,[l("类型: "),s("code",null,"boolean")])],-1),Ks=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"true")])],-1),Os=s("p",null,"详情:",-1),Zs=s("h3",{id:"themeplugins-git",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#themeplugins-git","aria-hidden":"true"},"#"),l(" themePlugins.git")],-1),qs=s("li",null,[s("p",null,[l("类型: "),s("code",null,"boolean")])],-1),Js=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"true")])],-1),Qs=s("p",null,"详情:",-1),Xs=s("h3",{id:"themeplugins-mediumzoom",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#themeplugins-mediumzoom","aria-hidden":"true"},"#"),l(" themePlugins.mediumZoom")],-1),Ys=s("li",null,[s("p",null,[l("类型: "),s("code",null,"boolean")])],-1),$s=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"true")])],-1),sl=s("p",null,"详情:",-1),ll=s("h3",{id:"themeplugins-nprogress",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#themeplugins-nprogress","aria-hidden":"true"},"#"),l(" themePlugins.nprogress")],-1),nl=s("li",null,[s("p",null,[l("类型: "),s("code",null,"boolean")])],-1),el=s("li",null,[s("p",null,[l("默认值: "),s("code",null,"true")])],-1),al=s("p",null,"详情:",-1);function ol(pl,il){const i=p("NpmBadge"),e=p("RouterLink"),c=p("ExternalLinkIcon");return r(),d("div",null,[u,n(i,{package:"@vuepress/theme-default"}),h,s("ul",null,[y,m,s("li",null,[v,b,C,s("p",null,[l("该配置项仅能在默认主题内生效,注意不要和 "),n(e,{to:"/zh/reference/config.html#locales"},{default:a(()=>[l("站点配置")]),_:1}),l(" 中的 "),_,l(" 混淆。")])]),s("li",null,[g,s("ul",null,[s("li",null,[n(e,{to:"/zh/guide/i18n.html"},{default:a(()=>[l("指南 > 多语言支持")]),_:1})])])])]),E,s("ul",null,[f,x,s("li",null,[k,A,s("p",null,[l("如果设置为 "),F,l(" ,则会根据 "),s("a",L,[l("prefers-color-scheme"),n(c)]),l(" 自动设置初始颜色模式。")])]),w]),z,s("ul",null,[s("li",null,[l("参考: "),s("ul",null,[s("li",null,[n(e,{to:"/zh/guide/assets.html#public-%E6%96%87%E4%BB%B6"},{default:a(()=>[l("指南 > 静态资源 > Public 文件")]),_:1})])])])]),N,s("ul",null,[T,s("li",null,[B,R,s("p",null,[l("如果你在站点配置中设置了多个 "),n(e,{to:"/zh/reference/config.html#locales"},{default:a(()=>[l("locales")]),_:1}),l(" ,那么 "),I,l(" 就会显示在导航栏中仓库按钮的旁边。")])])]),P,s("ul",null,[G,S,s("li",null,[M,U,s("p",null,[l("你可以通过页面的 "),n(e,{to:"/zh/reference/default-theme/frontmatter.html#sidebar"},{default:a(()=>[l("sidebar")]),_:1}),l(" frontmatter 来覆盖这个全局配置。")]),V]),H]),W,s("ul",null,[j,K,s("li",null,[O,s("p",null,[l("最大值取决于你通过 "),n(e,{to:"/zh/reference/config.html#markdown-headers"},{default:a(()=>[l("markdown.headers.level")]),_:1}),l(" 提取了哪些级别的标题。")]),Z,s("p",null,[l("你可以通过页面的 "),n(e,{to:"/zh/reference/default-theme/frontmatter.html#sidebardepth"},{default:a(()=>[l("sidebarDepth")]),_:1}),l(" frontmatter 来覆盖这个全局配置。")])])]),q,s("ul",null,[J,Q,s("li",null,[X,Y,s("p",null,[l("你可以通过页面的 "),n(e,{to:"/zh/reference/default-theme/frontmatter.html#editlink"},{default:a(()=>[l("editLink")]),_:1}),l(" frontmatter 来覆盖这个全局配置。")])])]),$,s("ul",null,[ss,ls,s("li",null,[ns,es,s("p",null,[l("你可以通过页面的 "),n(e,{to:"/zh/reference/default-theme/frontmatter.html#lastupdated"},{default:a(()=>[l("lastUpdated")]),_:1}),l(" frontmatter 来覆盖这个全局配置。要注意的是,如果你已经将该选项设为了 "),as,l(" ,那么这个功能会被完全禁用,并且无法在 locales 或页面 frontmatter 中启用。")])])]),os,s("ul",null,[ps,is,s("li",null,[cs,ts,s("p",null,[l("你可以通过页面的 "),n(e,{to:"/zh/reference/default-theme/frontmatter.html#contributors"},{default:a(()=>[l("contributors")]),_:1}),l(" frontmatter 来覆盖这个全局配置。要注意的是,如果你已经将该选项设为了 "),rs,l(" ,那么这个功能会被完全禁用,并且无法在 locales 或页面 frontmatter 中启用。")])])]),ds,s("ul",null,[Ds,us,s("li",null,[hs,s("p",null,[l("Tip "),n(e,{to:"/zh/reference/default-theme/markdown.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8"},{default:a(()=>[l("自定义容器")]),_:1}),l(" 的默认标题。")])])]),ys,s("ul",null,[ms,vs,s("li",null,[bs,s("p",null,[l("Warning "),n(e,{to:"/zh/reference/default-theme/markdown.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8"},{default:a(()=>[l("自定义容器")]),_:1}),l(" 的默认标题。")])])]),Cs,s("ul",null,[_s,gs,s("li",null,[Es,s("p",null,[l("Danger "),n(e,{to:"/zh/reference/default-theme/markdown.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8"},{default:a(()=>[l("自定义容器")]),_:1}),l(" 的默认标题。")])])]),fs,s("ul",null,[xs,ks,s("li",null,[As,s("p",null,[n(e,{to:"/zh/reference/plugin/external-link-icon.html#externallinkicon"},{default:a(()=>[l("ExternalLinkIcon")]),_:1}),l(". 链接内的 "),Fs,l(" 文字。")]),Ls]),ws]),zs,s("ul",null,[Ns,Ts,s("li",null,[Bs,s("p",null,[l("是否启用 "),n(e,{to:"/zh/reference/plugin/active-header-links.html"},{default:a(()=>[l("@vuepress/plugin-active-header-links")]),_:1}),l(" 。")])])]),Rs,s("ul",null,[Is,Ps,s("li",null,[Gs,s("p",null,[l("是否启用 "),n(e,{to:"/zh/reference/plugin/back-to-top.html"},{default:a(()=>[l("@vuepress/plugin-back-to-top")]),_:1}),l(" 。")])])]),Ss,s("ul",null,[Ms,s("li",null,[Us,s("p",null,[l("是否启用由 "),n(e,{to:"/zh/reference/plugin/container.html"},{default:a(()=>[l("@vuepress/plugin-container")]),_:1}),l(" 支持的自定义容器。")]),Vs]),s("li",null,[Hs,s("ul",null,[s("li",null,[n(e,{to:"/zh/reference/default-theme/markdown.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8"},{default:a(()=>[l("默认主题 > Markdown > 自定义容器")]),_:1})])])])]),Ws,s("ul",null,[js,Ks,s("li",null,[Os,s("p",null,[l("是否启用 "),n(e,{to:"/zh/reference/plugin/external-link-icon.html"},{default:a(()=>[l("@vuepress/plugin-external-link-icon")]),_:1}),l(" 。")])])]),Zs,s("ul",null,[qs,Js,s("li",null,[Qs,s("p",null,[l("是否启用 "),n(e,{to:"/zh/reference/plugin/git.html"},{default:a(()=>[l("@vuepress/plugin-git")]),_:1}),l(" 。")])])]),Xs,s("ul",null,[Ys,$s,s("li",null,[sl,s("p",null,[l("是否启用 "),n(e,{to:"/zh/reference/plugin/medium-zoom.html"},{default:a(()=>[l("@vuepress/plugin-medium-zoom")]),_:1}),l(" 。")])])]),ll,s("ul",null,[nl,el,s("li",null,[al,s("p",null,[l("是否启用 "),n(e,{to:"/zh/reference/plugin/nprogress.html"},{default:a(()=>[l("@vuepress/plugin-nprogress")]),_:1}),l(" 。")])])])])}const tl=t(D,[["render",ol],["__file","config.html.vue"]]);export{tl as default}; diff --git a/assets/config.html-WWjNuxab.js b/assets/config.html-WWjNuxab.js new file mode 100644 index 000000000..12d2f0d2e --- /dev/null +++ b/assets/config.html-WWjNuxab.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-b249668c","path":"/reference/config.html","title":"Config","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Site Config","slug":"site-config","link":"#site-config","children":[{"level":3,"title":"base","slug":"base","link":"#base","children":[]},{"level":3,"title":"lang","slug":"lang","link":"#lang","children":[]},{"level":3,"title":"title","slug":"title","link":"#title","children":[]},{"level":3,"title":"description","slug":"description","link":"#description","children":[]},{"level":3,"title":"head","slug":"head","link":"#head","children":[]},{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"Theme Config","slug":"theme-config","link":"#theme-config","children":[{"level":3,"title":"theme","slug":"theme","link":"#theme","children":[]}]},{"level":2,"title":"Bundler Config","slug":"bundler-config","link":"#bundler-config","children":[{"level":3,"title":"bundler","slug":"bundler","link":"#bundler","children":[]}]},{"level":2,"title":"Common Config","slug":"common-config","link":"#common-config","children":[{"level":3,"title":"dest","slug":"dest","link":"#dest","children":[]},{"level":3,"title":"temp","slug":"temp","link":"#temp","children":[]},{"level":3,"title":"cache","slug":"cache","link":"#cache","children":[]},{"level":3,"title":"public","slug":"public","link":"#public","children":[]},{"level":3,"title":"debug","slug":"debug","link":"#debug","children":[]},{"level":3,"title":"pagePatterns","slug":"pagepatterns","link":"#pagepatterns","children":[]},{"level":3,"title":"permalinkPattern","slug":"permalinkpattern","link":"#permalinkpattern","children":[]}]},{"level":2,"title":"Dev Config","slug":"dev-config","link":"#dev-config","children":[{"level":3,"title":"host","slug":"host","link":"#host","children":[]},{"level":3,"title":"port","slug":"port","link":"#port","children":[]},{"level":3,"title":"open","slug":"open","link":"#open","children":[]},{"level":3,"title":"templateDev","slug":"templatedev","link":"#templatedev","children":[]}]},{"level":2,"title":"Build Config","slug":"build-config","link":"#build-config","children":[{"level":3,"title":"shouldPreload","slug":"shouldpreload","link":"#shouldpreload","children":[]},{"level":3,"title":"shouldPrefetch","slug":"shouldprefetch","link":"#shouldprefetch","children":[]},{"level":3,"title":"templateBuild","slug":"templatebuild","link":"#templatebuild","children":[]},{"level":3,"title":"templateBuildRenderer","slug":"templatebuildrenderer","link":"#templatebuildrenderer","children":[]}]},{"level":2,"title":"Markdown Config","slug":"markdown-config","link":"#markdown-config","children":[{"level":3,"title":"markdown","slug":"markdown","link":"#markdown","children":[]},{"level":3,"title":"markdown.anchor","slug":"markdown-anchor","link":"#markdown-anchor","children":[]},{"level":3,"title":"markdown.assets","slug":"markdown-assets","link":"#markdown-assets","children":[]},{"level":3,"title":"markdown.code","slug":"markdown-code","link":"#markdown-code","children":[]},{"level":3,"title":"markdown.component","slug":"markdown-component","link":"#markdown-component","children":[]},{"level":3,"title":"markdown.emoji","slug":"markdown-emoji","link":"#markdown-emoji","children":[]},{"level":3,"title":"markdown.frontmatter","slug":"markdown-frontmatter","link":"#markdown-frontmatter","children":[]},{"level":3,"title":"markdown.headers","slug":"markdown-headers","link":"#markdown-headers","children":[]},{"level":3,"title":"markdown.importCode","slug":"markdown-importcode","link":"#markdown-importcode","children":[]},{"level":3,"title":"markdown.links","slug":"markdown-links","link":"#markdown-links","children":[]},{"level":3,"title":"markdown.sfc","slug":"markdown-sfc","link":"#markdown-sfc","children":[]},{"level":3,"title":"markdown.slugify","slug":"markdown-slugify","link":"#markdown-slugify","children":[]},{"level":3,"title":"markdown.title","slug":"markdown-title","link":"#markdown-title","children":[]},{"level":3,"title":"markdown.toc","slug":"markdown-toc","link":"#markdown-toc","children":[]}]},{"level":2,"title":"Plugin Config","slug":"plugin-config","link":"#plugin-config","children":[{"level":3,"title":"plugins","slug":"plugins","link":"#plugins","children":[]}]},{"level":2,"title":"Plugin API","slug":"plugin-api","link":"#plugin-api","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/config.md"}');export{l as data}; diff --git a/assets/config.html-eJqi6Wv3.js b/assets/config.html-eJqi6Wv3.js new file mode 100644 index 000000000..1b9e37487 --- /dev/null +++ b/assets/config.html-eJqi6Wv3.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-65a9edeb","path":"/zh/reference/config.html","title":"配置","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"站点配置","slug":"站点配置","link":"#站点配置","children":[{"level":3,"title":"base","slug":"base","link":"#base","children":[]},{"level":3,"title":"lang","slug":"lang","link":"#lang","children":[]},{"level":3,"title":"title","slug":"title","link":"#title","children":[]},{"level":3,"title":"description","slug":"description","link":"#description","children":[]},{"level":3,"title":"head","slug":"head","link":"#head","children":[]},{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"主题配置","slug":"主题配置","link":"#主题配置","children":[{"level":3,"title":"theme","slug":"theme","link":"#theme","children":[]}]},{"level":2,"title":"打包工具配置","slug":"打包工具配置","link":"#打包工具配置","children":[{"level":3,"title":"bundler","slug":"bundler","link":"#bundler","children":[]}]},{"level":2,"title":"通用配置项","slug":"通用配置项","link":"#通用配置项","children":[{"level":3,"title":"dest","slug":"dest","link":"#dest","children":[]},{"level":3,"title":"temp","slug":"temp","link":"#temp","children":[]},{"level":3,"title":"cache","slug":"cache","link":"#cache","children":[]},{"level":3,"title":"public","slug":"public","link":"#public","children":[]},{"level":3,"title":"debug","slug":"debug","link":"#debug","children":[]},{"level":3,"title":"pagePatterns","slug":"pagepatterns","link":"#pagepatterns","children":[]},{"level":3,"title":"permalinkPattern","slug":"permalinkpattern","link":"#permalinkpattern","children":[]}]},{"level":2,"title":"Dev 配置项","slug":"dev-配置项","link":"#dev-配置项","children":[{"level":3,"title":"host","slug":"host","link":"#host","children":[]},{"level":3,"title":"port","slug":"port","link":"#port","children":[]},{"level":3,"title":"open","slug":"open","link":"#open","children":[]},{"level":3,"title":"templateDev","slug":"templatedev","link":"#templatedev","children":[]}]},{"level":2,"title":"Build 配置项","slug":"build-配置项","link":"#build-配置项","children":[{"level":3,"title":"shouldPreload","slug":"shouldpreload","link":"#shouldpreload","children":[]},{"level":3,"title":"shouldPrefetch","slug":"shouldprefetch","link":"#shouldprefetch","children":[]},{"level":3,"title":"templateBuild","slug":"templatebuild","link":"#templatebuild","children":[]},{"level":3,"title":"templateBuildRenderer","slug":"templatebuildrenderer","link":"#templatebuildrenderer","children":[]}]},{"level":2,"title":"Markdown 配置","slug":"markdown-配置","link":"#markdown-配置","children":[{"level":3,"title":"markdown","slug":"markdown","link":"#markdown","children":[]},{"level":3,"title":"markdown.anchor","slug":"markdown-anchor","link":"#markdown-anchor","children":[]},{"level":3,"title":"markdown.assets","slug":"markdown-assets","link":"#markdown-assets","children":[]},{"level":3,"title":"markdown.code","slug":"markdown-code","link":"#markdown-code","children":[]},{"level":3,"title":"markdown.component","slug":"markdown-component","link":"#markdown-component","children":[]},{"level":3,"title":"markdown.emoji","slug":"markdown-emoji","link":"#markdown-emoji","children":[]},{"level":3,"title":"markdown.frontmatter","slug":"markdown-frontmatter","link":"#markdown-frontmatter","children":[]},{"level":3,"title":"markdown.headers","slug":"markdown-headers","link":"#markdown-headers","children":[]},{"level":3,"title":"markdown.title","slug":"markdown-title","link":"#markdown-title","children":[]},{"level":3,"title":"markdown.importCode","slug":"markdown-importcode","link":"#markdown-importcode","children":[]},{"level":3,"title":"markdown.links","slug":"markdown-links","link":"#markdown-links","children":[]},{"level":3,"title":"markdown.sfc","slug":"markdown-sfc","link":"#markdown-sfc","children":[]},{"level":3,"title":"markdown.slugify","slug":"markdown-slugify","link":"#markdown-slugify","children":[]},{"level":3,"title":"markdown.toc","slug":"markdown-toc","link":"#markdown-toc","children":[]}]},{"level":2,"title":"插件配置","slug":"插件配置","link":"#插件配置","children":[{"level":3,"title":"plugins","slug":"plugins","link":"#plugins","children":[]}]},{"level":2,"title":"插件 API","slug":"插件-api","link":"#插件-api","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/config.md"}');export{l as data}; diff --git a/assets/config.html-i_ba8INl.js b/assets/config.html-i_ba8INl.js new file mode 100644 index 000000000..1c0a9ab39 --- /dev/null +++ b/assets/config.html-i_ba8INl.js @@ -0,0 +1,22 @@ +import{_ as r,r as i,o as p,c,d as n,a as e,w as t,b as l,e as a}from"./app-eU2v8o1B.js";const u={},h=e("h1",{id:"config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#config","aria-hidden":"true"},"#"),l(" Config")],-1),f=e("h2",{id:"site-config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#site-config","aria-hidden":"true"},"#"),l(" Site Config")],-1),m=e("h3",{id:"base",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#base","aria-hidden":"true"},"#"),l(" base")],-1),_=a('
tip
warning
danger
details
codeGroup
codeGroupItem
Type:
string
Default:
/
',3),g=e("p",null,"Also see:",-1),b=e("h3",{id:"lang",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#lang","aria-hidden":"true"},"#"),l(" lang")],-1),D=a(" Details:
The base URL the site will be deployed at.
You will need to set this if you plan to deploy your site under a sub path. It should always start and end with a slash. For example, if you plan to deploy your site to GitHub pages at
https://foo.github.io/bar/
, then you should setbase
to"/bar/"
.The
base
is automatically prepended to the URLs that start with/
in other options, so you only need to specify it once. (Except for attrs of head)Notice that
base
should be an absolute URL pathname starting and ending with/
.Type:
string
Default:
en-US
",3),y=e("p",null,"Also see:",-1),k=e("li",null,[e("a",{href:"#locales"},"Config > locales")],-1),w=a(' Details:
Language for the site.
This will be the
lang
attribute of the<html>
tag in the rendered HTML.This can be specified in different locales.
# title
Type:
string
Default:
''
Details:
Title for the site.
This will be the suffix for all page titles, and displayed in the navbar in the default theme.
This can be specified in different locales.
Also see:
# description
',3),v=a("Type:
string
Default:
''
",3),x=e("p",null,"Also see:",-1),C=e("li",null,[e("a",{href:"#locales"},"Config > locales")],-1),T=a(` Details:
Description for the site.
This will be the
content
attribute of<meta name="description" />
tag in the rendered HTML, which will be overrode by thedescription
field of page frontmatter.This can be specified in different locales.
# head
Type:
HeadConfig[]
Default:
[]
Details:
Extra tags to inject into the
<head>
tag in the rendered HTML.You can specify each tag in the form of
[tagName, { attrName: attrValue }, innerHTML?]
.This can be specified in different locales.
Notice that if the
attrValue
is a pathname, it will be kept as-is without prepending base automatically, so remember to prepend it manually if needed.Example:
To add a custom favicon:
export default { + head: [['link', { rel: 'icon', href: '/images/logo.png' }]], +} +
Rendered as:
`,5),E=e("li",null,[e("a",{href:"#locales"},"Config > locales")],-1),A=e("h3",{id:"locales",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#locales","aria-hidden":"true"},"#"),l(" locales")],-1),P=a('<head> + <link rel="icon" href="/images/logo.png" /> +</head> +
Type:
{ [path: string]: Partial<SiteLocaleData> }
Default:
{}
',3),S=e("p",null,"Also see:",-1),F=e("h2",{id:"theme-config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#theme-config","aria-hidden":"true"},"#"),l(" Theme Config")],-1),B=e("h3",{id:"theme",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#theme","aria-hidden":"true"},"#"),l(" theme")],-1),L=e("li",null,[e("p",null,[l("Type: "),e("code",null,"Theme")])],-1),G=e("li",null,[e("p",null,"Details:"),e("p",null,"Set the theme of your site."),e("p",null,"If this option is not set, the default theme will be used.")],-1),O=e("p",null,"Also see:",-1),N=e("h2",{id:"bundler-config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#bundler-config","aria-hidden":"true"},"#"),l(" Bundler Config")],-1),I=e("h3",{id:"bundler",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#bundler","aria-hidden":"true"},"#"),l(" bundler")],-1),M=a(" Details:
Specify locales for i18n support.
Acceptable fields:
Type:
Bundler
",2),R=e("p",null,"Also see:",-1),q=a(' Details:
Set the bundler of your site.
If this option is not set, the default bundler will be used:
- With
vuepress
orvuepress-vite
, the default bundler is vite.- With
vuepress-webpack
, the default bundler is webpack.# Common Config
# dest
Type:
string
Default:
`${sourceDir}/.vuepress/dist`
Details:
Specify the output directory for
vuepress build
command.# temp
Type:
string
Default:
`${sourceDir}/.vuepress/.temp`
Details:
Specify the directory for temporary files.
WARNING
Since VuePress will load temp files during dev and build, the temp directory should be inside project root to resolve dependencies correctly.
# cache
Type:
string
Default:
`${sourceDir}/.vuepress/.cache`
Details:
Specify the directory for cache files.
# public
',9),H=e("li",null,[e("p",null,[l("Type: "),e("code",null,"string")])],-1),V=e("li",null,[e("p",null,[l("Default: "),e("code",null,"`${sourceDir}/.vuepress/public`")])],-1),j=e("li",null,[e("p",null,"Details:"),e("p",null,"Specify the directory for public files.")],-1),W=e("p",null,"Also see:",-1),Y=e("h3",{id:"debug",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#debug","aria-hidden":"true"},"#"),l(" debug")],-1),U=e("li",null,[e("p",null,[l("Type: "),e("code",null,"boolean")])],-1),$=e("li",null,[e("p",null,[l("Default: "),e("code",null,"false")])],-1),z=e("p",null,"Details:",-1),J=e("p",null,"Enable debug mode or not.",-1),K={href:"https://github.com/visionmedia/debug",target:"_blank",rel:"noopener noreferrer"},Q=e("code",null,"DEBUG=vuepress*",-1),X=a('# pagePatterns
Type:
string[]
Default:
['**/*.md', '!.vuepress', '!node_modules']
Details:
Specify the patterns of files you want to be resolved as pages. The patterns are relative to the source directory.
# permalinkPattern
',3),Z=a("Type:
string | null
Default:
null
",3),ee=e("p",null,"Also see:",-1),le=a(' Details:
Specify the pattern to generate permalink.
This will be overrode by the
permalinkPattern
field of page frontmatter.# Dev Config
# host
Type:
string
Default:
'0.0.0.0'
Details:
Specify the host to use for the dev server.
# port
Type:
number
Default:
8080
Details:
Specify the port to use for the dev server.
# open
Type:
boolean
Default:
false
Details:
Whether to open the browser after dev-server had been started.
# templateDev
Type:
string
Default:
'@vuepress/client/templates/dev.html'
Details:
Specify the path of the HTML template to be used for dev.
# Build Config
# shouldPreload
Type:
((file: string, type: string) => boolean)) | boolean
Default:
true
Details:
A function to control what files should have
<link rel="preload">
resource hints generated. Set totrue
orfalse
to enable or disable totally.By default, only those files that are required by current page will be preloaded. So you can keep it
true
in most cases.# shouldPrefetch
Type:
((file: string, type: string) => boolean)) | boolean
Default:
true
Details:
A function to control what files should have
<link rel="prefetch">
resource hints generated. Set totrue
orfalse
to enable or disable for all files.If you set it to
true
, all files that required by other pages will be prefetched. This is good for small sites, which will speed up the navigation, but it might not be a good idea if you have lots of pages in your site.# templateBuild
Type:
string
Default:
'@vuepress/client/templates/build.html'
Details:
Specify the path of the HTML template to be used for build.
# templateBuildRenderer
Type:
TemplateRenderer
Default:
templateRenderer
Details:
Specify the HTML template renderer to be used for build.
# Markdown Config
# markdown
',20),ne=e("li",null,[e("p",null,[l("Type: "),e("code",null,"MarkdownOptions")])],-1),oe=e("li",null,[e("p",null,[l("Default: "),e("code",null,"{}")])],-1),te=e("p",null,"Details:",-1),ae=e("p",null,"Configure VuePress built-in Markdown syntax extensions.",-1),se={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},ie=e("p",null,"Also see:",-1),de={href:"https://github.com/markdown-it/markdown-it#init-with-presets-and-options",target:"_blank",rel:"noopener noreferrer"},re=a(`# markdown.anchor
Type:
AnchorPluginOptions | false
Default:
`,3),pe=e("p",null,"Details:",-1),ce={href:"https://github.com/valeriangalliat/markdown-it-anchor",target:"_blank",rel:"noopener noreferrer"},ue=e("p",null,[l("Set to "),e("code",null,"false"),l(" to disable this plugin.")],-1),he=e("p",null,"Also see:",-1),fe=a('const defaultOptions = { + level: [1, 2, 3, 4, 5, 6], + permalink: anchorPlugin.permalink.ariaHidden({ + class: 'header-anchor', + symbol: '#', + space: true, + placement: 'before', + }), +} +
# markdown.assets
Type:
AssetsPluginOptions | false
Details:
Options for VuePress built-in markdown-it assets plugin.
Set to
false
to disable this plugin.DANGER
You should not configure it unless you understand what it is for.
# markdown.code
',4),me=e("li",null,[e("p",null,[l("Type: "),e("code",null,"CodePluginOptions | false")])],-1),_e=e("li",null,[e("p",null,"Details:"),e("p",null,"Options for VuePress built-in markdown-it code plugin."),e("p",null,[l("Set to "),e("code",null,"false"),l(" to disable this plugin.")])],-1),ge=e("p",null,"Also see:",-1),be=e("h4",{id:"markdown-code-highlightlines",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-highlightlines","aria-hidden":"true"},"#"),l(" markdown.code.highlightLines")],-1),De=e("li",null,[e("p",null,[l("Type: "),e("code",null,"boolean")])],-1),ye=e("li",null,[e("p",null,[l("Default: "),e("code",null,"true")])],-1),ke=e("li",null,[e("p",null,"Details:"),e("p",null,"Enable code line highlighting or not.")],-1),we=e("p",null,"Also see:",-1),ve=e("h4",{id:"markdown-code-linenumbers",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-linenumbers","aria-hidden":"true"},"#"),l(" markdown.code.lineNumbers")],-1),xe=a("Type:
boolean | number
Default:
true
",3),Ce=e("p",null,"Also see:",-1),Te=a(' Details:
Configure code line numbers.
- A
boolean
value is to enable line numbers or not.- A
number
value is the minimum number of lines to enable line numbers. For example, if you set it to4
, line numbers will only be enabled when your code block has at least 4 lines of code.# markdown.code.preWrapper
',2),Ee={class:"custom-container tip"},Ae=e("p",{class:"custom-container-title"},"TIP",-1),Pe={href:"https://prismjs.com/plugins/line-highlight/",target:"_blank",rel:"noopener noreferrer"},Se={href:"https://prismjs.com/plugins/line-numbers/",target:"_blank",rel:"noopener noreferrer"},Fe=e("h4",{id:"markdown-code-vpre-block",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-vpre-block","aria-hidden":"true"},"#"),l(" markdown.code.vPre.block")],-1),Be=a("
Type:
boolean
Default:
true
Details:
Enable the extra wrapper of the
<pre>
tag or not.The wrapper is required by the
highlightLines
andlineNumbers
. That means, if you disablepreWrapper
, the line highlighting and line numbers will also be disabled.Type:
boolean
Default:
true
",3),Le=e("p",null,"Also see:",-1),Ge=e("h4",{id:"markdown-code-vpre-inline",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-vpre-inline","aria-hidden":"true"},"#"),l(" markdown.code.vPre.inline")],-1),Oe=a(" Details:
Add
v-pre
directive to<pre>
tag of code block or not.Type:
boolean
Default:
true
",3),Ne=e("p",null,"Also see:",-1),Ie=e("h3",{id:"markdown-component",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-component","aria-hidden":"true"},"#"),l(" markdown.component")],-1),Me=e("li",null,[e("p",null,[l("Type: "),e("code",null,"undefined | false")])],-1),Re=e("p",null,"Details:",-1),qe={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-component",target:"_blank",rel:"noopener noreferrer"},He=e("p",null,[l("Set to "),e("code",null,"false"),l(" to disable this plugin.")],-1),Ve=e("div",{class:"custom-container danger"},[e("p",{class:"custom-container-title"},"DANGER"),e("p",null,"You should not configure it unless you understand what it is for.")],-1),je=e("h3",{id:"markdown-emoji",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-emoji","aria-hidden":"true"},"#"),l(" markdown.emoji")],-1),We=e("li",null,[e("p",null,[l("Type: "),e("code",null,"EmojiPluginOptions | false")])],-1),Ye=e("p",null,"Details:",-1),Ue={href:"https://github.com/markdown-it/markdown-it-emoji",target:"_blank",rel:"noopener noreferrer"},$e=e("p",null,[l("Set to "),e("code",null,"false"),l(" to disable this plugin.")],-1),ze=e("p",null,"Also see:",-1),Je=e("h3",{id:"markdown-frontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-frontmatter","aria-hidden":"true"},"#"),l(" markdown.frontmatter")],-1),Ke=e("li",null,[e("p",null,[l("Type: "),e("code",null,"FrontmatterPluginOptions | false")])],-1),Qe=e("p",null,"Details:",-1),Xe={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-frontmatter",target:"_blank",rel:"noopener noreferrer"},Ze=e("p",null,[l("Set to "),e("code",null,"false"),l(" to disable this plugin.")],-1),el=e("p",null,"Also see:",-1),ll=a(` Details:
Add
v-pre
directive to<code>
tag of inline code or not.DANGER
You should not configure it unless you understand what it is for.
# markdown.headers
Type:
HeadersPluginOptions | false
Default:
`,4),nl=e("p",null,"Details:",-1),ol={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-headers",target:"_blank",rel:"noopener noreferrer"},tl=e("p",null,[l("Set to "),e("code",null,"false"),l(" to disable this plugin.")],-1),al=e("p",null,"Also see:",-1),sl=e("h3",{id:"markdown-importcode",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-importcode","aria-hidden":"true"},"#"),l(" markdown.importCode")],-1),il=e("li",null,[e("p",null,[l("Type: "),e("code",null,"ImportCodePluginOptions | false")])],-1),dl=e("li",null,[e("p",null,"Details:"),e("p",null,"Options for VuePress built-in markdown-it import-code plugin."),e("p",null,[l("Set to "),e("code",null,"false"),l(" to disable this plugin.")])],-1),rl=e("p",null,"Also see:",-1),pl=a('const defaultOptions = { + level: [2, 3], +} +
# markdown.importCode.handleImportPath
Type:
(str: string) => string
Default:
(str) => str
Details:
A function to handle the import path of the import code syntax.
# markdown.links
',3),cl=a("Type:
LinksPluginOptions | false
",2),ul=e("p",null,"Also see:",-1),hl=a(' Details:
Options for VuePress built-in markdown-it links plugin.
It will convert internal links to
<RouterLink>
, and add extra attributes and icon to external links.Set to
false
to disable this plugin.# markdown.links.internalTag
Type:
'a' | 'RouterLink'
Default:
'RouterLink'
Details:
Tag for internal links.
By default, this plugin will transform internal links to
<RouterLink>
. You can set this option to'a'
to disable this feature.# markdown.links.externalAttrs
Type:
Record<string, string>
Default:
{ target: '_blank', rel: 'noopener noreferrer' }
Details:
Additional attributes for external links.
# markdown.sfc
',5),fl=e("li",null,[e("p",null,[l("Type: "),e("code",null,"SfcPluginOptions | false")])],-1),ml=e("p",null,"Details:",-1),_l={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-sfc",target:"_blank",rel:"noopener noreferrer"},gl=e("p",null,[l("Set to "),e("code",null,"false"),l(" to disable this plugin.")],-1),bl=e("p",null,"Also see:",-1),Dl=e("h3",{id:"markdown-slugify",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-slugify","aria-hidden":"true"},"#"),l(" markdown.slugify")],-1),yl=e("ul",null,[e("li",null,[e("p",null,[l("Type: "),e("code",null,"(str: string) => string")])]),e("li",null,[e("p",null,"Details:"),e("p",null,"The default slugify function.")])],-1),kl=e("h3",{id:"markdown-title",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-title","aria-hidden":"true"},"#"),l(" markdown.title")],-1),wl=e("li",null,[e("p",null,[l("Type: "),e("code",null,"undefined | false")])],-1),vl=e("p",null,"Details:",-1),xl={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-title",target:"_blank",rel:"noopener noreferrer"},Cl=e("p",null,[l("Set to "),e("code",null,"false"),l(" to disable this plugin.")],-1),Tl=a(`DANGER
You should not configure it unless you understand what it is for.
# markdown.toc
Type:
TocPluginOptions | false
Default:
`,4),El=e("p",null,"Details:",-1),Al={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc",target:"_blank",rel:"noopener noreferrer"},Pl=e("p",null,[l("Set to "),e("code",null,"false"),l(" to disable this plugin.")],-1),Sl=e("p",null,"Also see:",-1),Fl=e("h2",{id:"plugin-config",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#plugin-config","aria-hidden":"true"},"#"),l(" Plugin Config")],-1),Bl=e("h3",{id:"plugins",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#plugins","aria-hidden":"true"},"#"),l(" plugins")],-1),Ll=e("li",null,[e("p",null,[l("Type: "),e("code",null,"(Plugin | Plugin[])[]")])],-1),Gl=e("li",null,[e("p",null,"Details:"),e("p",null,"Plugins to use."),e("p",null,"This option accepts an array, each item of which could be a plugin or an array of plugins.")],-1),Ol=e("p",null,"Also see:",-1),Nl=e("h2",{id:"plugin-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#plugin-api","aria-hidden":"true"},"#"),l(" Plugin API")],-1),Il=e("p",null,[l("User config file also works as a VuePress plugin, so all of the Plugin APIs are available except the "),e("code",null,"name"),l(" and "),e("code",null,"multiple"),l(" options.")],-1);function Ml(Rl,ql){const d=i("NpmBadge"),o=i("RouterLink"),s=i("ExternalLinkIcon");return p(),c("div",null,[h,n(d,{package:"@vuepress/cli"}),n(d,{package:"@vuepress/core"}),f,m,e("ul",null,[_,e("li",null,[g,e("ul",null,[e("li",null,[n(o,{to:"/guide/assets.html#base-helper"},{default:t(()=>[l("Guide > Assets > Base Helper")]),_:1})]),e("li",null,[n(o,{to:"/guide/deployment.html"},{default:t(()=>[l("Guide > Deployment")]),_:1})])])])]),b,e("ul",null,[D,e("li",null,[y,e("ul",null,[k,e("li",null,[n(o,{to:"/reference/frontmatter.html#lang"},{default:t(()=>[l("Frontmatter > lang")]),_:1})])])])]),w,e("ul",null,[v,e("li",null,[x,e("ul",null,[C,e("li",null,[n(o,{to:"/reference/frontmatter.html#description"},{default:t(()=>[l("Frontmatter > description")]),_:1})])])])]),T,e("ul",null,[e("li",null,[l("Also see: "),e("ul",null,[E,e("li",null,[n(o,{to:"/reference/frontmatter.html#head"},{default:t(()=>[l("Frontmatter > head")]),_:1})])])])]),A,e("ul",null,[P,e("li",null,[S,e("ul",null,[e("li",null,[n(o,{to:"/guide/i18n.html"},{default:t(()=>[l("Guide > I18n")]),_:1})])])])]),F,B,e("ul",null,[L,G,e("li",null,[O,e("ul",null,[e("li",null,[n(o,{to:"/guide/theme.html"},{default:t(()=>[l("Guide > Theme")]),_:1})]),e("li",null,[n(o,{to:"/reference/default-theme/config.html"},{default:t(()=>[l("Default Theme > Config")]),_:1})])])])]),N,I,e("ul",null,[M,e("li",null,[R,e("ul",null,[e("li",null,[n(o,{to:"/guide/bundler.html"},{default:t(()=>[l("Guide > Bundler")]),_:1})]),e("li",null,[n(o,{to:"/reference/bundler/vite.html"},{default:t(()=>[l("Bundlers > Vite")]),_:1})]),e("li",null,[n(o,{to:"/reference/bundler/webpack.html"},{default:t(()=>[l("Bundlers > Webpack")]),_:1})])])])]),q,e("ul",null,[H,V,j,e("li",null,[W,e("ul",null,[e("li",null,[n(o,{to:"/guide/assets.html#public-files"},{default:t(()=>[l("Guide > Assets > Public Files")]),_:1})])])])]),Y,e("ul",null,[U,$,e("li",null,[z,J,e("p",null,[l("This would be helpful for developers. Also, we are using "),e("a",K,[l("debug"),n(s)]),l(" package for debug logging, which can be enabled via "),Q,l(" environment variable.")])])]),X,e("ul",null,[Z,e("li",null,[ee,e("ul",null,[e("li",null,[n(o,{to:"/reference/frontmatter.html#permalinkpattern"},{default:t(()=>[l("Frontmatter > permalinkPattern")]),_:1})])])])]),le,e("ul",null,[ne,oe,e("li",null,[te,ae,e("p",null,[l("It accepts all options of "),e("a",se,[l("markdown-it"),n(s)]),l(", and the following additional options.")])]),e("li",null,[ie,e("ul",null,[e("li",null,[e("a",de,[l("markdown-it > Init with presets and options"),n(s)])]),e("li",null,[n(o,{to:"/guide/markdown.html#syntax-extensions"},{default:t(()=>[l("Guide > Markdown > Syntax Extensions")]),_:1})])])])]),re,e("ul",null,[e("li",null,[pe,e("p",null,[l("Options for "),e("a",ce,[l("markdown-it-anchor"),n(s)]),l(".")]),ue]),e("li",null,[he,e("ul",null,[e("li",null,[n(o,{to:"/guide/markdown.html#header-anchors"},{default:t(()=>[l("Guide > Markdown > Syntax Extensions > Header Anchors")]),_:1})])])])]),fe,e("ul",null,[me,_e,e("li",null,[ge,e("ul",null,[e("li",null,[n(o,{to:"/guide/markdown.html#code-blocks"},{default:t(()=>[l("Guide > Markdown > Syntax Extensions > Code Blocks")]),_:1})])])])]),be,e("ul",null,[De,ye,ke,e("li",null,[we,e("ul",null,[e("li",null,[n(o,{to:"/guide/markdown.html#line-highlighting"},{default:t(()=>[l("Guide > Markdown > Syntax Extensions > Code Blocks > Line Highlighting")]),_:1})])])])]),ve,e("ul",null,[xe,e("li",null,[Ce,e("ul",null,[e("li",null,[n(o,{to:"/guide/markdown.html#line-numbers"},{default:t(()=>[l("Guide > Markdown > Syntax Extensions > Code Blocks > Line Numbers")]),_:1})])])])]),Te,e("div",Ee,[Ae,e("p",null,[l("You can disable it if you want to implement them in client side. For example, "),e("a",Pe,[l("Prismjs Line Highlight"),n(s)]),l(" or "),e("a",Se,[l("Prismjs Line Numbers"),n(s)]),l(".")])]),Fe,e("ul",null,[Be,e("li",null,[Le,e("ul",null,[e("li",null,[n(o,{to:"/guide/markdown.html#wrap-with-v-pre"},{default:t(()=>[l("Guide > Markdown > Syntax Extensions > Code Blocks > Wrap with v-pre")]),_:1})])])])]),Ge,e("ul",null,[Oe,e("li",null,[Ne,e("ul",null,[e("li",null,[n(o,{to:"/guide/markdown.html#wrap-with-v-pre"},{default:t(()=>[l("Guide > Markdown > Syntax Extensions > Code Blocks > Wrap with v-pre")]),_:1})])])])]),Ie,e("ul",null,[Me,e("li",null,[Re,e("p",null,[l("Options for "),e("a",qe,[l("@mdit-vue/plugin-component"),n(s)]),l(".")]),He])]),Ve,je,e("ul",null,[We,e("li",null,[Ye,e("p",null,[l("Options for "),e("a",Ue,[l("markdown-it-emoji"),n(s)]),l(".")]),$e]),e("li",null,[ze,e("ul",null,[e("li",null,[n(o,{to:"/guide/markdown.html#emoji"},{default:t(()=>[l("Guide > Markdown > Syntax Extensions > Emoji")]),_:1})])])])]),Je,e("ul",null,[Ke,e("li",null,[Qe,e("p",null,[l("Options for "),e("a",Xe,[l("@mdit-vue/plugin-frontmatter"),n(s)]),l(".")]),Ze]),e("li",null,[el,e("ul",null,[e("li",null,[n(o,{to:"/guide/page.html#frontmatter"},{default:t(()=>[l("Guide > Page > Frontmatter")]),_:1})]),e("li",null,[n(o,{to:"/reference/node-api.html#frontmatter"},{default:t(()=>[l("Node API > Page Properties > frontmatter")]),_:1})])])])]),ll,e("ul",null,[e("li",null,[nl,e("p",null,[l("Options for "),e("a",ol,[l("@mdit-vue/plugin-headers"),n(s)]),l(".")]),tl]),e("li",null,[al,e("ul",null,[e("li",null,[n(o,{to:"/reference/node-api.html#headers"},{default:t(()=>[l("Node API > Page Properties > headers")]),_:1})])])])]),sl,e("ul",null,[il,dl,e("li",null,[rl,e("ul",null,[e("li",null,[n(o,{to:"/guide/markdown.html#import-code-blocks"},{default:t(()=>[l("Guide > Markdown > Syntax Extensions > Import Code Blocks")]),_:1})])])])]),pl,e("ul",null,[cl,e("li",null,[ul,e("ul",null,[e("li",null,[n(o,{to:"/guide/markdown.html#links"},{default:t(()=>[l("Guide > Markdown > Syntax Extensions > Links")]),_:1})])])])]),hl,e("ul",null,[fl,e("li",null,[ml,e("p",null,[l("Options for "),e("a",_l,[l("@mdit-vue/plugin-sfc"),n(s)]),l(".")]),gl]),e("li",null,[bl,e("ul",null,[e("li",null,[n(o,{to:"/advanced/cookbook/markdown-and-vue-sfc.html"},{default:t(()=>[l("Cookbook > Markdown and Vue SFC")]),_:1})]),e("li",null,[n(o,{to:"/reference/node-api.html#sfcblocks"},{default:t(()=>[l("Node API > Page Properties > sfcBlocks")]),_:1})])])])]),Dl,yl,kl,e("ul",null,[wl,e("li",null,[vl,e("p",null,[l("Options for "),e("a",xl,[l("@mdit-vue/plugin-title"),n(s)]),l(".")]),Cl])]),Tl,e("ul",null,[e("li",null,[El,e("p",null,[l("Options for "),e("a",Al,[l("@mdit-vue/plugin-toc"),n(s)]),l(".")]),Pl]),e("li",null,[Sl,e("ul",null,[e("li",null,[n(o,{to:"/guide/markdown.html#table-of-contents"},{default:t(()=>[l("Guide > Markdown > Syntax Extensions > Table of Contents")]),_:1})])])])]),Fl,Bl,e("ul",null,[Ll,Gl,e("li",null,[Ol,e("ul",null,[e("li",null,[n(o,{to:"/guide/plugin.html"},{default:t(()=>[l("Guide > Plugin")]),_:1})])])])]),Nl,Il,e("p",null,[l("Please check out "),n(o,{to:"/reference/plugin-api.html"},{default:t(()=>[l("Plugin API Reference")]),_:1}),l(" for a full list of Plugin APIs.")])])}const Vl=r(u,[["render",Ml],["__file","config.html.vue"]]);export{Vl as default}; diff --git a/assets/config.html-mzxviKbd.js b/assets/config.html-mzxviKbd.js new file mode 100644 index 000000000..94df2a459 --- /dev/null +++ b/assets/config.html-mzxviKbd.js @@ -0,0 +1,22 @@ +import{_ as r,r as t,o as p,c,d as n,a as e,w as o,b as l,e as s}from"./app-eU2v8o1B.js";const u={},h=e("h1",{id:"配置",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#配置","aria-hidden":"true"},"#"),l(" 配置")],-1),m=e("h2",{id:"站点配置",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#站点配置","aria-hidden":"true"},"#"),l(" 站点配置")],-1),_=e("h3",{id:"base",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#base","aria-hidden":"true"},"#"),l(" base")],-1),f=s('const defaultOptions = { + level: [2, 3], +} +
类型:
string
默认值:
/
',3),D=e("p",null,"参考:",-1),g=s(' 详情:
部署站点的基础路径。
如果你想让你的网站部署到一个子路径下,你将需要设置它。它的值应当总是以斜杠开始,并以斜杠结束。举例来说,如果你想将你的网站部署到
https://foo.github.io/bar/
,那么base
应该被设置成"/bar/"
。
base
将会作为前缀自动地插入到以/
开始的其他选项的链接中,所以你只需要指定一次。(head 中的属性除外)需要注意的是,
base
应该是一个以/
开始和结束的绝对路径名。# lang
类型:
string
默认值:
en-US
详情:
站点的语言。
它将会在最终渲染出的 HTML 中作为
<html>
标签的lang
属性。它可以设置在不同语言的 locales 中。
参考:
# title
类型:
string
默认值:
''
详情:
站点的标题。
它将会作为所有页面标题的后缀,并且在默认主题的导航栏中显示。
它可以设置在不同语言的 locales 中。
参考:
# description
',5),b=s("类型:
string
默认值:
''
",3),k=e("p",null,"参考:",-1),v=e("li",null,[e("a",{href:"#locales"},"配置 > locales")],-1),y=s(` 详情:
站点的描述。
它将会在最终渲染出的 HTML 中作为
<meta name="description" />
标签的content
属性。它会被每个页面的 Frontmatter 中的description
字段覆盖。它可以设置在不同语言的 locales 中。
# head
类型:
HeadConfig[]
默认值:
[]
详情:
在最终渲染出的 HTML 的
<head>
标签内加入的额外标签。你可以通过
[tagName, { attrName: attrValue }, innerHTML?]
的格式来添加标签。它可以设置在不同语言的 locales 中。
需要注意的是,如果
attrValue
是一个 pathname ,它不会被自动添加 base 前缀,所以如果需要的话请记得手动添加前缀。示例:
增加一个自定义的 favicon :
export default { + head: [['link', { rel: 'icon', href: '/images/logo.png' }]], +} +
渲染为:
`,5),w=e("li",null,[e("a",{href:"#locales"},"配置 > locales")],-1),E=e("h3",{id:"locales",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#locales","aria-hidden":"true"},"#"),l(" locales")],-1),x=s('<head> + <link rel="icon" href="/images/logo.png" /> +</head> +
类型:
{ [path: string]: Partial<SiteLocaleData> }
默认值:
{}
',3),C=e("p",null,"参考:",-1),P=e("h2",{id:"主题配置",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#主题配置","aria-hidden":"true"},"#"),l(" 主题配置")],-1),A=e("h3",{id:"theme",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#theme","aria-hidden":"true"},"#"),l(" theme")],-1),B=e("li",null,[e("p",null,[l("类型: "),e("code",null,"Theme")])],-1),F=e("li",null,[e("p",null,"详情:"),e("p",null,"设置站点要使用的主题。"),e("p",null,"如果不设置该选项,将会使用默认主题。")],-1),z=e("p",null,"参考:",-1),M=e("h2",{id:"打包工具配置",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#打包工具配置","aria-hidden":"true"},"#"),l(" 打包工具配置")],-1),L=e("h3",{id:"bundler",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#bundler","aria-hidden":"true"},"#"),l(" bundler")],-1),V=s(" 详情:
多语言支持的各个语言 locales 。
可以使用的字段有:
类型:
Bundler
",2),N=e("p",null,"参考:",-1),O=s(' 详情:
设置站点要使用的打包工具。
如果不设置该选项,将会使用默认的打包工具:
- 使用
vuepress
或vuepress-vite
时,默认的打包工具是 Vite 。- 使用
vuepress-webpack
时,默认的打包工具是 Webpack 。# 通用配置项
# dest
类型:
string
默认值:
`${sourceDir}/.vuepress/dist`
详情:
指定
vuepress build
命令的输出目录。# temp
类型:
string
默认值:
`${sourceDir}/.vuepress/.temp`
详情:
指定临时文件目录。
注意
VuePress 在开发和构建时会加载临时文件,因此临时文件目录应位于项目根目录内部,以便可以正确地解析到依赖。
# cache
类型:
string
默认值:
`${sourceDir}/.vuepress/.cache`
详情:
指定缓存文件目录。
# public
',9),I=e("li",null,[e("p",null,[l("类型: "),e("code",null,"string")])],-1),j=e("li",null,[e("p",null,[l("默认值: "),e("code",null,"`${sourceDir}/.vuepress/public`")])],-1),q=e("li",null,[e("p",null,"详情:"),e("p",null,"指定 Public 文件目录。")],-1),H=e("p",null,"参考:",-1),T=e("h3",{id:"debug",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#debug","aria-hidden":"true"},"#"),l(" debug")],-1),R=e("li",null,[e("p",null,[l("类型: "),e("code",null,"boolean")])],-1),S=e("li",null,[e("p",null,[l("默认值: "),e("code",null,"false")])],-1),W=e("p",null,"详情:",-1),$=e("p",null,"是否启用 Debug 模式。",-1),U={href:"https://github.com/visionmedia/debug",target:"_blank",rel:"noopener noreferrer"},G=e("code",null,"DEBUG=vuepress*",-1),J=s('# pagePatterns
类型:
string[]
默认值:
['**/*.md', '!.vuepress', '!node_modules']
详情:
指定页面文件的 Patterns 。这些 Patterns 是相对于 Source 目录的。
# permalinkPattern
',3),K=s("类型:
string | null
默认值:
null
",3),Q=e("p",null,"参考:",-1),X=s(' 详情:
指定为页面生成永久链接的 Pattern 。
它会被每个页面的 Frontmatter 中的
permalinkPattern
字段覆盖。# Dev 配置项
# host
类型:
string
默认值:
'0.0.0.0'
详情:
指定开发服务器的主机名。
# port
类型:
number
默认值:
8080
详情:
指定开发服务器的端口号。
# open
类型:
boolean
默认值:
false
详情:
是否在开发服务器启动后打开浏览器。
# templateDev
类型:
string
默认值:
'@vuepress/client/templates/dev.html'
详情:
指定开发时使用的 HTML 模板。
# Build 配置项
# shouldPreload
类型:
((file: string, type: string) => boolean)) | boolean
默认值:
true
详情:
一个函数,用来控制哪些文件是需要生成对应的
<link rel="preload">
标签的。设置为true
或者false
来完全启用或禁用它。默认情况下,只有当前页面所需的文件会被预加载。所以在绝大部分情况下,你只需要使用
true
就可以了。# shouldPrefetch
类型:
((file: string, type: string) => boolean)) | boolean
默认值:
true
详情:
一个函数,用来控制哪些文件是需要生成对应的
<link rel="prefetch">
标签的。设置为true
或者false
来完全启用或禁用它。如果你将它设置为
true
,所有其它页面所需的文件都会被预拉取。这对于小型站点来说是十分有帮助的,因为它会大大提升页面切换的速度。但是在你的网站有很多页面时不建议你这么做。# templateBuild
类型:
string
默认值:
'@vuepress/client/templates/build.html'
详情:
指定构建时使用的 HTML 模板路径。
# templateBuildRenderer
类型:
TemplateRenderer
默认值:
templateRenderer
详情:
指定构建时使用的 HTML 模板渲染函数。
# Markdown 配置
# markdown
',20),Y=e("li",null,[e("p",null,[l("类型: "),e("code",null,"MarkdownOptions")])],-1),Z=e("li",null,[e("p",null,[l("默认值: "),e("code",null,"{}")])],-1),ee=e("p",null,"详情:",-1),le=e("p",null,"对 VuePress 内置的 Markdown 语法扩展进行配置。",-1),ne={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},ae=e("p",null,"参考:",-1),oe={href:"https://github.com/markdown-it/markdown-it#init-with-presets-and-options",target:"_blank",rel:"noopener noreferrer"},se=s(`# markdown.anchor
类型:
AnchorPluginOptions | false
默认值:
`,3),ie=e("p",null,"详情:",-1),te={href:"https://github.com/valeriangalliat/markdown-it-anchor",target:"_blank",rel:"noopener noreferrer"},de=e("p",null,[l("设置为 "),e("code",null,"false"),l(" 可以禁用该插件。")],-1),re=e("p",null,"参考:",-1),pe=s('const defaultOptions = { + level: [1, 2, 3, 4, 5, 6], + permalink: anchorPlugin.permalink.ariaHidden({ + class: 'header-anchor', + symbol: '#', + space: true, + placement: 'before', + }), +} +
# markdown.assets
类型:
AssetsPluginOptions | false
详情:
VuePress 内置的 markdown-it assets 插件的配置项。
设置为
false
可以禁用该插件。警告
除非你了解它的用途,否则你不应该设置该配置项。
# markdown.code
',4),ce=e("li",null,[e("p",null,[l("类型: "),e("code",null,"CodePluginOptions | false")])],-1),ue=e("li",null,[e("p",null,"详情:"),e("p",null,"VuePress 内置的 markdown-it code 插件的配置项。"),e("p",null,[l("设置为 "),e("code",null,"false"),l(" 可以禁用该插件。")])],-1),he=e("p",null,"参考:",-1),me=e("h4",{id:"markdown-code-highlightlines",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-highlightlines","aria-hidden":"true"},"#"),l(" markdown.code.highlightLines")],-1),_e=e("li",null,[e("p",null,[l("类型: "),e("code",null,"boolean")])],-1),fe=e("li",null,[e("p",null,[l("默认值: "),e("code",null,"true")])],-1),De=e("li",null,[e("p",null,"详情:"),e("p",null,"是否启用代码块行高亮。")],-1),ge=e("p",null,"参考:",-1),be=e("h4",{id:"markdown-code-linenumbers",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-linenumbers","aria-hidden":"true"},"#"),l(" markdown.code.lineNumbers")],-1),ke=s("类型:
boolean | number
默认值:
true
",3),ve=e("p",null,"参考:",-1),ye=s(' 详情:
配置代码块行号。
- 布尔值
boolean
代表是否启用代码块行号。- 数字
number
代表显示行号所需的最少行数。例如,如果你将它设置为4
,那么只有在你的代码块包含至少 4 行代码时才会启用行号。# markdown.code.preWrapper
',2),we={class:"custom-container tip"},Ee=e("p",{class:"custom-container-title"},"提示",-1),xe={href:"https://prismjs.com/plugins/line-highlight/",target:"_blank",rel:"noopener noreferrer"},Ce={href:"https://prismjs.com/plugins/line-numbers/",target:"_blank",rel:"noopener noreferrer"},Pe=e("h4",{id:"markdown-code-vpre-block",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-vpre-block","aria-hidden":"true"},"#"),l(" markdown.code.vPre.block")],-1),Ae=s("
类型:
boolean
默认值:
true
详情:
是否在
<pre>
标签外额外包裹一层。
highlightLines
和lineNumbers
依赖于这个额外的包裹层。这换句话说,如果你禁用了preWrapper
,那么行高亮和行号也会被同时禁用。类型:
boolean
默认值:
true
",3),Be=e("p",null,"参考:",-1),Fe=e("h4",{id:"markdown-code-vpre-inline",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-code-vpre-inline","aria-hidden":"true"},"#"),l(" markdown.code.vPre.inline")],-1),ze=s(" 详情:
是否在代码块的
<pre>
标签上添加v-pre
指令。类型:
boolean
默认值:
true
",3),Me=e("p",null,"参考:",-1),Le=e("h3",{id:"markdown-component",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-component","aria-hidden":"true"},"#"),l(" markdown.component")],-1),Ve=e("li",null,[e("p",null,[l("类型: "),e("code",null,"undefined | false")])],-1),Ne=e("p",null,"详情:",-1),Oe={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-component",target:"_blank",rel:"noopener noreferrer"},Ie=e("p",null,[l("设置为 "),e("code",null,"false"),l(" 可以禁用该插件。")],-1),je=e("div",{class:"custom-container danger"},[e("p",{class:"custom-container-title"},"警告"),e("p",null,"除非你了解它的用途,否则你不应该设置该配置项。")],-1),qe=e("h3",{id:"markdown-emoji",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-emoji","aria-hidden":"true"},"#"),l(" markdown.emoji")],-1),He=e("li",null,[e("p",null,[l("类型: "),e("code",null,"EmojiPluginOptions | false")])],-1),Te=e("p",null,"详情:",-1),Re={href:"https://github.com/markdown-it/markdown-it-emoji",target:"_blank",rel:"noopener noreferrer"},Se=e("p",null,[l("设置为 "),e("code",null,"false"),l(" 可以禁用该插件。")],-1),We=e("p",null,"参考:",-1),$e=e("h3",{id:"markdown-frontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-frontmatter","aria-hidden":"true"},"#"),l(" markdown.frontmatter")],-1),Ue=e("li",null,[e("p",null,[l("类型: "),e("code",null,"FrontmatterPluginOptions | false")])],-1),Ge=e("p",null,"详情:",-1),Je={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-frontmatter",target:"_blank",rel:"noopener noreferrer"},Ke=e("p",null,[l("设置为 "),e("code",null,"false"),l(" 可以禁用该插件。")],-1),Qe=e("p",null,"参考:",-1),Xe=s(` 详情:
是否在行内代码的
<code>
标签上添加v-pre
指令。警告
除非你了解它的用途,否则你不应该设置该配置项。
# markdown.headers
类型:
HeadersPluginOptions | false
默认值:
`,4),Ye=e("p",null,"详情:",-1),Ze={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-headers",target:"_blank",rel:"noopener noreferrer"},el=e("p",null,[l("设置为 "),e("code",null,"false"),l(" 可以禁用该插件。")],-1),ll=e("p",null,"参考:",-1),nl=e("h3",{id:"markdown-title",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-title","aria-hidden":"true"},"#"),l(" markdown.title")],-1),al=e("li",null,[e("p",null,[l("类型: "),e("code",null,"undefined | false")])],-1),ol=e("p",null,"详情:",-1),sl={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-title",target:"_blank",rel:"noopener noreferrer"},il=e("p",null,[l("设置为 "),e("code",null,"false"),l(" 可以禁用该插件。")],-1),tl=e("div",{class:"custom-container danger"},[e("p",{class:"custom-container-title"},"警告"),e("p",null,"除非你了解它的用途,否则你不应该设置该配置项。")],-1),dl=e("h3",{id:"markdown-importcode",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#markdown-importcode","aria-hidden":"true"},"#"),l(" markdown.importCode")],-1),rl=e("li",null,[e("p",null,[l("类型: "),e("code",null,"ImportCodePluginOptions | false")])],-1),pl=e("li",null,[e("p",null,"详情:"),e("p",null,"VuePress 内置的 markdown-it 导入代码插件的配置项。"),e("p",null,[l("设置为 "),e("code",null,"false"),l(" 可以禁用该插件。")])],-1),cl=e("p",null,"参考:",-1),ul=s('const defaultOptions = { + level: [2, 3], +} +
# markdown.importCode.handleImportPath
类型:
(str: string) => string
默认值:
(str) => str
详情:
一个函数,用于处理导入代码语法中的文件导入路径。
# markdown.links
',3),hl=s("类型:
LinkPluginOptions | false
",2),ml=e("p",null,"参考:",-1),_l=s(' 详情:
VuePress 内置的 markdown-it 链接插件的配置项。
它可以把站内链接转换为
<RouterLink>
,并且可以在站外链接上添加额外的属性和图标。设置为
false
可以禁用该插件。# markdown.links.internalTag
类型:
string
默认值:
'RouterLink'
详情:
内部链接所使用的标签。
默认情况下,该插件会把内部链接转换为
<RouterLink>
。你可以把该选项设置为'a'
来禁用这个功能。# markdown.links.externalAttrs
类型:
Record<string, string>
默认值:
{ target: '_blank', rel: 'noopener noreferrer' }
详情:
为外部链接添加额外的属性。
# markdown.sfc
',5),fl=e("li",null,[e("p",null,[l("类型: "),e("code",null,"SfcPluginOptions | false")])],-1),Dl=e("p",null,"详情:",-1),gl={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-sfc",target:"_blank",rel:"noopener noreferrer"},bl=e("p",null,[l("设置为 "),e("code",null,"false"),l(" 可以禁用该插件。")],-1),kl=e("p",null,"参考:",-1),vl=s(`# markdown.slugify
类型:
(str: string) => string
详情:
默认使用的 slugify 函数。
# markdown.toc
类型:
TocPluginOptions | false
默认值:
`,5),yl=e("p",null,"详情:",-1),wl={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc",target:"_blank",rel:"noopener noreferrer"},El=e("p",null,[l("设置为 "),e("code",null,"false"),l(" 可以禁用该插件。")],-1),xl=e("p",null,"参考:",-1),Cl=e("h2",{id:"插件配置",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#插件配置","aria-hidden":"true"},"#"),l(" 插件配置")],-1),Pl=e("h3",{id:"plugins",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#plugins","aria-hidden":"true"},"#"),l(" plugins")],-1),Al=e("li",null,[e("p",null,[l("类型: "),e("code",null,"PluginConfig[]")])],-1),Bl=e("li",null,[e("p",null,"详情:"),e("p",null,"要使用的插件。"),e("p",null,"该配置项接收一个数组,其中的每一个数组项是一个或一组插件。")],-1),Fl=e("p",null,"参考:",-1),zl=e("h2",{id:"插件-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#插件-api","aria-hidden":"true"},"#"),l(" 插件 API")],-1),Ml=e("p",null,[l("用户配置文件同样可以作为一个 VuePress 插件,所以除了 "),e("code",null,"name"),l(" 和 "),e("code",null,"multiple"),l(" 配置项以外的所有插件 API 都可以在配置文件中使用。")],-1);function Ll(Vl,Nl){const d=t("NpmBadge"),a=t("RouterLink"),i=t("ExternalLinkIcon");return p(),c("div",null,[h,n(d,{package:"@vuepress/cli"}),n(d,{package:"@vuepress/core"}),m,_,e("ul",null,[f,e("li",null,[D,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/assets.html#base-helper"},{default:o(()=>[l("指南 > 静态资源 > Base Helper")]),_:1})]),e("li",null,[n(a,{to:"/zh/guide/deployment.html"},{default:o(()=>[l("指南 > 部署")]),_:1})])])])]),g,e("ul",null,[b,e("li",null,[k,e("ul",null,[v,e("li",null,[n(a,{to:"/zh/reference/frontmatter.html#description"},{default:o(()=>[l("Frontmatter > description")]),_:1})])])])]),y,e("ul",null,[e("li",null,[l("参考: "),e("ul",null,[w,e("li",null,[n(a,{to:"/zh/reference/frontmatter.html#head"},{default:o(()=>[l("Frontmatter > head")]),_:1})])])])]),E,e("ul",null,[x,e("li",null,[C,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/i18n.html"},{default:o(()=>[l("指南 > I18n")]),_:1})])])])]),P,A,e("ul",null,[B,F,e("li",null,[z,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/theme.html"},{default:o(()=>[l("指南 > 主题")]),_:1})]),e("li",null,[n(a,{to:"/zh/reference/default-theme/config.html"},{default:o(()=>[l("默认主题 > 配置")]),_:1})])])])]),M,L,e("ul",null,[V,e("li",null,[N,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/bundler.html"},{default:o(()=>[l("指南 > 打包工具")]),_:1})]),e("li",null,[n(a,{to:"/zh/reference/bundler/vite.html"},{default:o(()=>[l("打包工具 > Vite")]),_:1})]),e("li",null,[n(a,{to:"/zh/reference/bundler/webpack.html"},{default:o(()=>[l("打包工具 > Webpack")]),_:1})])])])]),O,e("ul",null,[I,j,q,e("li",null,[H,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/assets.html#public-%E6%96%87%E4%BB%B6"},{default:o(()=>[l("指南 > 静态资源 > Public 文件")]),_:1})])])])]),T,e("ul",null,[R,S,e("li",null,[W,$,e("p",null,[l("该配置项主要提供给开发者使用。同时,我们使用了 "),e("a",U,[l("debug"),n(i)]),l(" 模块打印 Debug 日志,可以通过 "),G,l(" 环境变量来启用。")])])]),J,e("ul",null,[K,e("li",null,[Q,e("ul",null,[e("li",null,[n(a,{to:"/zh/reference/frontmatter.html#permalinkpattern"},{default:o(()=>[l("Frontmatter > permalinkPattern")]),_:1})])])])]),X,e("ul",null,[Y,Z,e("li",null,[ee,le,e("p",null,[l("它可以接收 "),e("a",ne,[l("markdown-it"),n(i)]),l(" 的所有配置项,以及下列额外的配置项。")])]),e("li",null,[ae,e("ul",null,[e("li",null,[e("a",oe,[l("markdown-it > Init with presets and options"),n(i)])]),e("li",null,[n(a,{to:"/zh/guide/markdown.html#%E8%AF%AD%E6%B3%95%E6%89%A9%E5%B1%95"},{default:o(()=>[l("指南 > Markdown > 语法扩展")]),_:1})])])])]),se,e("ul",null,[e("li",null,[ie,e("p",null,[e("a",te,[l("markdown-it-anchor"),n(i)]),l(" 的配置项。")]),de]),e("li",null,[re,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/markdown.html#%E6%A0%87%E9%A2%98%E9%94%9A%E7%82%B9"},{default:o(()=>[l("指南 > Markdown > 语法扩展 > 标题锚点")]),_:1})])])])]),pe,e("ul",null,[ce,ue,e("li",null,[he,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/markdown.html#%E4%BB%A3%E7%A0%81%E5%9D%97"},{default:o(()=>[l("指南 > Markdown > 语法扩展 > 代码块")]),_:1})])])])]),me,e("ul",null,[_e,fe,De,e("li",null,[ge,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/markdown.html#%E8%A1%8C%E9%AB%98%E4%BA%AE"},{default:o(()=>[l("指南 > Markdown > 语法扩展 > 代码块 > 行高亮")]),_:1})])])])]),be,e("ul",null,[ke,e("li",null,[ve,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/markdown.html#%E8%A1%8C%E5%8F%B7"},{default:o(()=>[l("指南 > Markdown > 语法扩展 > 代码块 > 行号")]),_:1})])])])]),ye,e("div",we,[Ee,e("p",null,[l("如果你想要在客户端来实现这些功能时,可以禁用该配置项。比如使用 "),e("a",xe,[l("Prismjs Line Highlight"),n(i)]),l(" 或者 "),e("a",Ce,[l("Prismjs Line Numbers"),n(i)]),l("。")])]),Pe,e("ul",null,[Ae,e("li",null,[Be,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/markdown.html#%E6%B7%BB%E5%8A%A0-v-pre"},{default:o(()=>[l("指南 > Markdown > 语法扩展 > 代码块 > 添加 v-pre")]),_:1})])])])]),Fe,e("ul",null,[ze,e("li",null,[Me,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/markdown.html#%E6%B7%BB%E5%8A%A0-v-pre"},{default:o(()=>[l("指南 > Markdown > 语法扩展 > 代码块 > 添加 v-pre")]),_:1})])])])]),Le,e("ul",null,[Ve,e("li",null,[Ne,e("p",null,[e("a",Oe,[l("@mdit-vue/plugin-component"),n(i)]),l(" 插件的配置项。")]),Ie])]),je,qe,e("ul",null,[He,e("li",null,[Te,e("p",null,[e("a",Re,[l("markdown-it-emoji"),n(i)]),l(" 的配置项。")]),Se]),e("li",null,[We,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/markdown.html#emoji"},{default:o(()=>[l("指南 > Markdown > 语法扩展 > Emoji")]),_:1})])])])]),$e,e("ul",null,[Ue,e("li",null,[Ge,e("p",null,[e("a",Je,[l("@mdit-vue/plugin-frontmatter"),n(i)]),l(" 插件的配置项。")]),Ke]),e("li",null,[Qe,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/page.html#frontmatter"},{default:o(()=>[l("指南 > 页面 > Frontmatter")]),_:1})]),e("li",null,[n(a,{to:"/zh/reference/node-api.html#frontmatter"},{default:o(()=>[l("Node API > Page 属性 > frontmatter")]),_:1})])])])]),Xe,e("ul",null,[e("li",null,[Ye,e("p",null,[e("a",Ze,[l("@mdit-vue/plugin-headers"),n(i)]),l(" 插件的配置项。")]),el]),e("li",null,[ll,e("ul",null,[e("li",null,[n(a,{to:"/zh/reference/node-api.html#headers"},{default:o(()=>[l("Node API > Page 属性 > headers")]),_:1})])])])]),nl,e("ul",null,[al,e("li",null,[ol,e("p",null,[e("a",sl,[l("@mdit-vue/plugin-title"),n(i)]),l(" 插件的配置项。")]),il])]),tl,dl,e("ul",null,[rl,pl,e("li",null,[cl,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/markdown.html#%E5%AF%BC%E5%85%A5%E4%BB%A3%E7%A0%81%E5%9D%97"},{default:o(()=>[l("指南 > Markdown > 语法扩展 > 导入代码块")]),_:1})])])])]),ul,e("ul",null,[hl,e("li",null,[ml,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/markdown.html#%E9%93%BE%E6%8E%A5"},{default:o(()=>[l("指南 > Markdown > 语法扩展 > 链接")]),_:1})])])])]),_l,e("ul",null,[fl,e("li",null,[Dl,e("p",null,[e("a",gl,[l("@mdit-vue/plugin-sfc"),n(i)]),l(" 插件的配置项。")]),bl]),e("li",null,[kl,e("ul",null,[e("li",null,[n(a,{to:"/zh/advanced/cookbook/markdown-and-vue-sfc.html"},{default:o(()=>[l("Cookbook > Markdown 与 Vue SFC")]),_:1})]),e("li",null,[n(a,{to:"/zh/reference/node-api.html#sfcblocks"},{default:o(()=>[l("Node API > Page 属性 > sfcBlocks")]),_:1})])])])]),vl,e("ul",null,[e("li",null,[yl,e("p",null,[e("a",wl,[l("@mdit-vue/plugin-toc"),n(i)]),l(" 插件的配置项。")]),El]),e("li",null,[xl,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/markdown.html#%E7%9B%AE%E5%BD%95"},{default:o(()=>[l("指南 > Markdown > 语法扩展 > 目录")]),_:1})])])])]),Cl,Pl,e("ul",null,[Al,Bl,e("li",null,[Fl,e("ul",null,[e("li",null,[n(a,{to:"/zh/guide/plugin.html"},{default:o(()=>[l("指南 > 插件")]),_:1})])])])]),zl,Ml,e("p",null,[l("前往 "),n(a,{to:"/zh/reference/plugin-api.html"},{default:o(()=>[l("插件 API 参考")]),_:1}),l(" 查看所有插件 API 。")])])}const Il=r(u,[["render",Ll],["__file","config.html.vue"]]);export{Il as default}; diff --git a/assets/config.html-pdR6VJD6.js b/assets/config.html-pdR6VJD6.js new file mode 100644 index 000000000..77aa9dac3 --- /dev/null +++ b/assets/config.html-pdR6VJD6.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-03a561ce","path":"/zh/reference/default-theme/config.html","title":"配置","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"基础配置","slug":"基础配置","link":"#基础配置","children":[{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"Locale 配置","slug":"locale-配置","link":"#locale-配置","children":[{"level":3,"title":"colorMode","slug":"colormode","link":"#colormode","children":[]},{"level":3,"title":"colorModeSwitch","slug":"colormodeswitch","link":"#colormodeswitch","children":[]},{"level":3,"title":"home","slug":"home","link":"#home","children":[]},{"level":3,"title":"navbar","slug":"navbar","link":"#navbar","children":[]},{"level":3,"title":"logo","slug":"logo","link":"#logo","children":[]},{"level":3,"title":"logoDark","slug":"logodark","link":"#logodark","children":[]},{"level":3,"title":"repo","slug":"repo","link":"#repo","children":[]},{"level":3,"title":"repoLabel","slug":"repolabel","link":"#repolabel","children":[]},{"level":3,"title":"selectLanguageText","slug":"selectlanguagetext","link":"#selectlanguagetext","children":[]},{"level":3,"title":"selectLanguageAriaLabel","slug":"selectlanguagearialabel","link":"#selectlanguagearialabel","children":[]},{"level":3,"title":"selectLanguageName","slug":"selectlanguagename","link":"#selectlanguagename","children":[]},{"level":3,"title":"sidebar","slug":"sidebar","link":"#sidebar","children":[]},{"level":3,"title":"sidebarDepth","slug":"sidebardepth","link":"#sidebardepth","children":[]},{"level":3,"title":"editLink","slug":"editlink","link":"#editlink","children":[]},{"level":3,"title":"editLinkText","slug":"editlinktext","link":"#editlinktext","children":[]},{"level":3,"title":"editLinkPattern","slug":"editlinkpattern","link":"#editlinkpattern","children":[]},{"level":3,"title":"docsRepo","slug":"docsrepo","link":"#docsrepo","children":[]},{"level":3,"title":"docsBranch","slug":"docsbranch","link":"#docsbranch","children":[]},{"level":3,"title":"docsDir","slug":"docsdir","link":"#docsdir","children":[]},{"level":3,"title":"lastUpdated","slug":"lastupdated","link":"#lastupdated","children":[]},{"level":3,"title":"lastUpdatedText","slug":"lastupdatedtext","link":"#lastupdatedtext","children":[]},{"level":3,"title":"contributors","slug":"contributors","link":"#contributors","children":[]},{"level":3,"title":"contributorsText","slug":"contributorstext","link":"#contributorstext","children":[]},{"level":3,"title":"tip","slug":"tip","link":"#tip","children":[]},{"level":3,"title":"warning","slug":"warning","link":"#warning","children":[]},{"level":3,"title":"danger","slug":"danger","link":"#danger","children":[]},{"level":3,"title":"notFound","slug":"notfound","link":"#notfound","children":[]},{"level":3,"title":"backToHome","slug":"backtohome","link":"#backtohome","children":[]},{"level":3,"title":"openInNewWindow","slug":"openinnewwindow","link":"#openinnewwindow","children":[]},{"level":3,"title":"toggleColorMode","slug":"togglecolormode","link":"#togglecolormode","children":[]},{"level":3,"title":"toggleSidebar","slug":"togglesidebar","link":"#togglesidebar","children":[]}]},{"level":2,"title":"插件配置","slug":"插件配置","link":"#插件配置","children":[{"level":3,"title":"themePlugins","slug":"themeplugins","link":"#themeplugins","children":[]},{"level":3,"title":"themePlugins.activeHeaderLinks","slug":"themeplugins-activeheaderlinks","link":"#themeplugins-activeheaderlinks","children":[]},{"level":3,"title":"themePlugins.container","slug":"themeplugins-container","link":"#themeplugins-container","children":[]},{"level":3,"title":"themePlugins.externalLinkIcon","slug":"themeplugins-externallinkicon","link":"#themeplugins-externallinkicon","children":[]},{"level":3,"title":"themePlugins.git","slug":"themeplugins-git","link":"#themeplugins-git","children":[]},{"level":3,"title":"themePlugins.mediumZoom","slug":"themeplugins-mediumzoom","link":"#themeplugins-mediumzoom","children":[]},{"level":3,"title":"themePlugins.nprogress","slug":"themeplugins-nprogress","link":"#themeplugins-nprogress","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/default-theme/config.md"}');export{e as data}; diff --git a/assets/config.html-y99KBdbl.js b/assets/config.html-y99KBdbl.js new file mode 100644 index 000000000..4afd39d61 --- /dev/null +++ b/assets/config.html-y99KBdbl.js @@ -0,0 +1,173 @@ +import{_ as c,r as i,o as r,c as d,d as l,a as s,b as e,w as a,e as o}from"./app-eU2v8o1B.js";const D={},u=s("h1",{id:"config",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#config","aria-hidden":"true"},"#"),e(" Config")],-1),h=o(`const defaultOptions = { + level: [2, 3], +} +
import { defaultTheme } from '@vuepress/theme-default' + +export default { + theme: defaultTheme({ + // set config here + }), +} +
# Basic Config
# locales
`,3),y=s("li",null,[s("p",null,[e("Type: "),s("code",null,"{ [path: string]: Partial}")])],-1),m=s("li",null,[s("p",null,[e("Default: "),s("code",null,"{}")])],-1),b=s("p",null,"Details:",-1),v=s("p",null,"Specify locales for i18n support.",-1),f=s("p",null,[e("All the options inside the "),s("a",{href:"#locale-config"},"Locale Config"),e(" section can be used in locales.")],-1),g=s("code",null,"locales",-1),C=s("p",null,"Also see:",-1),_=o(' # Locale Config
Config of this section can be used as normal config, and can also be used in the locales option.
# colorMode
',3),E=s("li",null,[s("p",null,[e("Type: "),s("code",null,"'auto' | 'light' | 'dark'")])],-1),x=s("li",null,[s("p",null,[e("Default: "),s("code",null,"'auto'")])],-1),k=s("p",null,"Details:",-1),T=s("p",null,"Default color mode.",-1),w=s("code",null,"'auto'",-1),F={href:"https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme",target:"_blank",rel:"noopener noreferrer"},A=s("li",null,[s("p",null,"Also see:"),s("ul",null,[s("li",null,[s("a",{href:"#colormodeswitch"},"Default Theme > Config > colorModeSwitch")])])],-1),S=o(`# colorModeSwitch
Type:
boolean
Default:
true
Details:
Enable color mode switching or not.
If set to
true
, a button to switch color mode will be displayed in the navbar.Also see:
# home
Type:
string
Default:
/
Details:
Specify the path of the homepage.
This will be used for:
- the logo link of the navbar
- the back to home link of the 404 page
# navbar
Type:
false | (NavbarItem | NavbarGroup | string)[]
Default:
[]
Details:
Configuration of navbar.
Set to
false
to disable navbar.To configure the navbar items, you can set it to a navbar array, each item of which could be a
NavbarItem
object, aNavbarGroup
object, or a string:
- A
NavbarItem
object should have atext
field and alink
field, could have an optionalactiveMatch
field.- A
NavbarGroup
object should have atext
field and achildren
field. Thechildren
field should be a navbar array, too.- A string should be the path to the target page file. It will be converted to a
NavbarItem
object, using the page title astext
, and the page route path aslink
.Example 1:
export default { + theme: defaultTheme({ + navbar: [ + // NavbarItem + { + text: 'Foo', + link: '/foo/', + }, + // NavbarGroup + { + text: 'Group', + children: ['/group/foo.md', '/group/bar.md'], + }, + // string - page file path + '/bar/README.md', + ], + }), +} +
- Example 2:
export default { + theme: defaultTheme({ + navbar: [ + // nested group - max depth is 2 + { + text: 'Group', + children: [ + { + text: 'SubGroup', + children: ['/group/sub/foo.md', '/group/sub/bar.md'], + }, + ], + }, + // control when should the item be active + { + text: 'Group 2', + children: [ + { + text: 'Always active', + link: '/', + // this item will always be active + activeMatch: '/', + }, + { + text: 'Active on /foo/', + link: '/not-foo/', + // this item will be active when current route path starts with /foo/ + // regular expression is supported + activeMatch: '^/foo/', + }, + ], + }, + ], + }), +} +
# logo
Type:
null | string
Details:
Specify the url of logo image.
The logo image will be displayed at the left end of the navbar.
Set to
null
to disable logo.Example:
`,12),I=o(`export default { + theme: defaultTheme({ + // public file path + logo: '/hero.png', + // url + logo: 'https://vuejs.org/images/logo.png', + }), +} +
# logoDark
Type:
null | string
Details:
Specify the url of logo image to be used in dark mode.
You can make use of this option if you want to use different logo config in dark mode.
Set to
null
to disable logo in dark mode. Omit this option to use logo in dark mode.Also see:
# repo
Type:
string
Details:
Specify the repository url of your project.
This will be used as the link of the repository link, which will be displayed as the last item of the navbar.
export default { + theme: defaultTheme({ + // If you set it in the form of \`organization/repository\` + // we will take it as a GitHub repo + repo: 'vuejs/vuepress', + // You can also set it to a URL directly + repo: 'https://gitlab.com/foo/bar', + }), +} +
# repoLabel
Type:
string
Details:
Specify the repository label of your project.
This will be used as the text of the repository link, which will be displayed as the last item of the navbar.
If you don't set this option explicitly, it will be automatically inferred from the repo option.
# selectLanguageText
`,8),L=s("li",null,[s("p",null,[e("Type: "),s("code",null,"string")])],-1),N=s("p",null,"Details:",-1),G=s("p",null,[e("Specify the text of the "),s("em",null,"select language menu"),e(".")],-1),P=s("em",null,"select language menu",-1),R=o(`# selectLanguageAriaLabel
Type:
string
Details:
Specify the
aria-label
attribute of the select language menu.This is mainly for a11y purpose.
# selectLanguageName
Type:
string
Details:
Specify the name of the language of a locale.
This option will only take effect inside the locales of your theme config. It will be used as the language name of the locale, which will be displayed in the select language menu.
Example:
export default { + locales: { + '/': { + lang: 'en-US', + }, + '/zh/': { + lang: 'zh-CN', + }, + }, + theme: defaultTheme({ + locales: { + '/': { + selectLanguageName: 'English', + }, + '/zh/': { + selectLanguageName: '简体中文', + }, + }, + }), +} +
# sidebar
`,6),j=s("li",null,[s("p",null,[e("Type: "),s("code",null,"false | 'auto' | SidebarConfigArray | SidebarConfigObject")])],-1),M=s("li",null,[s("p",null,[e("Default: "),s("code",null,"'auto'")])],-1),B=s("p",null,"Details:",-1),z=s("p",null,"Configuration of sidebar.",-1),U=o("Set to
false
to disable sidebar.If you set it to
'auto'
, the sidebar will be automatically generated from the page headers.To configure the sidebar items manually, you can set this option to a sidebar array, each item of which could be a
SidebarItem
object or a string:
- A
SidebarItem
object should have atext
field, could have an optionallink
field, an optionalchildren
field and an optionalcollapsible
field. Thechildren
field should be a sidebar array. Thecollapsible
field controls whether the item is collapsible.- A string should be the path to the target page file. It will be converted to a
SidebarItem
object, whosetext
is the page title,link
is the page route path, andchildren
is automatically generated from the page headers.If you want to set different sidebar for different sub paths, you can set this option to a sidebar object:
",6),Y=s("li",null,[s("p",null,"Example 1:")],-1),V=o(`
- The key should be the path prefix.
- The value should be a sidebar array.
export default { + theme: defaultTheme({ + // sidebar array + // all pages will use the same sidebar + sidebar: [ + // SidebarItem + { + text: 'Foo', + link: '/foo/', + children: [ + // SidebarItem + { + text: 'github', + link: 'https://github.com', + children: [], + }, + // string - page file path + '/foo/bar.md', + ], + }, + // string - page file path + '/bar/README.md', + ], + }), +} +
- Example 2:
export default { + theme: defaultTheme({ + // sidebar object + // pages under different sub paths will use different sidebar + sidebar: { + '/guide/': [ + { + text: 'Guide', + children: ['/guide/README.md', '/guide/getting-started.md'], + }, + ], + '/reference/': [ + { + text: 'Reference', + children: ['/reference/cli.md', '/reference/config.md'], + }, + ], + }, + }), +} +
- Example 3:
export default { + theme: defaultTheme({ + // collapsible sidebar + sidebar: { + '/reference/': [ + { + text: 'VuePress Reference', + collapsible: true, + children: ['/reference/cli.md', '/reference/config.md'], + }, + { + text: 'Bundlers Reference', + collapsible: true, + children: [ + '/reference/bundler/vite.md', + '/reference/bundler/webpack.md', + ], + }, + ], + }, + }), +} +
# sidebarDepth
`,6),H=s("li",null,[s("p",null,[e("Type: "),s("code",null,"number")])],-1),W=s("li",null,[s("p",null,[e("Default: "),s("code",null,"2")])],-1),O=o("Details:
Set the maximum depth of the sidebar children which are automatically generated from the page headers.
",3),Z=s("p",null,[e("The default value of "),s("code",null,"markdown.headers.level"),e(" is "),s("code",null,"[2, 3]"),e(", so the default max value of "),s("code",null,"sidebarDepth"),e(" is "),s("code",null,"2"),e(".")],-1),q=s("h3",{id:"editlink",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#editlink","aria-hidden":"true"},"#"),e(" editLink")],-1),J=s("li",null,[s("p",null,[e("Type: "),s("code",null,"boolean")])],-1),K=s("li",null,[s("p",null,[e("Default: "),s("code",null,"true")])],-1),Q=s("p",null,"Details:",-1),X=s("p",null,[e("Enable the "),s("em",null,"edit this page"),e(" link or not.")],-1),$=o(`
- Set to
0
to disable all levels of headers.- Set to
1
to include<h2>
headers.- Set to
2
to include<h2>
and<h3>
headers.- ...
# editLinkText
Type:
string
Default:
'Edit this page'
Details:
Specify the text of the edit this page link.
# editLinkPattern
Type:
string
Details:
Specify the pattern of the edit this page link.
This will be used for generating the edit this page link.
If you don't set this option, the pattern will be inferred from the docsRepo option. But if your documentation repository is not hosted on a common platform, for example, GitHub, GitLab, Bitbucket, Gitee, etc., you have to set this option explicitly to make the edit this page link work.
Usage:
Pattern Description :repo
The docs repo url, i.e. docsRepo :branch
The docs repo branch, i.e. docsBranch :path
The path of the page source file, i.e. docsDir joins the relative path of the page file Example:
export default { + theme: defaultTheme({ + docsRepo: 'https://gitlab.com/owner/name', + docsBranch: 'master', + docsDir: 'docs', + editLinkPattern: ':repo/-/edit/:branch/:path', + }), +} +
The generated link will look like
'https://gitlab.com/owner/name/-/edit/master/docs/path/to/file.md'
.# docsRepo
Type:
string
Details:
Specify the repository url of your documentation source files.
This will be used for generating the edit this page link.
If you don't set this option, it will use the repo option by default. But if your documentation source files are in a different repository, you will need to set this option.
# docsBranch
Type:
string
Default:
'main'
Details:
Specify the repository branch of your documentation source files.
This will be used for generating the edit this page link.
# docsDir
Type:
string
Default:
''
Details:
Specify the directory of your documentation source files in the repository.
This will be used for generating the edit this page link.
# lastUpdated
`,13),ss=s("li",null,[s("p",null,[e("Type: "),s("code",null,"boolean")])],-1),es=s("li",null,[s("p",null,[e("Default: "),s("code",null,"true")])],-1),ls=s("p",null,"Details:",-1),ns=s("p",null,[e("Enable the "),s("em",null,"last updated timestamp"),e(" or not.")],-1),as=s("code",null,"false",-1),os=o('# lastUpdatedText
Type:
string
Default:
'Last Updated'
Details:
Specify the text of the last updated timestamp label.
# contributors
',3),is=s("li",null,[s("p",null,[e("Type: "),s("code",null,"boolean")])],-1),ps=s("li",null,[s("p",null,[e("Default: "),s("code",null,"true")])],-1),ts=s("p",null,"Details:",-1),cs=s("p",null,[e("Enable the "),s("em",null,"contributors list"),e(" or not.")],-1),rs=s("code",null,"false",-1),ds=o('# contributorsText
Type:
string
Default:
'Contributors'
Details:
Specify the text of the contributors list label.
# tip
',3),Ds=s("li",null,[s("p",null,[e("Type: "),s("code",null,"string")])],-1),us=s("li",null,[s("p",null,[e("Default: "),s("code",null,"'TIP'")])],-1),hs=s("p",null,"Details:",-1),ys=s("h3",{id:"warning",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#warning","aria-hidden":"true"},"#"),e(" warning")],-1),ms=s("li",null,[s("p",null,[e("Type: "),s("code",null,"string")])],-1),bs=s("li",null,[s("p",null,[e("Default: "),s("code",null,"'WARNING'")])],-1),vs=s("p",null,"Details:",-1),fs=s("h3",{id:"danger",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#danger","aria-hidden":"true"},"#"),e(" danger")],-1),gs=s("li",null,[s("p",null,[e("Type: "),s("code",null,"string")])],-1),Cs=s("li",null,[s("p",null,[e("Default: "),s("code",null,"'DANGER'")])],-1),_s=s("p",null,"Details:",-1),Es=o('# notFound
Type:
string[]
Default:
['Not Found']
Details:
Specify the messages of the 404 page.
The message will be randomly picked from the array when users enter the 404 page.
# backToHome
Type:
string
Default:
'Back to home'
Details:
Specify the text of the back to home link in the 404 page.
# openInNewWindow
',5),xs=s("li",null,[s("p",null,[e("Type: "),s("code",null,"string")])],-1),ks=s("li",null,[s("p",null,[e("Default: "),s("code",null,"'open in new window'")])],-1),Ts=s("p",null,"Details:",-1),ws=s("code",null,"sr-only",-1),Fs=s("p",null,"This is mainly for a11y purpose.",-1),As=s("li",null,[s("p",null,"Also see:"),s("ul",null,[s("li",null,[s("a",{href:"#themeplugins-externallinkicon"},"Default Theme > Config Reference > themePlugins.externalLinkIcon")])])],-1),Ss=o('# toggleColorMode
Type:
string
Default:
'toggle color mode'
Details:
Title text for the color mode toggle button.
This is mainly for a11y purpose.
Also see:
# toggleSidebar
Type:
string
Default:
'toggle sidebar'
Details:
Title text for sidebar toggle button.
This is mainly for a11y purpose.
# Plugins Config
# themePlugins
Details:
Configure the plugins that used by default theme.
Default theme is using some plugins by default. You can disable a plugin if you really do not want to use it. Make sure you understand what the plugin is for before disabling it.
# themePlugins.activeHeaderLinks
',8),Is=s("li",null,[s("p",null,[e("Type: "),s("code",null,"boolean")])],-1),Ls=s("li",null,[s("p",null,[e("Default: "),s("code",null,"true")])],-1),Ns=s("p",null,"Details:",-1),Gs=s("h3",{id:"themeplugins-backtotop",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#themeplugins-backtotop","aria-hidden":"true"},"#"),e(" themePlugins.backToTop")],-1),Ps=s("li",null,[s("p",null,[e("Type: "),s("code",null,"boolean")])],-1),Rs=s("li",null,[s("p",null,[e("Default: "),s("code",null,"true")])],-1),js=s("p",null,"Details:",-1),Ms=s("h3",{id:"themeplugins-container",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#themeplugins-container","aria-hidden":"true"},"#"),e(" themePlugins.container")],-1),Bs=s("li",null,[s("p",null,[e("Type: "),s("code",null,"Record")])],-1),zs=s("p",null,"Details:",-1),Us=o("
ContainerType
type is:",2),Ys=s("p",null,"Also see:",-1),Vs=s("h3",{id:"themeplugins-externallinkicon",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#themeplugins-externallinkicon","aria-hidden":"true"},"#"),e(" themePlugins.externalLinkIcon")],-1),Hs=s("li",null,[s("p",null,[e("Type: "),s("code",null,"boolean")])],-1),Ws=s("li",null,[s("p",null,[e("Default: "),s("code",null,"true")])],-1),Os=s("p",null,"Details:",-1),Zs=s("h3",{id:"themeplugins-git",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#themeplugins-git","aria-hidden":"true"},"#"),e(" themePlugins.git")],-1),qs=s("li",null,[s("p",null,[e("Type: "),s("code",null,"boolean")])],-1),Js=s("li",null,[s("p",null,[e("Default: "),s("code",null,"true")])],-1),Ks=s("p",null,"Details:",-1),Qs=s("h3",{id:"themeplugins-mediumzoom",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#themeplugins-mediumzoom","aria-hidden":"true"},"#"),e(" themePlugins.mediumZoom")],-1),Xs=s("li",null,[s("p",null,[e("Type: "),s("code",null,"boolean")])],-1),$s=s("li",null,[s("p",null,[e("Default: "),s("code",null,"true")])],-1),se=s("p",null,"Details:",-1),ee=s("h3",{id:"themeplugins-nprogress",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#themeplugins-nprogress","aria-hidden":"true"},"#"),e(" themePlugins.nprogress")],-1),le=s("li",null,[s("p",null,[e("Type: "),s("code",null,"boolean")])],-1),ne=s("li",null,[s("p",null,[e("Default: "),s("code",null,"true")])],-1),ae=s("p",null,"Details:",-1);function oe(ie,pe){const p=i("NpmBadge"),n=i("RouterLink"),t=i("ExternalLinkIcon");return r(),d("div",null,[u,l(p,{package:"@vuepress/theme-default"}),h,s("ul",null,[y,m,s("li",null,[b,v,f,s("p",null,[e("This option will only take effect in default theme, so don't confuse with "),g,e(" in "),l(n,{to:"/reference/config.html#locales"},{default:a(()=>[e("Site Config")]),_:1}),e(".")])]),s("li",null,[C,s("ul",null,[s("li",null,[l(n,{to:"/guide/i18n.html"},{default:a(()=>[e("Guide > I18n")]),_:1})])])])]),_,s("ul",null,[E,x,s("li",null,[k,T,s("p",null,[e("If set to "),w,e(", the initial color mode will be automatically set according to "),s("a",F,[e("prefers-color-scheme"),l(t)]),e(".")])]),A]),S,s("ul",null,[s("li",null,[e("Also see: "),s("ul",null,[s("li",null,[l(n,{to:"/guide/assets.html#public-files"},{default:a(()=>[e("Guide > Assets > Public Files")]),_:1})])])])]),I,s("ul",null,[L,s("li",null,[N,G,s("p",null,[e("The "),P,e(" will appear next to the repository button in the navbar when you set multiple "),l(n,{to:"/reference/config.html#locales"},{default:a(()=>[e("locales")]),_:1}),e(" in your site config.")])])]),R,s("ul",null,[j,M,s("li",null,[B,z,s("p",null,[e("You can override this global option via "),l(n,{to:"/reference/default-theme/frontmatter.html#sidebar"},{default:a(()=>[e("sidebar")]),_:1}),e(" frontmatter in your pages.")]),U]),Y]),V,s("ul",null,[H,W,s("li",null,[O,s("p",null,[e("The max value depends on which levels of headers you have extracted via "),l(n,{to:"/reference/config.html#markdown-headers"},{default:a(()=>[e("markdown.headers.level")]),_:1}),e(".")]),Z,s("p",null,[e("You can override this global option via "),l(n,{to:"/reference/default-theme/frontmatter.html#sidebardepth"},{default:a(()=>[e("sidebarDepth")]),_:1}),e(" frontmatter in your pages.")])])]),q,s("ul",null,[J,K,s("li",null,[Q,X,s("p",null,[e("You can override this global option via "),l(n,{to:"/reference/default-theme/frontmatter.html#editlink"},{default:a(()=>[e("editLink")]),_:1}),e(" frontmatter in your pages.")])])]),$,s("ul",null,[ss,es,s("li",null,[ls,ns,s("p",null,[e("You can override this global option via "),l(n,{to:"/reference/default-theme/frontmatter.html#lastupdated"},{default:a(()=>[e("lastUpdated")]),_:1}),e(" frontmatter in your pages. Notice that if you have already set this option to "),as,e(", this feature will be disabled totally and could not be enabled in locales nor page frontmatter.")])])]),os,s("ul",null,[is,ps,s("li",null,[ts,cs,s("p",null,[e("You can override this global option via "),l(n,{to:"/reference/default-theme/frontmatter.html#contributors"},{default:a(()=>[e("contributors")]),_:1}),e(" frontmatter in your pages. Notice that if you have already set this option to "),rs,e(", this feature will be disabled totally and could not be enabled in locales nor page frontmatter.")])])]),ds,s("ul",null,[Ds,us,s("li",null,[hs,s("p",null,[e("Specify the default title of the tip "),l(n,{to:"/reference/default-theme/markdown.html#custom-containers"},{default:a(()=>[e("custom containers")]),_:1}),e(".")])])]),ys,s("ul",null,[ms,bs,s("li",null,[vs,s("p",null,[e("Specify the default title of the warning "),l(n,{to:"/reference/default-theme/markdown.html#custom-containers"},{default:a(()=>[e("custom containers")]),_:1}),e(".")])])]),fs,s("ul",null,[gs,Cs,s("li",null,[_s,s("p",null,[e("Specify the default title of the danger "),l(n,{to:"/reference/default-theme/markdown.html#custom-containers"},{default:a(()=>[e("custom containers")]),_:1}),e(".")])])]),Es,s("ul",null,[xs,ks,s("li",null,[Ts,s("p",null,[e("Specify the "),ws,e(" text of the "),l(n,{to:"/reference/plugin/external-link-icon.html#externallinkicon"},{default:a(()=>[e("ExternalLinkIcon")]),_:1}),e(".")]),Fs]),As]),Ss,s("ul",null,[Is,Ls,s("li",null,[Ns,s("p",null,[e("Enable "),l(n,{to:"/reference/plugin/active-header-links.html"},{default:a(()=>[e("@vuepress/plugin-active-header-links")]),_:1}),e(" or not.")])])]),Gs,s("ul",null,[Ps,Rs,s("li",null,[js,s("p",null,[e("Enable "),l(n,{to:"/reference/plugin/back-to-top.html"},{default:a(()=>[e("@vuepress/plugin-back-to-top")]),_:1}),e(" or not.")])])]),Ms,s("ul",null,[Bs,s("li",null,[zs,s("p",null,[e("Enable custom containers that powered by "),l(n,{to:"/reference/plugin/container.html"},{default:a(()=>[e("@vuepress/plugin-container")]),_:1}),e(" or not.")]),Us]),s("li",null,[Ys,s("ul",null,[s("li",null,[l(n,{to:"/reference/default-theme/markdown.html#custom-containers"},{default:a(()=>[e("Default Theme > Markdown > Custom Containers")]),_:1})])])])]),Vs,s("ul",null,[Hs,Ws,s("li",null,[Os,s("p",null,[e("Enable "),l(n,{to:"/reference/plugin/external-link-icon.html"},{default:a(()=>[e("@vuepress/plugin-external-link-icon")]),_:1}),e(" or not.")])])]),Zs,s("ul",null,[qs,Js,s("li",null,[Ks,s("p",null,[e("Enable "),l(n,{to:"/reference/plugin/git.html"},{default:a(()=>[e("@vuepress/plugin-git")]),_:1}),e(" or not.")])])]),Qs,s("ul",null,[Xs,$s,s("li",null,[se,s("p",null,[e("Enable "),l(n,{to:"/reference/plugin/medium-zoom.html"},{default:a(()=>[e("@vuepress/plugin-medium-zoom")]),_:1}),e(" or not.")])])]),ee,s("ul",null,[le,ne,s("li",null,[ae,s("p",null,[e("Enable "),l(n,{to:"/reference/plugin/nprogress.html"},{default:a(()=>[e("@vuepress/plugin-nprogress")]),_:1}),e(" or not.")])])])])}const ce=c(D,[["render",oe],["__file","config.html.vue"]]);export{ce as default}; diff --git a/assets/configuration.html-pW3ShFLZ.js b/assets/configuration.html-pW3ShFLZ.js new file mode 100644 index 000000000..5319d6b06 --- /dev/null +++ b/assets/configuration.html-pW3ShFLZ.js @@ -0,0 +1,29 @@ +import{_ as p,r as c,o as i,c as r,a as n,b as s,d as l,w as a,e as o}from"./app-eU2v8o1B.js";const t={},d=o(`
tip
warning
danger
details
codeGroup
codeGroupItem
# 配置
# 配置文件
如果没有任何配置,你的 VuePress 站点仅有一些最基础的功能。为了更好地自定义你的网站,让我们首先在你的文档目录下创建一个
.vuepress
目录,所有 VuePress 相关的文件都将会被放在这里。你的项目结构可能是这样:├─ docs +│ ├─ .vuepress +│ │ └─ config.js +│ └─ README.md +├─ .gitignore +└─ package.json +
VuePress 站点的基本配置文件是
.vuepress/config.js
,但也同样支持 TypeScript 配置文件。你可以使用.vuepress/config.ts
来得到更好的类型提示。具体而言,我们对于配置文件的路径有着约定(按照优先顺序):
`,7),D=n("code",null,"--config",-1),u=o(`
- 当前工作目录
cwd
下:
vuepress.config.ts
vuepress.config.js
vuepress.config.mjs
- 源文件目录
sourceDir
下:
.vuepress/config.ts
.vuepress/config.js
.vuepress/config.mjs
vuepress dev docs --config my-config.js +
一个基础的配置文件是这样的:
`,3),v={class:"custom-container tip"},y=n("p",{class:"custom-container-title"},"提示",-1),m=o(`import { defineUserConfig } from 'vuepress' + +export default defineUserConfig({ + lang: 'zh-CN', + title: '你好, VuePress !', + description: '这是我的第一个 VuePress 站点', +}) +
# 客户端配置文件
在大多数情况下,配置文件已经足够帮助你配置好你的 VuePress 站点。不过,有些时候用户们可能希望直接添加一些客户端代码。 VuePress 通过客户端配置文件来支持这种需求:
├─ docs +│ ├─ .vuepress +│ │ ├─ client.js <--- 客户端配置文件 +│ │ └─ config.js <--- 配置文件 +│ └─ README.md +├─ .gitignore +└─ package.json +
同样的,我们也有关于客户端配置文件的路径约定(按照优先顺序):
- 当前工作目录
cwd
下:
vuepress.client.ts
vuepress.client.js
vuepress.client.mjs
- 源文件目录
sourceDir
下:
.vuepress/client.ts
.vuepress/client.js
.vuepress/client.mjs
一个基础的客户端配置文件是这样的:
`,7),C={class:"custom-container tip"},b=n("p",{class:"custom-container-title"},"提示",-1),h=n("p",null,"和配置文件不同,客户端配置文件不能通过命令行接口的选项来指定。",-1);function f(g,E){const e=c("RouterLink");return i(),r("div",null,[d,n("p",null,[s("你也可以通过 "),l(e,{to:"/zh/reference/cli.html"},{default:a(()=>[s("命令行接口")]),_:1}),s(" 的 "),D,s(" 选项来指定配置文件:")]),u,n("div",v,[y,n("p",null,[s("前往 "),l(e,{to:"/zh/reference/config.html"},{default:a(()=>[s("配置参考")]),_:1}),s(" 查看所有 VuePress 配置。")])]),m,n("div",C,[b,h,n("p",null,[s("可以前往 "),l(e,{to:"/zh/advanced/cookbook/usage-of-client-config.html"},{default:a(()=>[s("深入 > Cookbook > 客户端配置的使用方法")]),_:1}),s(" 来了解更多信息。")])])])}const k=p(t,[["render",f],["__file","configuration.html.vue"]]);export{k as default}; diff --git a/assets/configuration.html-wcdlW0k5.js b/assets/configuration.html-wcdlW0k5.js new file mode 100644 index 000000000..c5e4aec02 --- /dev/null +++ b/assets/configuration.html-wcdlW0k5.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4f4ccb8f","path":"/guide/configuration.html","title":"Configuration","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Config File","slug":"config-file","link":"#config-file","children":[]},{"level":2,"title":"Client Config File","slug":"client-config-file","link":"#client-config-file","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"guide/configuration.md"}');export{e as data}; diff --git a/assets/configuration.html-xF-jc2r3.js b/assets/configuration.html-xF-jc2r3.js new file mode 100644 index 000000000..976d491c5 --- /dev/null +++ b/assets/configuration.html-xF-jc2r3.js @@ -0,0 +1,29 @@ +import{_ as i,r as c,o as p,c as r,a as e,b as s,d as l,w as a,e as o}from"./app-eU2v8o1B.js";const t={},d=o(`import { defineClientConfig } from '@vuepress/client' + +export default defineClientConfig({ + enhance({ app, router, siteData }) {}, + setup() {}, + rootComponents: [], +}) +
# Configuration
# Config File
Without any configuration, the VuePress site is pretty minimal. To customize your site, let’s first create a
.vuepress
directory inside your docs directory. This is where all VuePress-specific files will be placed. Your project structure is probably like this:├─ docs +│ ├─ .vuepress +│ │ └─ config.js +│ └─ README.md +├─ .gitignore +└─ package.json +
The essential file for configuring a VuePress site is
.vuepress/config.js
, while TypeScript config file is also supported. You can use.vuepress/config.ts
instead to get better types hint for VuePress config.To be more specific, we have a convention for config file paths (in order of precedence):
`,7),D=e("code",null,"--config",-1),u=o(`
- In current working directory
cwd
:
vuepress.config.ts
vuepress.config.js
vuepress.config.mjs
- In source directory
sourceDir
:
.vuepress/config.ts
.vuepress/config.js
.vuepress/config.mjs
vuepress dev docs --config my-config.js +
A basic config file looks like this:
`,3),f={class:"custom-container tip"},v=e("p",{class:"custom-container-title"},"TIP",-1),y=o(`import { defineUserConfig } from 'vuepress' + +export default defineUserConfig({ + lang: 'en-US', + title: 'Hello VuePress', + description: 'Just playing around', +}) +
# Client Config File
In most cases, the config file is sufficient to configure your VuePress site. However, sometimes users may want to add some client-side code directly. To help with this, VuePress also supports a client config file:
├─ docs +│ ├─ .vuepress +│ │ ├─ client.js <--- client config file +│ │ └─ config.js <--- config file +│ └─ README.md +├─ .gitignore +└─ package.json +
Similarly, we also have a convention for client config file paths (in order of precedence):
- In current working directory
cwd
:
vuepress.client.ts
vuepress.client.js
vuepress.client.mjs
- In source directory
sourceDir
:
.vuepress/client.ts
.vuepress/client.js
.vuepress/client.mjs
A basic client config file looks like this:
`,7),m={class:"custom-container tip"},g=e("p",{class:"custom-container-title"},"TIP",-1),C=e("p",null,"Unlike config file, client config file could not be specified via CLI options.",-1);function h(b,E){const n=c("RouterLink");return p(),r("div",null,[d,e("p",null,[s("You can also specify the config file via "),D,s(" option of "),l(n,{to:"/reference/cli.html"},{default:a(()=>[s("CLI")]),_:1}),s(":")]),u,e("div",f,[v,e("p",null,[s("Check out the "),l(n,{to:"/reference/config.html"},{default:a(()=>[s("Config Reference")]),_:1}),s(" for a full list of VuePress config.")])]),y,e("div",m,[g,C,e("p",null,[s("To learn more about client config file, see "),l(n,{to:"/advanced/cookbook/usage-of-client-config.html"},{default:a(()=>[s("Advanced > Cookbook > Usage of Client Config")]),_:1})])])])}const k=i(t,[["render",h],["__file","configuration.html.vue"]]);export{k as default}; diff --git a/assets/configuration.html-xbAxcozF.js b/assets/configuration.html-xbAxcozF.js new file mode 100644 index 000000000..ecb2e1caa --- /dev/null +++ b/assets/configuration.html-xbAxcozF.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-81f65e84","path":"/zh/guide/configuration.html","title":"配置","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"配置文件","slug":"配置文件","link":"#配置文件","children":[]},{"level":2,"title":"客户端配置文件","slug":"客户端配置文件","link":"#客户端配置文件","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/guide/configuration.md"}');export{e as data}; diff --git a/assets/container.html-PtxgkxjI.js b/assets/container.html-PtxgkxjI.js new file mode 100644 index 000000000..b29f13b99 --- /dev/null +++ b/assets/container.html-PtxgkxjI.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3df91977","path":"/reference/plugin/container.html","title":"container","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Container Syntax","slug":"container-syntax","link":"#container-syntax","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"type","slug":"type","link":"#type","children":[]},{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]},{"level":3,"title":"before","slug":"before","link":"#before","children":[]},{"level":3,"title":"after","slug":"after","link":"#after","children":[]},{"level":3,"title":"render","slug":"render","link":"#render","children":[]},{"level":3,"title":"validate","slug":"validate","link":"#validate","children":[]},{"level":3,"title":"marker","slug":"marker","link":"#marker","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/container.md"}');export{e as data}; diff --git a/assets/container.html-TjPytR4y.js b/assets/container.html-TjPytR4y.js new file mode 100644 index 000000000..0da0ac045 --- /dev/null +++ b/assets/container.html-TjPytR4y.js @@ -0,0 +1,39 @@ +import{_ as i,r as e,o as c,c as d,d as a,a as s,b as n,w as r,e as o}from"./app-eU2v8o1B.js";const D={},u=s("h1",{id:"container",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#container","aria-hidden":"true"},"#"),n(" container")],-1),y=s("p",null,"为你的 VuePress 站点注册自定义容器。",-1),h={href:"https://github.com/markdown-it/markdown-it-container",target:"_blank",rel:"noopener noreferrer"},v=o(`import { defineClientConfig } from '@vuepress/client' + +export default defineClientConfig({ + enhance({ app, router, siteData }) {}, + setup() {}, + rootComponents: [], +}) +
# 使用方法
npm i -D @vuepress/plugin-container@next +
import { containerPlugin } from '@vuepress/plugin-container' + +export default { + plugins: [ + containerPlugin({ + // 配置项 + }), + ], +} +
# 容器语法
::: <type> [info] +[content] +::: +
type
是必需的,应通过 type 配置项来指定。info
是可选的,其默认值可以通过 locales 的defaultInfo
配置项来指定。content
可是任何合法的 Markdown 内容。提示
该插件可以被多次使用,以便支持不同类型的容器。
# 配置项
# type
`,9),m=s("li",null,[s("p",null,[n("类型: "),s("code",null,"string")])],-1),b=s("p",null,"详情:",-1),C=s("p",null,"容器的类型。",-1),E={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},f=s("code",null,"name",-1),_=o(`# locales
类型:
Record<string, { defaultInfo: string }>
详情:
容器在不同 locales 下的默认
info
。如果没有指定该配置项,默认
info
会使用大写的 type 。示例:
`,3),g=o(`export default { + plugins: [ + containerPlugin({ + type: 'tip', + locales: { + '/': { + defaultInfo: 'TIP', + }, + '/zh/': { + defaultInfo: '提示', + }, + }, + }), + ], +} +
# before
类型:
(info: string) => string
默认值:
(info: string): string => + \`<div class="custom-container \${type}">\${info ? \`<p class="custom-container-title">\${info}</p>\` : ''}\\n\` +
# after
类型:
(info: string) => string
默认值:
(): string => '</div>\\n' +
# render
- 类型:
`,11),k=s("p",null,"详情:",-1),x={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},A=s("code",null,"render",-1),B=s("p",null,[n("该插件使用了一个默认的 "),s("code",null,"render"),n(" 函数。但如果你指定了该配置项,那么默认的 "),s("code",null,"render"),n(" 函数就会被替换掉,此时 "),s("a",{href:"#locales"},"locales"),n(" 、 "),s("a",{href:"#before"},"before"),n(" 和 "),s("a",{href:"#after"},"after"),n(" 配置项都会被忽略。")],-1),w=s("h3",{id:"validate",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#validate","aria-hidden":"true"},"#"),n(" validate")],-1),F=s("li",null,[s("p",null,[n("类型: "),s("code",null,"(params: string) => boolean")])],-1),I=s("p",null,"详情:",-1),N={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},P=s("code",null,"validate",-1),R=s("h3",{id:"marker",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#marker","aria-hidden":"true"},"#"),n(" marker")],-1),V=s("li",null,[s("p",null,[n("类型: "),s("code",null,"string")])],-1),q=s("p",null,"详情:",-1),L={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},z=s("code",null,"marker",-1);function M(T,$){const t=e("NpmBadge"),l=e("ExternalLinkIcon"),p=e("RouterLink");return c(),d("div",null,[u,a(t,{package:"@vuepress/plugin-container"}),y,s("p",null,[n("该插件简化了 "),s("a",h,[n("markdown-it-container"),a(l)]),n(" 的使用方法,但同时也保留了其原本的能力。")]),s("p",null,[n("默认主题的 "),a(p,{to:"/zh/reference/default-theme/markdown.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AE%B9%E5%99%A8"},{default:r(()=>[n("自定义容器")]),_:1}),n(" 就是由该插件支持的。")]),v,s("ul",null,[m,s("li",null,[b,C,s("p",null,[n("它将会被用作 "),s("a",E,[n("markdown-it-container"),a(l)]),n(" 的 "),f,n(" 参数。")])])]),_,s("ul",null,[s("li",null,[n("参考: "),s("ul",null,[s("li",null,[a(p,{to:"/zh/guide/i18n.html"},{default:r(()=>[n("指南 > 多语言支持")]),_:1})])])])]),g,s("ul",null,[s("li",null,[k,s("p",null,[s("a",x,[n("markdown-it-container"),a(l)]),n(" 的 "),A,n(" 配置项。")]),B])]),w,s("ul",null,[F,s("li",null,[I,s("p",null,[s("a",N,[n("markdown-it-container"),a(l)]),n(" 的 "),P,n(" 配置项。")])])]),R,s("ul",null,[V,s("li",null,[q,s("p",null,[s("a",L,[n("markdown-it-container"),a(l)]),n(" 的 "),z,n(" 配置项。")])])])])}const j=i(D,[["render",M],["__file","container.html.vue"]]);export{j as default}; diff --git a/assets/container.html-kqFoOXKr.js b/assets/container.html-kqFoOXKr.js new file mode 100644 index 000000000..abd480f05 --- /dev/null +++ b/assets/container.html-kqFoOXKr.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-b10e9d30","path":"/zh/reference/plugin/container.html","title":"container","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"容器语法","slug":"容器语法","link":"#容器语法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"type","slug":"type","link":"#type","children":[]},{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]},{"level":3,"title":"before","slug":"before","link":"#before","children":[]},{"level":3,"title":"after","slug":"after","link":"#after","children":[]},{"level":3,"title":"render","slug":"render","link":"#render","children":[]},{"level":3,"title":"validate","slug":"validate","link":"#validate","children":[]},{"level":3,"title":"marker","slug":"marker","link":"#marker","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/container.md"}');export{e as data}; diff --git a/assets/container.html-wrzIDX-O.js b/assets/container.html-wrzIDX-O.js new file mode 100644 index 000000000..e4714dd70 --- /dev/null +++ b/assets/container.html-wrzIDX-O.js @@ -0,0 +1,39 @@ +import{_ as r,r as l,o as c,c as d,d as a,a as s,b as n,w as p,e as o}from"./app-eU2v8o1B.js";const D={},u=s("h1",{id:"container",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#container","aria-hidden":"true"},"#"),n(" container")],-1),y=s("p",null,"Register markdown custom containers in your VuePress site.",-1),h={href:"https://github.com/markdown-it/markdown-it-container",target:"_blank",rel:"noopener noreferrer"},f=o(`type MarkdownItContainerRenderFunction = ( + tokens: Token[], + index: number, + options: any, + env: MarkdownEnv, + self: Renderer, +) => string +
# Usage
npm i -D @vuepress/plugin-container@next +
import { containerPlugin } from '@vuepress/plugin-container' + +export default { + plugins: [ + containerPlugin({ + // options + }), + ], +} +
# Container Syntax
::: <type> [info] +[content] +::: +
- The
type
is required and should be specified via type option.- The
info
is optional, and the default value can be specified viadefaultInfo
in locales option.- The
content
can be any valid markdown content.TIP
This plugin can be used multiple times to support different types of containers.
# Options
# type
`,9),m=s("li",null,[s("p",null,[n("Type: "),s("code",null,"string")])],-1),v=s("p",null,"Details:",-1),b=s("p",null,"The type of the container.",-1),C=s("code",null,"name",-1),g={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},_=o(`# locales
Type:
Record<string, { defaultInfo: string }>
Details:
The default
info
of the container in different locales.If this option is not specified, the default
info
will fallback to the uppercase of the type option.Example:
`,3),E=o(`export default { + plugins: [ + containerPlugin({ + type: 'tip', + locales: { + '/': { + defaultInfo: 'TIP', + }, + '/zh/': { + defaultInfo: '提示', + }, + }, + }), + ], +} +
# before
Type:
(info: string) => string
Default:
(info: string): string => + \`<div class="custom-container \${type}">\${info ? \`<p class="custom-container-title">\${info}</p>\` : ''}\\n\` +
Details:
A function to render the starting tag of the container.
The first param is the
info
part of container syntax.This option will not take effect if you don't specify the after option.
# after
Type:
(info: string) => string
Default:
(): string => '</div>\\n' +
Details:
A function to render the ending tag of the container.
The first param is the
info
part of container syntax.This option will not take effect if you don't specify the before option.
# render
- Type:
`,11),k=s("p",null,"Details:",-1),x=s("code",null,"render",-1),w={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},T=s("p",null,[n("This plugin uses a default "),s("code",null,"render"),n(" function. If you specify this option, the default "),s("code",null,"render"),n(" function will be replaced, and the "),s("a",{href:"#locales"},"locales"),n(", "),s("a",{href:"#before"},"before"),n(" and "),s("a",{href:"#after"},"after"),n(" options will be ignored.")],-1),F=s("h3",{id:"validate",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#validate","aria-hidden":"true"},"#"),n(" validate")],-1),B=s("li",null,[s("p",null,[n("Type: "),s("code",null,"(params: string) => boolean")])],-1),I=s("p",null,"Details:",-1),A=s("code",null,"validate",-1),N={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"},P=s("h3",{id:"marker",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#marker","aria-hidden":"true"},"#"),n(" marker")],-1),R=s("li",null,[s("p",null,[n("Type: "),s("code",null,"string")])],-1),q=s("p",null,"Details:",-1),V=s("code",null,"marker",-1),L={href:"https://github.com/markdown-it/markdown-it-container#api",target:"_blank",rel:"noopener noreferrer"};function $(M,S){const i=l("NpmBadge"),e=l("ExternalLinkIcon"),t=l("RouterLink");return c(),d("div",null,[u,a(i,{package:"@vuepress/plugin-container"}),y,s("p",null,[n("This plugin simplifies the use of "),s("a",h,[n("markdown-it-container"),a(e)]),n(", but also retains its original capabilities.")]),s("p",null,[n("The "),a(t,{to:"/reference/default-theme/markdown.html#custom-containers"},{default:p(()=>[n("Custom Containers")]),_:1}),n(" of default theme is powered by this plugin.")]),f,s("ul",null,[m,s("li",null,[v,b,s("p",null,[n("It will be used as the "),C,n(" param of "),s("a",g,[n("markdown-it-container"),a(e)]),n(".")])])]),_,s("ul",null,[s("li",null,[n("Also see: "),s("ul",null,[s("li",null,[a(t,{to:"/guide/i18n.html"},{default:p(()=>[n("Guide > I18n")]),_:1})])])])]),E,s("ul",null,[s("li",null,[k,s("p",null,[n("The "),x,n(" option of "),s("a",w,[n("markdown-it-container"),a(e)]),n(".")]),T])]),F,s("ul",null,[B,s("li",null,[I,s("p",null,[n("The "),A,n(" option of "),s("a",N,[n("markdown-it-container"),a(e)]),n(".")])])]),P,s("ul",null,[R,s("li",null,[q,s("p",null,[n("The "),V,n(" option of "),s("a",L,[n("markdown-it-container"),a(e)]),n(".")])])])])}const G=r(D,[["render",$],["__file","container.html.vue"]]);export{G as default}; diff --git a/assets/deployment.html-LSGkd9Y2.js b/assets/deployment.html-LSGkd9Y2.js new file mode 100644 index 000000000..a64d24f9d --- /dev/null +++ b/assets/deployment.html-LSGkd9Y2.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-e8a66a70","path":"/guide/deployment.html","title":"Deployment","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"GitHub Pages","slug":"github-pages","link":"#github-pages","children":[]},{"level":2,"title":"GitLab Pages","slug":"gitlab-pages","link":"#gitlab-pages","children":[]},{"level":2,"title":"Google Firebase","slug":"google-firebase","link":"#google-firebase","children":[]},{"level":2,"title":"Heroku","slug":"heroku","link":"#heroku","children":[]},{"level":2,"title":"Kinsta","slug":"kinsta","link":"#kinsta","children":[]},{"level":2,"title":"Edgio","slug":"edgio","link":"#edgio","children":[]},{"level":2,"title":"Netlify","slug":"netlify","link":"#netlify","children":[]},{"level":2,"title":"Vercel","slug":"vercel","link":"#vercel","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"guide/deployment.md"}');export{e as data}; diff --git a/assets/deployment.html-U91hxMp2.js b/assets/deployment.html-U91hxMp2.js new file mode 100644 index 000000000..0be7b87e8 --- /dev/null +++ b/assets/deployment.html-U91hxMp2.js @@ -0,0 +1,101 @@ +import{_ as i,r as p,o as c,c as r,a as s,b as n,d as e,w as t,e as a}from"./app-eU2v8o1B.js";const d={},D=s("h1",{id:"deployment",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#deployment","aria-hidden":"true"},"#"),n(" Deployment")],-1),u=s("p",null,"The following guides are based on some shared assumptions:",-1),y=s("li",null,[n("You are placing your Markdown source files inside the "),s("code",null,"docs"),n(" directory of your project;")],-1),v=s("li",null,[n("You are using the default build output location ("),s("code",null,".vuepress/dist"),n(");")],-1),h={href:"https://pnpm.io",target:"_blank",rel:"noopener noreferrer"},m=s("li",null,[n("VuePress is installed as a local dependency in your project, and you have setup the following script in "),s("code",null,"package.json"),n(":")],-1),b=a(`type MarkdownItContainerRenderFunction = ( + tokens: Token[], + index: number, + options: any, + env: MarkdownEnv, + self: Renderer, +) => string +
{ + "scripts": { + "docs:build": "vuepress build docs" + } +} +
# GitHub Pages
`,2),g=a("If you are deploying to
https://<USERNAME>.github.io/
, you can omit this step asbase
defaults to"/"
.If you are deploying to
",2),_={href:"https://github.com/features/actions",target:"_blank",rel:"noopener noreferrer"},f=s("p",null,[n("Create "),s("code",null,".github/workflows/docs.yml"),n(" to set up the workflow.")],-1),C=a(`https://<USERNAME>.github.io/<REPO>/
, for example your repository is athttps://github.com/<USERNAME>/<REPO>
, then setbase
to"/<REPO>/"
.`,1),E={class:"custom-container tip"},k=s("p",{class:"custom-container-title"},"TIP",-1),w={href:"https://pages.github.com/",target:"_blank",rel:"noopener noreferrer"},x=s("h2",{id:"gitlab-pages",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#gitlab-pages","aria-hidden":"true"},"#"),n(" GitLab Pages")],-1),A=a("Click to expand sample config
name: docs + +on: + # trigger deployment on every push to main branch + push: + branches: [main] + # trigger deployment manually + workflow_dispatch: + +jobs: + docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + # fetch all commits to get last updated time or other git log info + fetch-depth: 0 + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + # choose pnpm version to use + version: 8 + # install deps with pnpm + run_install: true + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + # choose node.js version to use + node-version: 18 + # cache deps for pnpm + cache: pnpm + + # run build script + - name: Build VuePress site + run: pnpm docs:build + + # please check out the docs of the workflow for more details + # @see https://github.com/crazy-max/ghaction-github-pages + - name: Deploy to GitHub Pages + uses: crazy-max/ghaction-github-pages@v4 + with: + # deploy to gh-pages branch + target_branch: gh-pages + # deploy the default output dir of VuePress + build_dir: docs/.vuepress/dist + env: + # @see https://docs.github.com/en/actions/reference/authentication-in-a-workflow#about-the-github_token-secret + GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} +
If you are deploying to
https://<USERNAME>.gitlab.io/
, you can omitbase
as it defaults to"/"
.If you are deploying to
",2),q=s("code",null,".gitlab-ci.yml",-1),j={href:"https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/",target:"_blank",rel:"noopener noreferrer"},P=a(`https://<USERNAME>.gitlab.io/<REPO>/
, for example your repository is athttps://gitlab.com/<USERNAME>/<REPO>
, then setbase
to"/<REPO>/"
.`,1),R={class:"custom-container tip"},I=s("p",{class:"custom-container-title"},"TIP",-1),S={href:"https://docs.gitlab.com/ce/user/project/pages/#getting-started",target:"_blank",rel:"noopener noreferrer"},N=s("h2",{id:"google-firebase",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#google-firebase","aria-hidden":"true"},"#"),n(" Google Firebase")],-1),O={href:"https://www.npmjs.com/package/firebase-tools",target:"_blank",rel:"noopener noreferrer"},H=s("li",null,[s("p",null,[n("Create "),s("code",null,"firebase.json"),n(" and "),s("code",null,".firebaserc"),n(" at the root of your project with the following content:")])],-1),G=a(`Click to expand sample config
# choose a docker image to use +image: node:18-buster + +pages: + # trigger deployment on every push to main branch + only: + - main + + # cache node_modules + cache: + key: + files: + - pnpm-lock.yaml + paths: + - .pnpm-store + + # Install pnpm + before_script: + - curl -fsSL https://get.pnpm.io/install.sh | sh - + - pnpm config set store-dir .pnpm-store + + # install dependencies and run build script + script: + - pnpm i --frozen-lockfile + - pnpm docs:build --dest public + + artifacts: + paths: + - public +
firebase.json
:{ + "hosting": { + "public": "./docs/.vuepress/dist", + "ignore": [] + } +} +
.firebaserc
:{ + "projects": { + "default": "<YOUR_FIREBASE_ID>" + } +} +
`,5),T={class:"custom-container tip"},F=s("p",{class:"custom-container-title"},"TIP",-1),U={href:"https://firebase.google.com/docs/cli",target:"_blank",rel:"noopener noreferrer"},B=s("h2",{id:"heroku",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#heroku","aria-hidden":"true"},"#"),n(" Heroku")],-1),V={href:"https://devcenter.heroku.com/articles/heroku-cli",target:"_blank",rel:"noopener noreferrer"},L={href:"https://signup.heroku.com",target:"_blank",rel:"noopener noreferrer"},M=s("li",null,[s("p",null,[n("Run "),s("code",null,"heroku login"),n(" and fill in your Heroku credentials:")])],-1),K=a(`
- After running
pnpm docs:build
, deploy using the commandfirebase deploy
.heroku login +
- Create a file called
static.json
in the root of your project with the below content:
static.json
:`,4),Y={href:"https://github.com/heroku/heroku-buildpack-static",target:"_blank",rel:"noopener noreferrer"},z=s("h2",{id:"kinsta",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#kinsta","aria-hidden":"true"},"#"),n(" Kinsta")],-1),W={href:"https://kinsta.com/docs/vuepress-application/",target:"_blank",rel:"noopener noreferrer"},$=s("h2",{id:"edgio",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#edgio","aria-hidden":"true"},"#"),n(" Edgio")],-1),J={href:"https://docs.edg.io/guides/vuepress",target:"_blank",rel:"noopener noreferrer"},Q=s("h2",{id:"netlify",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#netlify","aria-hidden":"true"},"#"),n(" Netlify")],-1),X={href:"https://netlify.com",target:"_blank",rel:"noopener noreferrer"},Z=s("ul",null,[s("li",null,[s("strong",null,"Build Command:"),n(),s("code",null,"pnpm docs:build")]),s("li",null,[s("strong",null,"Publish directory:"),n(),s("code",null,"docs/.vuepress/dist")])],-1),ss={href:"https://docs.netlify.com/configure-builds/environment-variables",target:"_blank",rel:"noopener noreferrer"},ns=s("ul",null,[s("li",null,[s("code",null,"NODE_VERSION"),n(": 18")])],-1),es=s("li",null,[s("p",null,"Hit the deploy button.")],-1),ls=s("h2",{id:"vercel",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#vercel","aria-hidden":"true"},"#"),n(" Vercel")],-1),as={href:"https://vercel.com",target:"_blank",rel:"noopener noreferrer"},os=s("ul",null,[s("li",null,[s("strong",null,"FRAMEWORK PRESET:"),n(),s("code",null,"Other")]),s("li",null,[s("strong",null,"BUILD COMMAND:"),n(),s("code",null,"pnpm docs:build")]),s("li",null,[s("strong",null,"OUTPUT DIRECTORY:"),n(),s("code",null,"docs/.vuepress/dist")])],-1),ps=s("li",null,[s("p",null,"Hit the deploy button.")],-1);function ts(is,cs){const l=p("ExternalLinkIcon"),o=p("RouterLink");return c(),r("div",null,[D,u,s("ul",null,[y,v,s("li",null,[n("You are using "),s("a",h,[n("pnpm"),e(l)]),n(" as package manager, while npm and yarn are also supported;")]),m]),b,s("ol",null,[s("li",null,[s("p",null,[n("Set the correct "),e(o,{to:"/reference/config.html#base"},{default:t(()=>[n("base")]),_:1}),n(" config.")]),g]),s("li",null,[s("p",null,[n("Choose your preferred CI tools. Here we take "),s("a",_,[n("GitHub Actions"),e(l)]),n(" as an example.")]),f])]),C,s("div",E,[k,s("p",null,[n("Please refer to "),s("a",w,[n("GitHub Pages official guide"),e(l)]),n(" for more details.")])]),x,s("ol",null,[s("li",null,[s("p",null,[n("Set the correct "),e(o,{to:"/reference/config.html#base"},{default:t(()=>[n("base")]),_:1}),n(" config.")]),A]),s("li",null,[s("p",null,[n("Create "),q,n(" to set up "),s("a",j,[n("GitLab CI"),e(l)]),n(" workflow.")])])]),P,s("div",R,[I,s("p",null,[n("Please refer to "),s("a",S,[n("GitLab Pages official guide"),e(l)]),n(" for more details.")])]),N,s("ol",null,[s("li",null,[s("p",null,[n("Make sure you have "),s("a",O,[n("firebase-tools"),e(l)]),n(" installed.")])]),H]),G,s("div",T,[F,s("p",null,[n("Please refer to "),s("a",U,[n("Firebase CLI official guide"),e(l)]),n(" for more details.")])]),B,s("ol",null,[s("li",null,[s("p",null,[n("Install "),s("a",V,[n("Heroku CLI"),e(l)]),n(".")])]),s("li",null,[s("p",null,[n("Create a Heroku account by "),s("a",L,[n("signing up"),e(l)]),n(".")])]),M]),K,s("p",null,[n("This is the configuration of your site; read more at "),s("a",Y,[n("heroku-buildpack-static"),e(l)]),n(".")]),z,s("p",null,[n("See "),s("a",W,[n("Set Up VuePress on Kinsta"),e(l)]),n(".")]),$,s("p",null,[n("See "),s("a",J,[n("Edgio Documentation > Framework Guides > VuePress"),e(l)]),n(".")]),Q,s("ol",null,[s("li",null,[s("p",null,[n("On "),s("a",X,[n("Netlify"),e(l)]),n(", set up a new project from GitHub with the following settings:")]),Z]),s("li",null,[s("p",null,[n("Set "),s("a",ss,[n("Environment variables"),e(l)]),n(" to choose node version:")]),ns]),es]),ls,s("ol",null,[s("li",null,[s("p",null,[n("Go to "),s("a",as,[n("Vercel"),e(l)]),n(", set up a new project from GitHub with the following settings:")]),os]),ps])])}const ds=i(d,[["render",ts],["__file","deployment.html.vue"]]);export{ds as default}; diff --git a/assets/deployment.html-XbzhTyhT.js b/assets/deployment.html-XbzhTyhT.js new file mode 100644 index 000000000..5a7a89151 --- /dev/null +++ b/assets/deployment.html-XbzhTyhT.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4a7b6bf9","path":"/zh/guide/deployment.html","title":"部署","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"GitHub Pages","slug":"github-pages","link":"#github-pages","children":[]},{"level":2,"title":"GitLab Pages","slug":"gitlab-pages","link":"#gitlab-pages","children":[]},{"level":2,"title":"Google Firebase","slug":"google-firebase","link":"#google-firebase","children":[]},{"level":2,"title":"Heroku","slug":"heroku","link":"#heroku","children":[]},{"level":2,"title":"Kinsta","slug":"kinsta","link":"#kinsta","children":[]},{"level":2,"title":"Edgio","slug":"edgio","link":"#edgio","children":[]},{"level":2,"title":"Netlify","slug":"netlify","link":"#netlify","children":[]},{"level":2,"title":"Vercel","slug":"vercel","link":"#vercel","children":[]},{"level":2,"title":"云开发 CloudBase","slug":"云开发-cloudbase","link":"#云开发-cloudbase","children":[]},{"level":2,"title":"21 云盒子","slug":"_21-云盒子","link":"#_21-云盒子","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/guide/deployment.md"}');export{e as data}; diff --git a/assets/deployment.html-rDu3xTc7.js b/assets/deployment.html-rDu3xTc7.js new file mode 100644 index 000000000..004398719 --- /dev/null +++ b/assets/deployment.html-rDu3xTc7.js @@ -0,0 +1,104 @@ +import{_ as c,r as p,o as t,c as r,a as s,b as n,d as l,w as i,e as a}from"./app-eU2v8o1B.js";const d={},D=s("h1",{id:"部署",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#部署","aria-hidden":"true"},"#"),n(" 部署")],-1),u=s("p",null,"下述的指南基于以下条件:",-1),y=s("li",null,[n("Markdown 源文件放置在你项目的 "),s("code",null,"docs"),n(" 目录;")],-1),v=s("li",null,[n("使用的是默认的构建输出目录 ("),s("code",null,".vuepress/dist"),n(") ;")],-1),b={href:"https://pnpm.io/zh/",target:"_blank",rel:"noopener noreferrer"},h=s("li",null,[n("VuePress 作为项目依赖安装,并在 "),s("code",null,"package.json"),n(" 中配置了如下脚本:")],-1),m=a(`{ + "root": "./docs/.vuepress/dist" +} +
{ + "scripts": { + "docs:build": "vuepress build docs" + } +} +
# GitHub Pages
`,2),_=a("如果你准备发布到
https://<USERNAME>.github.io/
,你可以省略这一步,因为base
默认就是"/"
。如果你准备发布到
",2),g={href:"https://github.com/features/actions",target:"_blank",rel:"noopener noreferrer"},C=s("p",null,[n("创建 "),s("code",null,".github/workflows/docs.yml"),n(" 文件来配置工作流。")],-1),E=a(`https://<USERNAME>.github.io/<REPO>/
,也就是说你的仓库地址是https://github.com/<USERNAME>/<REPO>
,则将base
设置为"/<REPO>/"
。`,1),f={class:"custom-container tip"},k=s("p",{class:"custom-container-title"},"提示",-1),A={href:"https://pages.github.com/",target:"_blank",rel:"noopener noreferrer"},x=s("h2",{id:"gitlab-pages",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#gitlab-pages","aria-hidden":"true"},"#"),n(" GitLab Pages")],-1),q=a("点击展开配置样例
name: docs + +on: + # 每当 push 到 main 分支时触发部署 + push: + branches: [main] + # 手动触发部署 + workflow_dispatch: + +jobs: + docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 + fetch-depth: 0 + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + # 选择要使用的 pnpm 版本 + version: 8 + # 使用 pnpm 安装依赖 + run_install: true + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + # 选择要使用的 node 版本 + node-version: 18 + # 缓存 pnpm 依赖 + cache: pnpm + + # 运行构建脚本 + - name: Build VuePress site + run: pnpm docs:build + + # 查看 workflow 的文档来获取更多信息 + # @see https://github.com/crazy-max/ghaction-github-pages + - name: Deploy to GitHub Pages + uses: crazy-max/ghaction-github-pages@v4 + with: + # 部署到 gh-pages 分支 + target_branch: gh-pages + # 部署目录为 VuePress 的默认输出目录 + build_dir: docs/.vuepress/dist + env: + # @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret + GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} +
如果你准备发布到
https://<USERNAME>.gitlab.io/
,你可以省略这一步,因此base
默认就是"/"
。如果你准备发布到
",2),w=s("code",null,".gitlab-ci.yml",-1),B={href:"https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/",target:"_blank",rel:"noopener noreferrer"},P=a(`https://<USERNAME>.gitlab.io/<REPO>/
,也就是说你的仓库地址是https://gitlab.com/<USERNAME>/<REPO>
,则将base
设置为"/<REPO>/"
。`,1),R={class:"custom-container tip"},N=s("p",{class:"custom-container-title"},"提示",-1),j={href:"https://docs.gitlab.com/ce/user/project/pages/#getting-started",target:"_blank",rel:"noopener noreferrer"},S=s("h2",{id:"google-firebase",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#google-firebase","aria-hidden":"true"},"#"),n(" Google Firebase")],-1),O={href:"https://www.npmjs.com/package/firebase-tools",target:"_blank",rel:"noopener noreferrer"},V=s("li",null,[s("p",null,[n("在你项目的根目录下创建 "),s("code",null,"firebase.json"),n(" 和 "),s("code",null,".firebaserc"),n(",并包含以下内容:")])],-1),F=a(`点击展开配置样例
# 选择你要使用的 docker 镜像 +image: node:18-buster + +pages: + # 每当 push 到 main 分支时触发部署 + only: + - main + + # 缓存 node_modules + cache: + key: + files: + - pnpm-lock.yaml + paths: + - .pnpm-store + + # 安装 pnpm + before_script: + - curl -fsSL https://get.pnpm.io/install.sh | sh - + - pnpm config set store-dir .pnpm-store + + # 安装依赖并运行构建脚本 + script: + - pnpm install --frozen-lockfile + - pnpm docs:build --dest public + + artifacts: + paths: + - public +
firebase.json
:{ + "hosting": { + "public": "./docs/.vuepress/dist", + "ignore": [] + } +} +
.firebaserc
:{ + "projects": { + "default": "<YOUR_FIREBASE_ID>" + } +} +
`,5),G={class:"custom-container tip"},I=s("p",{class:"custom-container-title"},"提示",-1),H={href:"https://firebase.google.com/docs/cli",target:"_blank",rel:"noopener noreferrer"},L=s("h2",{id:"heroku",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#heroku","aria-hidden":"true"},"#"),n(" Heroku")],-1),U={href:"https://devcenter.heroku.com/articles/heroku-cli",target:"_blank",rel:"noopener noreferrer"},M={href:"https://signup.heroku.com",target:"_blank",rel:"noopener noreferrer"},T=s("li",null,[s("p",null,[n("运行 "),s("code",null,"heroku login"),n(" 并填写你的 Heroku 认证信息:")])],-1),z=a(`
- 在执行了
pnpm docs:build
后, 使用firebase deploy
指令来部署。heroku login +
- 在你的项目根目录中,创建一个名为
static.json
的文件,并包含下述内容:
static.json
:`,4),K={href:"https://github.com/heroku/heroku-buildpack-static",target:"_blank",rel:"noopener noreferrer"},Y=s("h2",{id:"kinsta",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#kinsta","aria-hidden":"true"},"#"),n(" Kinsta")],-1),W={href:"https://kinsta.com/docs/vuepress-application/",target:"_blank",rel:"noopener noreferrer"},$=s("h2",{id:"edgio",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#edgio","aria-hidden":"true"},"#"),n(" Edgio")],-1),J={href:"https://docs.edg.io/guides/vuepress",target:"_blank",rel:"noopener noreferrer"},Q=s("h2",{id:"netlify",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#netlify","aria-hidden":"true"},"#"),n(" Netlify")],-1),X={href:"https://netlify.com",target:"_blank",rel:"noopener noreferrer"},Z=s("ul",null,[s("li",null,[s("strong",null,"Build Command:"),n(),s("code",null,"pnpm docs:build")]),s("li",null,[s("strong",null,"Publish directory:"),n(),s("code",null,"docs/.vuepress/dist")])],-1),ss={href:"https://docs.netlify.com/configure-builds/environment-variables",target:"_blank",rel:"noopener noreferrer"},ns=s("ul",null,[s("li",null,[s("code",null,"NODE_VERSION"),n(": 18")])],-1),ls=s("li",null,[s("p",null,"点击 deploy 按钮。")],-1),es=s("h2",{id:"vercel",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#vercel","aria-hidden":"true"},"#"),n(" Vercel")],-1),as={href:"https://vercel.com",target:"_blank",rel:"noopener noreferrer"},os=s("ul",null,[s("li",null,[s("strong",null,"FRAMEWORK PRESET:"),n(),s("code",null,"Other")]),s("li",null,[s("strong",null,"BUILD COMMAND:"),n(),s("code",null,"pnpm docs:build")]),s("li",null,[s("strong",null,"OUTPUT DIRECTORY:"),n(),s("code",null,"docs/.vuepress/dist")])],-1),ps=s("li",null,[s("p",null,"点击 deploy 按钮。")],-1),is=s("h2",{id:"云开发-cloudbase",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#云开发-cloudbase","aria-hidden":"true"},"#"),n(" 云开发 CloudBase")],-1),cs={href:"https://cloudbase.net/?site=vuepress",target:"_blank",rel:"noopener noreferrer"},ts={href:"https://cloudbase.net/framework.html?site=vuepress",target:"_blank",rel:"noopener noreferrer"},rs=a(`{ + "root": "./docs/.vuepress/dist" +} +
- 全局安装 CloudBase CLI :
`,2),ds={start:"2"},Ds={href:"https://console.cloud.tencent.com/tcb/env/index?tdl_anchor=ad&tdl_site=vuejs",target:"_blank",rel:"noopener noreferrer"},us=a(`pnpm install -g @cloudbase/cli +
cloudbase init --without-template +cloudbase framework:deploy +
CloudBase CLI 首先会跳转到控制台进行登录授权,然后将会交互式进行确认。
确认信息后会立即进行部署,部署完成后,可以获得一个自动 SSL,CDN 加速的网站应用,你也可以搭配使用 GitHub Action 来持续部署 GitHub 上的 VuePress 应用。
也可以使用
`,4),ys={class:"custom-container tip"},vs=s("p",{class:"custom-container-title"},"提示",-1),bs={href:"https://github.com/TencentCloudBase/cloudbase-framework?site=vuepress#%E9%A1%B9%E7%9B%AE%E7%A4%BA%E4%BE%8B",target:"_blank",rel:"noopener noreferrer"},hs=s("h2",{id:"_21-云盒子",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#_21-云盒子","aria-hidden":"true"},"#"),n(" 21 云盒子")],-1),ms={href:"https://www.21yunbox.com/docs/#/deploy-vuepress",target:"_blank",rel:"noopener noreferrer"};function _s(gs,Cs){const e=p("ExternalLinkIcon"),o=p("RouterLink");return t(),r("div",null,[D,u,s("ul",null,[y,v,s("li",null,[n("使用 "),s("a",b,[n("pnpm"),l(e)]),n(" 作为包管理器,当然也支持使用 npm 或 yarn 。")]),h]),m,s("ol",null,[s("li",null,[s("p",null,[n("设置正确的 "),l(o,{to:"/zh/reference/config.html#base"},{default:i(()=>[n("base")]),_:1}),n(" 选项。")]),_]),s("li",null,[s("p",null,[n("选择你想要使用的 CI 工具。这里我们以 "),s("a",g,[n("GitHub Actions"),l(e)]),n(" 为例。")]),C])]),E,s("div",f,[k,s("p",null,[n("请参考 "),s("a",A,[n("GitHub Pages 官方指南"),l(e)]),n(" 来获取更多信息。")])]),x,s("ol",null,[s("li",null,[s("p",null,[n("设置正确的 "),l(o,{to:"/zh/reference/config.html#base"},{default:i(()=>[n("base")]),_:1}),n(" 选项。")]),q]),s("li",null,[s("p",null,[n("创建 "),w,n(" 文件来配置 "),s("a",B,[n("GitLab CI"),l(e)]),n(" 工作流。")])])]),P,s("div",R,[N,s("p",null,[n("请参考 "),s("a",j,[n("GitLab Pages 官方指南"),l(e)]),n(" 来获取更多信息。")])]),S,s("ol",null,[s("li",null,[s("p",null,[n("请确保你已经安装了 "),s("a",O,[n("firebase-tools"),l(e)]),n("。")])]),V]),F,s("div",G,[I,s("p",null,[n("请参考 "),s("a",H,[n("Firebase CLI 官方指南"),l(e)]),n(" 来获取更多信息。")])]),L,s("ol",null,[s("li",null,[s("p",null,[n("首先安装 "),s("a",U,[n("Heroku CLI"),l(e)]),n(";")])]),s("li",null,[s("p",null,[s("a",M,[n("在这里"),l(e)]),n(" 注册一个 Heroku 账号;")])]),T]),z,s("p",null,[n("这里是你项目的配置,请参考 "),s("a",K,[n("heroku-buildpack-static"),l(e)]),n(" 来获取更多信息。")]),Y,s("p",null,[n("请查看 "),s("a",W,[n("Set Up VuePress on Kinsta"),l(e)]),n(" 。")]),$,s("p",null,[n("请查看 "),s("a",J,[n("Edgio Documentation > Framework Guides > VuePress"),l(e)]),n(" 。")]),Q,s("ol",null,[s("li",null,[s("p",null,[n("前往 "),s("a",X,[n("Netlify"),l(e)]),n(" ,从 GitHub 创建一个新项目,并进行如下配置:")]),Z]),s("li",null,[s("p",null,[n("设置 "),s("a",ss,[n("Environment variables"),l(e)]),n(" 来选择 Node 版本:")]),ns]),ls]),es,s("ol",null,[s("li",null,[s("p",null,[n("前往 "),s("a",as,[n("Vercel"),l(e)]),n(" ,从 GitHub 创建一个新项目,并进行如下配置:")]),os]),ps]),is,s("p",null,[s("a",cs,[n("云开发 CloudBase"),l(e)]),n(" 是一个云原生一体化的 Serverless 云平台,支持静态网站、容器等多种托管能力,并提供简便的部署工具 "),s("a",ts,[n("CloudBase Framework"),l(e)]),n(" 来一键部署应用。")]),rs,s("ol",ds,[s("li",null,[n("在项目根目录运行以下命令一键部署 VuePress 应用,在部署之前可以先 "),s("a",Ds,[n("开通环境"),l(e)]),n(":")])]),us,s("div",ys,[vs,s("p",null,[n("更多详细信息请查看 CloudBase Framework 的"),s("a",bs,[n("部署项目示例"),l(e)])])]),hs,s("p",null,[n("请查看 "),s("a",ms,[n("21 云盒子 - 部署一个 VuePress 静态网页"),l(e)]),n("。")])])}const fs=c(d,[["render",_s],["__file","deployment.html.vue"]]);export{fs as default}; diff --git a/assets/docsearch-w40geAFS.js b/assets/docsearch-w40geAFS.js new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/assets/docsearch-w40geAFS.js @@ -0,0 +1 @@ + diff --git a/assets/docsearch.html-4mSLVIiN.js b/assets/docsearch.html-4mSLVIiN.js new file mode 100644 index 000000000..dcb0402ff --- /dev/null +++ b/assets/docsearch.html-4mSLVIiN.js @@ -0,0 +1,205 @@ +import{_ as t,r,o as D,c as i,d as a,a as s,b as n,w as p,e}from"./app-eU2v8o1B.js";const d={},y=s("h1",{id:"docsearch",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#docsearch","aria-hidden":"true"},"#"),n(" docsearch")],-1),u={href:"https://docsearch.algolia.com/",target:"_blank",rel:"noopener noreferrer"},h=e(`cloudbase init --template vuepress
快速创建和部署一个新的 VuePress 应用。TIP
Default theme will add DocSearch to the navbar once you configure this plugin correctly.
This plugin may not be used directly in other themes, so you'd better refer to the documentation of your theme for more details.
# Usage
npm i -D @vuepress/plugin-docsearch@next +
import { docsearchPlugin } from '@vuepress/plugin-docsearch' + +export default { + plugins: [ + docsearchPlugin({ + // options + }), + ], +} +
# Get Search Index
`,5),v={href:"https://docsearch.algolia.com/apply/",target:"_blank",rel:"noopener noreferrer"},C=s("a",{href:"#apikey"},"apiKey",-1),b=s("a",{href:"#indexname"},"indexName",-1),m={href:"https://docsearch.algolia.com/docs/run-your-own/",target:"_blank",rel:"noopener noreferrer"},E=s("a",{href:"#appId"},"appId",-1),_=s("a",{href:"#apikey"},"apiKey",-1),g=s("a",{href:"#indexname"},"indexName",-1),A=e(``,1),f={class:"custom-container tip"},x=s("p",{class:"custom-container-title"},"TIP",-1),B={href:"https://crawler.algolia.com/admin/crawlers/",target:"_blank",rel:"noopener noreferrer"},F=s("h2",{id:"options",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#options","aria-hidden":"true"},"#"),n(" Options")],-1),k=s("h3",{id:"apikey",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#apikey","aria-hidden":"true"},"#"),n(" apiKey")],-1),w=s("li",null,[s("p",null,[n("Type: "),s("code",null,"string")])],-1),T=s("li",null,[s("p",null,[n("Required: "),s("code",null,"true")])],-1),S=s("li",null,[s("p",null,"Details:"),s("p",null,[n("The "),s("code",null,"apiKey"),n(" that you received from the DocSearch team, or generated by yourself.")])],-1),I=s("p",null,"Also see:",-1),P={href:"https://docsearch.algolia.com/docs/api#apikey",target:"_blank",rel:"noopener noreferrer"},N=s("h3",{id:"indexname",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#indexname","aria-hidden":"true"},"#"),n(" indexName")],-1),R=s("li",null,[s("p",null,[n("Type: "),s("code",null,"string")])],-1),O=s("li",null,[s("p",null,[n("Required: "),s("code",null,"true")])],-1),U=s("li",null,[s("p",null,"Details:"),s("p",null,[n("The "),s("code",null,"indexName"),n(" that you received from the DocSearch team, or generated by yourself.")])],-1),Y=s("p",null,"Also see:",-1),z={href:"https://docsearch.algolia.com/docs/api#indexname",target:"_blank",rel:"noopener noreferrer"},q=s("h3",{id:"appid",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#appid","aria-hidden":"true"},"#"),n(" appId")],-1),L=s("li",null,[s("p",null,[n("Type: "),s("code",null,"string")])],-1),W=s("li",null,[s("p",null,[n("Required: "),s("code",null,"true")])],-1),K=s("li",null,[s("p",null,"Details:"),s("p",null,"It defines your own application ID.")],-1),j=s("p",null,"Also see:",-1),V={href:"https://docsearch.algolia.com/docs/api#appid",target:"_blank",rel:"noopener noreferrer"},M=s("h3",{id:"searchparameters",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#searchparameters","aria-hidden":"true"},"#"),n(" searchParameters")],-1),X=s("li",null,[s("p",null,[n("Type: "),s("code",null,"SearchParameters")])],-1),H=s("li",null,[s("p",null,"Details:"),s("p",null,"Parameters of Algolia Search API.")],-1),G=s("p",null,"Also see:",-1),Q={href:"https://docsearch.algolia.com/docs/api/#searchparameters",target:"_blank",rel:"noopener noreferrer"},$={href:"https://www.algolia.com/doc/api-reference/search-api-parameters/",target:"_blank",rel:"noopener noreferrer"},J=s("h3",{id:"placeholder",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#placeholder","aria-hidden":"true"},"#"),n(" placeholder")],-1),Z=s("li",null,[s("p",null,[n("Type: "),s("code",null,"string")])],-1),ss=s("li",null,[s("p",null,[n("Default: "),s("code",null,"'Search docs'")])],-1),ns=s("li",null,[s("p",null,"Details:"),s("p",null,"The placeholder attribute of the search input.")],-1),as=s("p",null,"Also see:",-1),ls={href:"https://docsearch.algolia.com/docs/api/#placeholder",target:"_blank",rel:"noopener noreferrer"},es=s("h3",{id:"disableuserpersonalization",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#disableuserpersonalization","aria-hidden":"true"},"#"),n(" disableUserPersonalization")],-1),os=s("li",null,[s("p",null,[n("Type: "),s("code",null,"boolean")])],-1),ps=s("li",null,[s("p",null,[n("Default: "),s("code",null,"false")])],-1),rs=s("li",null,[s("p",null,"Details:"),s("p",null,"Whether to disable all personalized features: recent searches, favorite searches, etc.")],-1),cs=s("p",null,"Also see:",-1),ts={href:"https://docsearch.algolia.com/docs/api/#disableuserpersonalization",target:"_blank",rel:"noopener noreferrer"},Ds=s("h3",{id:"initialquery",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#initialquery","aria-hidden":"true"},"#"),n(" initialQuery")],-1),is=s("li",null,[s("p",null,[n("Type: "),s("code",null,"string")])],-1),ds=s("li",null,[s("p",null,"Details:"),s("p",null,"The initial query when the modal opens.")],-1),ys=s("p",null,"Also see:",-1),us={href:"https://docsearch.algolia.com/docs/api/#initialquery",target:"_blank",rel:"noopener noreferrer"},hs=s("h3",{id:"translations",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#translations","aria-hidden":"true"},"#"),n(" translations")],-1),vs=s("li",null,[s("p",null,[n("Type: "),s("code",null,"PartialOfficial crawler config
new Crawler({ + appId: 'YOUR_APP_ID', + apiKey: 'YOUR_API_KEY', + rateLimit: 8, + startUrls: [ + // These are urls which algolia start to craw + // If your site is divided in to mutiple parts, + // you may want to set mutiple entry links + 'https://YOUR_WEBSITE_URL/', + ], + sitemaps: [ + // if you are using sitemap plugins (e.g.: vuepress-plugin-sitemap2), you may provide one + 'https://YOUR_WEBSITE_URL/sitemap.xml', + ], + ignoreCanonicalTo: false, + exclusionPatterns: [ + // You can use this to stop algolia crawing some paths + ], + discoveryPatterns: [ + // These are urls which algolia looking for, + 'https://YOUR_WEBSITE_URL/**', + ], + // Crawler schedule, set it according to your docs update frequency + schedule: 'at 02:00 every 1 day', + actions: [ + // you may have mutiple actions, especially when you are deploying mutiple docs under one domain + { + // name the index with name you like + indexName: 'YOUR_INDEX_NAME', + // paths where the index take effect + pathsToMatch: ['https://YOUR_WEBSITE_URL/**'], + // controls how algolia extracts records from your site + recordExtractor: ({ $, helpers }) => { + // options for @vuepress/theme-default + return helpers.docsearch({ + recordProps: { + lvl0: { + selectors: '.sidebar-heading.active', + defaultValue: 'Documentation', + }, + lvl1: '.theme-default-content h1', + lvl2: '.theme-default-content h2', + lvl3: '.theme-default-content h3', + lvl4: '.theme-default-content h4', + lvl5: '.theme-default-content h5', + lvl6: '.theme-default-content h6', + content: '.theme-default-content p, .theme-default-content li', + }, + indexHeadings: true, + }) + }, + }, + ], + initialIndexSettings: { + // controls how index are initialized + // only has effects before index are initialize + // you may need to delete your index and recraw after modification + YOUR_INDEX_NAME: { + attributesForFaceting: ['type', 'lang'], + attributesToRetrieve: ['hierarchy', 'content', 'anchor', 'url'], + attributesToHighlight: ['hierarchy', 'hierarchy_camel', 'content'], + attributesToSnippet: ['content:10'], + camelCaseAttributes: ['hierarchy', 'hierarchy_radio', 'content'], + searchableAttributes: [ + 'unordered(hierarchy_radio_camel.lvl0)', + 'unordered(hierarchy_radio.lvl0)', + 'unordered(hierarchy_radio_camel.lvl1)', + 'unordered(hierarchy_radio.lvl1)', + 'unordered(hierarchy_radio_camel.lvl2)', + 'unordered(hierarchy_radio.lvl2)', + 'unordered(hierarchy_radio_camel.lvl3)', + 'unordered(hierarchy_radio.lvl3)', + 'unordered(hierarchy_radio_camel.lvl4)', + 'unordered(hierarchy_radio.lvl4)', + 'unordered(hierarchy_radio_camel.lvl5)', + 'unordered(hierarchy_radio.lvl5)', + 'unordered(hierarchy_radio_camel.lvl6)', + 'unordered(hierarchy_radio.lvl6)', + 'unordered(hierarchy_camel.lvl0)', + 'unordered(hierarchy.lvl0)', + 'unordered(hierarchy_camel.lvl1)', + 'unordered(hierarchy.lvl1)', + 'unordered(hierarchy_camel.lvl2)', + 'unordered(hierarchy.lvl2)', + 'unordered(hierarchy_camel.lvl3)', + 'unordered(hierarchy.lvl3)', + 'unordered(hierarchy_camel.lvl4)', + 'unordered(hierarchy.lvl4)', + 'unordered(hierarchy_camel.lvl5)', + 'unordered(hierarchy.lvl5)', + 'unordered(hierarchy_camel.lvl6)', + 'unordered(hierarchy.lvl6)', + 'content', + ], + distinct: true, + attributeForDistinct: 'url', + customRanking: [ + 'desc(weight.pageRank)', + 'desc(weight.level)', + 'asc(weight.position)', + ], + ranking: [ + 'words', + 'filters', + 'typo', + 'attribute', + 'proximity', + 'exact', + 'custom', + ], + highlightPreTag: '<span class="algolia-docsearch-suggestion--highlight">', + highlightPostTag: '</span>', + minWordSizefor1Typo: 3, + minWordSizefor2Typos: 7, + allowTyposOnNumericTokens: false, + minProximity: 1, + ignorePlurals: true, + advancedSyntax: true, + attributeCriteriaComputedByMinProximity: true, + removeWordsIfNoResults: 'allOptional', + }, + }, +}) +
The above
recordProps
is the configuration used for the default theme. You can modify them according to the theme you are using.Notice that the
initialIndexSettings.YOUR_INDEX_NAME.attributesForFaceting
fields must include'lang'
to make this plugin work properly.")])],-1),Cs=s("li",null,[s("p",null,"Details:"),s("p",null,"Allow replacing the default text in the DocSearch button or modal.")],-1),bs=s("p",null,"Also see:",-1),ms={href:"https://docsearch.algolia.com/docs/api/#translations",target:"_blank",rel:"noopener noreferrer"},Es=e(` # locales
Type:
Record<string, DocsearchPluginOptions>
Details:
Options of this plugin in different locales.
All other options of this plugin are acceptable in locale config.
Example:
`,3),_s=s("h3",{id:"indexbase",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#indexbase","aria-hidden":"true"},"#"),n(" indexBase")],-1),gs=s("li",null,[s("p",null,[n("Type: "),s("code",null,"string")])],-1),As=s("p",null,"Details:",-1),fs=s("p",null,"The base path of the search index.",-1),xs=s("p",null,[n("If you are deploying your site to multiple domains, you don't need to submit all of them to DocSearch and generate search index separately. You could choose one of the domains as the "),s("em",null,"index domain"),n(", and only submit the "),s("em",null,"index domain"),n(" to Docsearch for crawling search index. Then, you could reuse the search index across all deployments.")],-1),Bs=s("em",null,"index domain",-1),Fs=e('export default { + plugins: [ + docsearchPlugin({ + appId: '<APP_ID>', + apiKey: '<API_KEY>', + indexName: '<INDEX_NAME>', + locales: { + '/': { + placeholder: 'Search Documentation', + translations: { + button: { + buttonText: 'Search Documentation', + }, + }, + }, + '/zh/': { + placeholder: '搜索文档', + translations: { + button: { + buttonText: '搜索文档', + }, + }, + }, + }, + }), + ], +} +
# injectStyles
Type:
boolean
Default:
true
Details:
Whether to inject the default styles of DocSearch or not.
If you think the default styles of DocSearch is not compatible with your site, you can try to override the default styles, or set this option to
false
to totally exclude the default styles.When this option is disabled, you need to import your own styles for DocSearch. Also notice that all styles customization in Styles section would be unavailable.
# Styles
',3),ks={href:"https://docsearch.algolia.com/docs/styling",target:"_blank",rel:"noopener noreferrer"},ws=e(`:root { + --docsearch-primary-color: rgb(84, 104, 255); + --docsearch-text-color: rgb(28, 30, 33); + --docsearch-spacing: 12px; + --docsearch-icon-stroke-width: 1.4; + --docsearch-highlight-color: var(--docsearch-primary-color); + --docsearch-muted-color: rgb(150, 159, 175); + --docsearch-container-background: rgba(101, 108, 133, 0.8); + --docsearch-logo-color: rgba(84, 104, 255); + + /* modal */ + --docsearch-modal-width: 560px; + --docsearch-modal-height: 600px; + --docsearch-modal-background: rgb(245, 246, 247); + --docsearch-modal-shadow: inset 1px 1px 0 0 rgba(255, 255, 255, 0.5), 0 3px + 8px 0 rgba(85, 90, 100, 1); + + /* searchbox */ + --docsearch-searchbox-height: 56px; + --docsearch-searchbox-background: rgb(235, 237, 240); + --docsearch-searchbox-focus-background: #fff; + --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color); + + /* hit */ + --docsearch-hit-height: 56px; + --docsearch-hit-color: rgb(68, 73, 80); + --docsearch-hit-active-color: #fff; + --docsearch-hit-background: #fff; + --docsearch-hit-shadow: 0 1px 3px 0 rgb(212, 217, 225); + + /* key */ + --docsearch-key-gradient: linear-gradient( + -225deg, + rgb(213, 219, 228) 0%, + rgb(248, 248, 248) 100% + ); + --docsearch-key-shadow: inset 0 -2px 0 0 rgb(205, 205, 230), inset 0 0 1px 1px + #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4); + + /* footer */ + --docsearch-footer-height: 44px; + --docsearch-footer-background: #fff; + --docsearch-footer-shadow: 0 -1px 0 0 rgb(224, 227, 232), 0 -3px 6px 0 rgba(69, 98, 155, 0.12); +} +
# Components
# Docsearch
Details:
This plugin will register a
<Docsearch />
component globally, and you can use it without any props.Put this component to where you want to place the docsearch button. For example, default theme puts this component to the end of the navbar.
`,5);function Ts(Ss,Is){const c=r("NpmBadge"),l=r("ExternalLinkIcon"),o=r("RouterLink");return D(),i("div",null,[y,a(c,{package:"@vuepress/plugin-docsearch"}),s("p",null,[n("Integrate "),s("a",u,[n("Algolia DocSearch"),a(l)]),n(" into VuePress, which can provide search to your documentation site.")]),h,s("p",null,[n("You need to "),s("a",v,[n("submit the URL of your site"),a(l)]),n(" to join the DocSearch program. The DocSearch team will send "),C,n(" and "),b,n(" to your email once the index is generated. Then you can configure this plugin to enable DocSearch in VuePress.")]),s("p",null,[n("Alternatively, you can "),s("a",m,[n("run your own crawler"),a(l)]),n(" to generate the index, and then use your own "),E,n(", "),_,n(" and "),g,n(" to configure this plugin.")]),A,s("div",f,[x,s("p",null,[n("If you are not using default theme, or you meet any problems when using docsearch, you can also check the above example crawler config, and ahead to "),s("a",B,[n("Algolia Crawler"),a(l)]),n(", and edit your config with 'Editor' panel in project sidebar.")])]),F,k,s("ul",null,[w,T,S,s("li",null,[I,s("ul",null,[s("li",null,[s("a",P,[n("DocSearch > Options > apiKey"),a(l)])])])])]),N,s("ul",null,[R,O,U,s("li",null,[Y,s("ul",null,[s("li",null,[s("a",z,[n("DocSearch > Options > indexName"),a(l)])])])])]),q,s("ul",null,[L,W,K,s("li",null,[j,s("ul",null,[s("li",null,[s("a",V,[n("DocSearch > Options > appId"),a(l)])])])])]),M,s("ul",null,[X,H,s("li",null,[G,s("ul",null,[s("li",null,[s("a",Q,[n("DocSearch > Options > searchParameters"),a(l)])]),s("li",null,[s("a",$,[n("Algolia > Search API Parameters"),a(l)])])])])]),J,s("ul",null,[Z,ss,ns,s("li",null,[as,s("ul",null,[s("li",null,[s("a",ls,[n("DocSearch > Options > placeholder"),a(l)])])])])]),es,s("ul",null,[os,ps,rs,s("li",null,[cs,s("ul",null,[s("li",null,[s("a",ts,[n("DocSearch > Options > disableUserPersonalization"),a(l)])])])])]),Ds,s("ul",null,[is,ds,s("li",null,[ys,s("ul",null,[s("li",null,[s("a",us,[n("DocSearch > Options > initialQuery"),a(l)])])])])]),hs,s("ul",null,[vs,Cs,s("li",null,[bs,s("ul",null,[s("li",null,[s("a",ms,[n("DocSearch > Options > translations"),a(l)])])])])]),Es,s("ul",null,[s("li",null,[n("Also see: "),s("ul",null,[s("li",null,[a(o,{to:"/guide/i18n.html"},{default:p(()=>[n("Guide > I18n")]),_:1})])])])]),_s,s("ul",null,[gs,s("li",null,[s("p",null,[n("Default: "),a(o,{to:"/reference/config.html#base"},{default:p(()=>[n("base")]),_:1})])]),s("li",null,[As,fs,xs,s("p",null,[n("However, if the "),a(o,{to:"/reference/config.html#base"},{default:p(()=>[n("base")]),_:1}),n(" of your deployments are different for different domains, you need to set the option to the "),a(o,{to:"/reference/config.html#base"},{default:p(()=>[n("base")]),_:1}),n(" of your "),Bs,n(", so that other deployments could reuse the search index correctly.")])])]),Fs,s("p",null,[n("You can customize styles via CSS variables that provided by "),s("a",ks,[n("@docsearch/css"),a(l)]),n(":")]),ws])}const Ns=t(d,[["render",Ts],["__file","docsearch.html.vue"]]);export{Ns as default}; diff --git a/assets/docsearch.html-geU7FZc2.js b/assets/docsearch.html-geU7FZc2.js new file mode 100644 index 000000000..c3e02f8e2 --- /dev/null +++ b/assets/docsearch.html-geU7FZc2.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-ec0baf10","path":"/reference/plugin/docsearch.html","title":"docsearch","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Get Search Index","slug":"get-search-index","link":"#get-search-index","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"apiKey","slug":"apikey","link":"#apikey","children":[]},{"level":3,"title":"indexName","slug":"indexname","link":"#indexname","children":[]},{"level":3,"title":"appId","slug":"appid","link":"#appid","children":[]},{"level":3,"title":"searchParameters","slug":"searchparameters","link":"#searchparameters","children":[]},{"level":3,"title":"placeholder","slug":"placeholder","link":"#placeholder","children":[]},{"level":3,"title":"disableUserPersonalization","slug":"disableuserpersonalization","link":"#disableuserpersonalization","children":[]},{"level":3,"title":"initialQuery","slug":"initialquery","link":"#initialquery","children":[]},{"level":3,"title":"translations","slug":"translations","link":"#translations","children":[]},{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]},{"level":3,"title":"indexBase","slug":"indexbase","link":"#indexbase","children":[]},{"level":3,"title":"injectStyles","slug":"injectstyles","link":"#injectstyles","children":[]}]},{"level":2,"title":"Styles","slug":"styles","link":"#styles","children":[]},{"level":2,"title":"Components","slug":"components","link":"#components","children":[{"level":3,"title":"Docsearch","slug":"docsearch-1","link":"#docsearch-1","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/docsearch.md"}');export{e as data}; diff --git a/assets/docsearch.html-qC621Z1-.js b/assets/docsearch.html-qC621Z1-.js new file mode 100644 index 000000000..ebdedb2ee --- /dev/null +++ b/assets/docsearch.html-qC621Z1-.js @@ -0,0 +1,203 @@ +import{_ as D,r,o as t,c as i,d as l,a as s,b as n,w as o,e}from"./app-eU2v8o1B.js";const y={},d=s("h1",{id:"docsearch",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#docsearch","aria-hidden":"true"},"#"),n(" docsearch")],-1),u={href:"https://docsearch.algolia.com/",target:"_blank",rel:"noopener noreferrer"},h=e(`TIP
This component is mainly used for theme development. You don't need to use it directly in most cases.
提示
当你正确配置该插件后,默认主题会把 DocSearch 按钮添加到导航栏。
该插件不一定能在其他主题中直接使用,因此你应参考主题本身的文档来获取更多信息。
# 使用方法
npm i -D @vuepress/plugin-docsearch@next +
import { docsearchPlugin } from '@vuepress/plugin-docsearch' + +export default { + plugins: [ + docsearchPlugin({ + // 配置项 + }), + ], +} +
# 获取搜索索引
`,5),v={href:"https://docsearch.algolia.com/apply/",target:"_blank",rel:"noopener noreferrer"},C=s("a",{href:"#apikey"},"apiKey",-1),b=s("a",{href:"#indexname"},"indexName",-1),m={href:"https://docsearch.algolia.com/docs/run-your-own/",target:"_blank",rel:"noopener noreferrer"},E=s("a",{href:"#appId"},"appId",-1),_=s("a",{href:"#apikey"},"apiKey",-1),A=s("a",{href:"#indexname"},"indexName",-1),g=e(``,1),B={class:"custom-container tip"},f=s("p",{class:"custom-container-title"},"提示",-1),F={href:"https://crawler.algolia.com/admin/crawlers/",target:"_blank",rel:"noopener noreferrer"},x=s("h2",{id:"配置项",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#配置项","aria-hidden":"true"},"#"),n(" 配置项")],-1),k=s("h3",{id:"apikey",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#apikey","aria-hidden":"true"},"#"),n(" apiKey")],-1),S=s("li",null,[s("p",null,[n("类型: "),s("code",null,"string")])],-1),P=s("li",null,[s("p",null,[n("是否必需: "),s("code",null,"true")])],-1),I=s("li",null,[s("p",null,"详情:"),s("p",null,[n("从 DocSearch 团队收到的 "),s("code",null,"apiKey"),n(" ,或者由你自己生成。")])],-1),w=s("p",null,"参考:",-1),N={href:"https://docsearch.algolia.com/docs/api#apikey",target:"_blank",rel:"noopener noreferrer"},R=s("h3",{id:"indexname",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#indexname","aria-hidden":"true"},"#"),n(" indexName")],-1),O=s("li",null,[s("p",null,[n("类型: "),s("code",null,"string")])],-1),T=s("li",null,[s("p",null,[n("是否必需: "),s("code",null,"true")])],-1),U=s("li",null,[s("p",null,"详情:"),s("p",null,[n("从 DocSearch 团队收到的 "),s("code",null,"indexName"),n(" ,或者由你自己生成。")])],-1),z=s("p",null,"参考:",-1),L={href:"https://docsearch.algolia.com/docs/api#indexname",target:"_blank",rel:"noopener noreferrer"},Y=s("h3",{id:"appid",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#appid","aria-hidden":"true"},"#"),n(" appId")],-1),K=s("li",null,[s("p",null,[n("类型: "),s("code",null,"string")])],-1),V=s("li",null,[s("p",null,[n("是否必需: "),s("code",null,"true")])],-1),W=s("li",null,[s("p",null,"详情:"),s("p",null,"用于设置你的 Application ID。")],-1),M=s("p",null,"参考:",-1),j={href:"https://docsearch.algolia.com/docs/api#appid",target:"_blank",rel:"noopener noreferrer"},q=s("h3",{id:"searchparameters",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#searchparameters","aria-hidden":"true"},"#"),n(" searchParameters")],-1),X=s("li",null,[s("p",null,[n("类型: "),s("code",null,"SearchParameters")])],-1),H=s("li",null,[s("p",null,"详情:"),s("p",null,"Algolia 搜索 API 参数。")],-1),Q=s("p",null,"参考:",-1),$={href:"https://docsearch.algolia.com/docs/api/#searchparameters",target:"_blank",rel:"noopener noreferrer"},G={href:"https://www.algolia.com/doc/api-reference/search-api-parameters/",target:"_blank",rel:"noopener noreferrer"},J=s("h3",{id:"placeholder",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#placeholder","aria-hidden":"true"},"#"),n(" placeholder")],-1),Z=s("li",null,[s("p",null,[n("类型: "),s("code",null,"string")])],-1),ss=s("li",null,[s("p",null,[n("默认值: "),s("code",null,"'Search docs'")])],-1),ns=s("li",null,[s("p",null,"详情:"),s("p",null,"搜索输入框的 placeholder 属性。")],-1),ls=s("p",null,"参考:",-1),as={href:"https://docsearch.algolia.com/docs/api#placeholder",target:"_blank",rel:"noopener noreferrer"},es=s("h3",{id:"disableuserpersonalization",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#disableuserpersonalization","aria-hidden":"true"},"#"),n(" disableUserPersonalization")],-1),ps=s("li",null,[s("p",null,[n("类型: "),s("code",null,"boolean")])],-1),os=s("li",null,[s("p",null,[n("默认值: "),s("code",null,"false")])],-1),rs=s("li",null,[s("p",null,"详情:"),s("p",null,"是否禁用所有的个性化功能:最近的搜索、收藏的搜索结果等。")],-1),cs=s("p",null,"参考:",-1),Ds={href:"https://docsearch.algolia.com/docs/api#disableuserpersonalization",target:"_blank",rel:"noopener noreferrer"},ts=s("h3",{id:"initialquery",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#initialquery","aria-hidden":"true"},"#"),n(" initialQuery")],-1),is=s("li",null,[s("p",null,[n("类型: "),s("code",null,"string")])],-1),ys=s("li",null,[s("p",null,"详情:"),s("p",null,"打开弹窗时的初始请求。")],-1),ds=s("p",null,"参考:",-1),us={href:"https://docsearch.algolia.com/docs/api#initialquery",target:"_blank",rel:"noopener noreferrer"},hs=s("h3",{id:"translations",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#translations","aria-hidden":"true"},"#"),n(" translations")],-1),vs=s("li",null,[s("p",null,[n("类型: "),s("code",null,"Partial官方爬虫配置示例
new Crawler({ + appId: 'YOUR_APP_ID', + apiKey: 'YOUR_API_KEY', + rateLimit: 8, + startUrls: [ + // 这是 Algolia 开始抓取网站的初始地址 + // 如果你的网站被分为数个独立部分,你可能需要在此设置多个入口链接 + 'https://YOUR_WEBSITE_URL/', + ], + sitemaps: [ + // 如果你在使用 Sitemap 插件 (如: vuepress-plugin-sitemap2),你可以提供 Sitemap 链接 + 'https://YOUR_WEBSITE_URL/sitemap.xml', + ], + ignoreCanonicalTo: false, + exclusionPatterns: [ + // 你可以通过它阻止 Algolia 抓取某些 URL + ], + discoveryPatterns: [ + // 这是 Algolia 抓取 URL 的范围 + 'https://YOUR_WEBSITE_URL/**', + ], + // 爬虫执行的计划时间,可根据文档更新频率设置 + schedule: 'at 02:00 every 1 day', + actions: [ + // 你可以拥有多个 action,特别是你在一个域名下部署多个文档时 + { + // 使用适当的名称为索引命名 + indexName: 'YOUR_INDEX_NAME', + // 索引生效的路径 + pathsToMatch: ['https://YOUR_WEBSITE_URL/**'], + // 控制 Algolia 如何抓取你的站点 + recordExtractor: ({ $, helpers }) => { + // @vuepress/theme-default 的选项 + return helpers.docsearch({ + recordProps: { + lvl0: { + selectors: '.sidebar-heading.active', + defaultValue: 'Documentation', + }, + lvl1: '.theme-default-content h1', + lvl2: '.theme-default-content h2', + lvl3: '.theme-default-content h3', + lvl4: '.theme-default-content h4', + lvl5: '.theme-default-content h5', + lvl6: '.theme-default-content h6', + content: '.theme-default-content p, .theme-default-content li', + }, + indexHeadings: true, + }) + }, + }, + ], + initialIndexSettings: { + // 控制索引如何被初始化,这仅当索引尚未生成时有效 + // 你可能需要在修改后手动删除并重新生成新的索引 + YOUR_INDEX_NAME: { + attributesForFaceting: ['type', 'lang'], + attributesToRetrieve: ['hierarchy', 'content', 'anchor', 'url'], + attributesToHighlight: ['hierarchy', 'hierarchy_camel', 'content'], + attributesToSnippet: ['content:10'], + camelCaseAttributes: ['hierarchy', 'hierarchy_radio', 'content'], + searchableAttributes: [ + 'unordered(hierarchy_radio_camel.lvl0)', + 'unordered(hierarchy_radio.lvl0)', + 'unordered(hierarchy_radio_camel.lvl1)', + 'unordered(hierarchy_radio.lvl1)', + 'unordered(hierarchy_radio_camel.lvl2)', + 'unordered(hierarchy_radio.lvl2)', + 'unordered(hierarchy_radio_camel.lvl3)', + 'unordered(hierarchy_radio.lvl3)', + 'unordered(hierarchy_radio_camel.lvl4)', + 'unordered(hierarchy_radio.lvl4)', + 'unordered(hierarchy_radio_camel.lvl5)', + 'unordered(hierarchy_radio.lvl5)', + 'unordered(hierarchy_radio_camel.lvl6)', + 'unordered(hierarchy_radio.lvl6)', + 'unordered(hierarchy_camel.lvl0)', + 'unordered(hierarchy.lvl0)', + 'unordered(hierarchy_camel.lvl1)', + 'unordered(hierarchy.lvl1)', + 'unordered(hierarchy_camel.lvl2)', + 'unordered(hierarchy.lvl2)', + 'unordered(hierarchy_camel.lvl3)', + 'unordered(hierarchy.lvl3)', + 'unordered(hierarchy_camel.lvl4)', + 'unordered(hierarchy.lvl4)', + 'unordered(hierarchy_camel.lvl5)', + 'unordered(hierarchy.lvl5)', + 'unordered(hierarchy_camel.lvl6)', + 'unordered(hierarchy.lvl6)', + 'content', + ], + distinct: true, + attributeForDistinct: 'url', + customRanking: [ + 'desc(weight.pageRank)', + 'desc(weight.level)', + 'asc(weight.position)', + ], + ranking: [ + 'words', + 'filters', + 'typo', + 'attribute', + 'proximity', + 'exact', + 'custom', + ], + highlightPreTag: '<span class="algolia-docsearch-suggestion--highlight">', + highlightPostTag: '</span>', + minWordSizefor1Typo: 3, + minWordSizefor2Typos: 7, + allowTyposOnNumericTokens: false, + minProximity: 1, + ignorePlurals: true, + advancedSyntax: true, + attributeCriteriaComputedByMinProximity: true, + removeWordsIfNoResults: 'allOptional', + }, + }, +}) +
上述
recordProps
是用于默认主题的配置,你可以根据你使用的主题来修改它们。注意
initialIndexSettings.YOUR_INDEX_NAME.attributesForFaceting
字段必须包含'lang'
,否则该插件将无法正常工作。")])],-1),Cs=s("li",null,[s("p",null,"详情:"),s("p",null,"允许替换 DocSearch 按钮和弹窗内的默认文字。")],-1),bs=s("p",null,"参考:",-1),ms={href:"https://docsearch.algolia.com/docs/api/#translations",target:"_blank",rel:"noopener noreferrer"},Es=e(` # locales
类型:
Record<string, DocsearchPluginOptions>
详情:
在不同 locales 下对该插件进行不同的配置。
该插件的所有其他选项都可以在 locale 中进行配置。
示例:
`,3),_s=s("h3",{id:"indexbase",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#indexbase","aria-hidden":"true"},"#"),n(" indexBase")],-1),As=s("li",null,[s("p",null,[n("类型: "),s("code",null,"string")])],-1),gs=s("p",null,"详情:",-1),Bs=s("p",null,"搜索索引基础路径。",-1),fs=s("p",null,[n("如果你需要把你的站点部署到不同的域名上,你不需要把它们全都提交到 Docsearch 上来分别生成搜索索引。你可以选择其中一个域名作为 "),s("em",null,"索引域名"),n(" ,并且仅将 "),s("em",null,"索引域名"),n(" 提交到 DocSearch 上来爬去搜索索引。然后,你就可以在不同的部署域名下复用索引。")],-1),Fs=s("em",null,"索引域名",-1),xs=e('export default { + plugins: [ + docsearchPlugin({ + appId: '<APP_ID>', + apiKey: '<API_KEY>', + indexName: '<INDEX_NAME>', + locales: { + '/': { + placeholder: 'Search Documentation', + translations: { + button: { + buttonText: 'Search Documentation', + }, + }, + }, + '/zh/': { + placeholder: '搜索文档', + translations: { + button: { + buttonText: '搜索文档', + }, + }, + }, + }, + }), + ], +} +
# injectStyles
类型:
boolean
默认值:
true
详情:
是否注入 DocSearch 的默认样式。
如果你认为 DocSearch 的默认样式和你的站点不兼容,你可以尝试覆盖默认样式,或者将该选项设置为
false
来完全移除默认样式。当该选项被禁用时,你需要为 DocSearch 引入你自己的样式。同时要注意,你也无法再使用 样式 章节中提到的样式自定义能力。
# 样式
',3),ks={href:"https://docsearch.algolia.com/docs/styling",target:"_blank",rel:"noopener noreferrer"},Ss=e(`:root { + --docsearch-primary-color: rgb(84, 104, 255); + --docsearch-text-color: rgb(28, 30, 33); + --docsearch-spacing: 12px; + --docsearch-icon-stroke-width: 1.4; + --docsearch-highlight-color: var(--docsearch-primary-color); + --docsearch-muted-color: rgb(150, 159, 175); + --docsearch-container-background: rgba(101, 108, 133, 0.8); + --docsearch-logo-color: rgba(84, 104, 255); + + /* modal */ + --docsearch-modal-width: 560px; + --docsearch-modal-height: 600px; + --docsearch-modal-background: rgb(245, 246, 247); + --docsearch-modal-shadow: inset 1px 1px 0 0 rgba(255, 255, 255, 0.5), 0 3px + 8px 0 rgba(85, 90, 100, 1); + + /* searchbox */ + --docsearch-searchbox-height: 56px; + --docsearch-searchbox-background: rgb(235, 237, 240); + --docsearch-searchbox-focus-background: #fff; + --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color); + + /* hit */ + --docsearch-hit-height: 56px; + --docsearch-hit-color: rgb(68, 73, 80); + --docsearch-hit-active-color: #fff; + --docsearch-hit-background: #fff; + --docsearch-hit-shadow: 0 1px 3px 0 rgb(212, 217, 225); + + /* key */ + --docsearch-key-gradient: linear-gradient( + -225deg, + rgb(213, 219, 228) 0%, + rgb(248, 248, 248) 100% + ); + --docsearch-key-shadow: inset 0 -2px 0 0 rgb(205, 205, 230), inset 0 0 1px 1px + #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4); + + /* footer */ + --docsearch-footer-height: 44px; + --docsearch-footer-background: #fff; + --docsearch-footer-shadow: 0 -1px 0 0 rgb(224, 227, 232), 0 -3px 6px 0 rgba(69, 98, 155, 0.12); +} +
# 组件
# Docsearch
详情:
该插件会全局注册一个
<Docsearch />
组件,你可以不传入任何 Props 来使用它。将该组件放置在你想要显示 docsearch 按钮的地方。例如,默认主题将这个组件放在了导航栏的末尾。
`,5);function Ps(Is,ws){const c=r("NpmBadge"),a=r("ExternalLinkIcon"),p=r("RouterLink");return t(),i("div",null,[d,l(c,{package:"@vuepress/plugin-docsearch"}),s("p",null,[n("将 "),s("a",u,[n("Algolia DocSearch"),l(a)]),n(" 集成到 VuePress 中,为你的文档网站提供搜索功能。")]),h,s("p",null,[n("你需要 "),s("a",v,[n("提交你的网站 URL"),l(a)]),n(" 来加入 DocSearch 项目。当你的索引成功创建后, DocSearch 团队会将 "),C,n(" 和 "),b,n(" 发送到你的邮箱。接下来,你就可以配置该插件,在 VuePress 中启用 DocSearch 了。")]),s("p",null,[n("或者,你也可以 "),s("a",m,[n("运行你自己的爬虫"),l(a)]),n(" 来创建索引,然后使用你自己的 "),E,n(", "),_,n(" 和 "),A,n(" 来配置该插件。")]),g,s("div",B,[f,s("p",null,[n("如果你使用的不是默认主题,或者在使用 Docsearch 的时候遇到了任何问题,你也可以检查上述的爬虫配置示例,然后前往 "),s("a",F,[n("Algolia Crawler"),l(a)]),n(" 仓库,在你项目侧边栏中的 Editor 页面中修改你的配置。")])]),x,k,s("ul",null,[S,P,I,s("li",null,[w,s("ul",null,[s("li",null,[s("a",N,[n("DocSearch > Options > apiKey"),l(a)])])])])]),R,s("ul",null,[O,T,U,s("li",null,[z,s("ul",null,[s("li",null,[s("a",L,[n("DocSearch > Options > indexName"),l(a)])])])])]),Y,s("ul",null,[K,V,W,s("li",null,[M,s("ul",null,[s("li",null,[s("a",j,[n("DocSearch > Options > appId"),l(a)])])])])]),q,s("ul",null,[X,H,s("li",null,[Q,s("ul",null,[s("li",null,[s("a",$,[n("DocSearch > Options > searchParameters"),l(a)])]),s("li",null,[s("a",G,[n("Algolia > Search API Parameters"),l(a)])])])])]),J,s("ul",null,[Z,ss,ns,s("li",null,[ls,s("ul",null,[s("li",null,[s("a",as,[n("DocSearch > Options > placeholder"),l(a)])])])])]),es,s("ul",null,[ps,os,rs,s("li",null,[cs,s("ul",null,[s("li",null,[s("a",Ds,[n("DocSearch > Options > disableUserPersonalization"),l(a)])])])])]),ts,s("ul",null,[is,ys,s("li",null,[ds,s("ul",null,[s("li",null,[s("a",us,[n("DocSearch > Options > initialQuery"),l(a)])])])])]),hs,s("ul",null,[vs,Cs,s("li",null,[bs,s("ul",null,[s("li",null,[s("a",ms,[n("DocSearch > Options > translations"),l(a)])])])])]),Es,s("ul",null,[s("li",null,[n("参考: "),s("ul",null,[s("li",null,[l(p,{to:"/zh/guide/i18n.html"},{default:o(()=>[n("指南 > 多语言支持")]),_:1})])])])]),_s,s("ul",null,[As,s("li",null,[s("p",null,[n("默认值: "),l(p,{to:"/zh/reference/config.html#base"},{default:o(()=>[n("base")]),_:1})])]),s("li",null,[gs,Bs,fs,s("p",null,[n("如果你不同部署域名下的 "),l(p,{to:"/zh/reference/config.html#base"},{default:o(()=>[n("base")]),_:1}),n(" 是不一样的,你就需要将这个配置设置成 "),Fs,n(" 的 "),l(p,{to:"/zh/reference/config.html#base"},{default:o(()=>[n("base")]),_:1}),n(" ,这样其他的部署域名就可以正确复用索引了。")])])]),xs,s("p",null,[n("你可以通过 "),s("a",ks,[n("@docsearch/css"),l(a)]),n(" 提供的 CSS 变量来自定义样式:")]),Ss])}const Rs=D(y,[["render",Ps],["__file","docsearch.html.vue"]]);export{Rs as default}; diff --git a/assets/docsearch.html-yW8YJyTj.js b/assets/docsearch.html-yW8YJyTj.js new file mode 100644 index 000000000..fe89bee69 --- /dev/null +++ b/assets/docsearch.html-yW8YJyTj.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-190c7f2e","path":"/zh/reference/plugin/docsearch.html","title":"docsearch","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"获取搜索索引","slug":"获取搜索索引","link":"#获取搜索索引","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"apiKey","slug":"apikey","link":"#apikey","children":[]},{"level":3,"title":"indexName","slug":"indexname","link":"#indexname","children":[]},{"level":3,"title":"appId","slug":"appid","link":"#appid","children":[]},{"level":3,"title":"searchParameters","slug":"searchparameters","link":"#searchparameters","children":[]},{"level":3,"title":"placeholder","slug":"placeholder","link":"#placeholder","children":[]},{"level":3,"title":"disableUserPersonalization","slug":"disableuserpersonalization","link":"#disableuserpersonalization","children":[]},{"level":3,"title":"initialQuery","slug":"initialquery","link":"#initialquery","children":[]},{"level":3,"title":"translations","slug":"translations","link":"#translations","children":[]},{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]},{"level":3,"title":"indexBase","slug":"indexbase","link":"#indexbase","children":[]},{"level":3,"title":"injectStyles","slug":"injectstyles","link":"#injectstyles","children":[]}]},{"level":2,"title":"样式","slug":"样式","link":"#样式","children":[]},{"level":2,"title":"组件","slug":"组件","link":"#组件","children":[{"level":3,"title":"Docsearch","slug":"docsearch-1","link":"#docsearch-1","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/docsearch.md"}');export{e as data}; diff --git a/assets/extending-a-theme-01-xmIu-MPG.js b/assets/extending-a-theme-01-xmIu-MPG.js new file mode 100644 index 000000000..5bdac7ac1 --- /dev/null +++ b/assets/extending-a-theme-01-xmIu-MPG.js @@ -0,0 +1 @@ +const o="/images/cookbook/extending-a-theme-01.png";export{o as _}; diff --git a/assets/extending.html-DQbmt8Sf.js b/assets/extending.html-DQbmt8Sf.js new file mode 100644 index 000000000..c74329e72 --- /dev/null +++ b/assets/extending.html-DQbmt8Sf.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6175ace0","path":"/reference/default-theme/extending.html","title":"Extending","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Layout Slots","slug":"layout-slots","link":"#layout-slots","children":[]},{"level":2,"title":"Components Replacement","slug":"components-replacement","link":"#components-replacement","children":[]},{"level":2,"title":"Developing a Child Theme","slug":"developing-a-child-theme","link":"#developing-a-child-theme","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/default-theme/extending.md"}');export{e as data}; diff --git a/assets/extending.html-oNTFNs2u.js b/assets/extending.html-oNTFNs2u.js new file mode 100644 index 000000000..b63408ac3 --- /dev/null +++ b/assets/extending.html-oNTFNs2u.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-90ed1862","path":"/zh/reference/default-theme/extending.html","title":"继承","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"布局插槽","slug":"布局插槽","link":"#布局插槽","children":[]},{"level":2,"title":"组件替换","slug":"组件替换","link":"#组件替换","children":[]},{"level":2,"title":"开发一个子主题","slug":"开发一个子主题","link":"#开发一个子主题","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/default-theme/extending.md"}');export{e as data}; diff --git a/assets/extending.html-w7Kv_9tW.js b/assets/extending.html-w7Kv_9tW.js new file mode 100644 index 000000000..3a970e44f --- /dev/null +++ b/assets/extending.html-w7Kv_9tW.js @@ -0,0 +1,64 @@ +import{_ as c}from"./extending-a-theme-01-xmIu-MPG.js";import{_ as t,r as a,o as r,c as D,a as n,b as s,d as l,w as i,e}from"./app-eU2v8o1B.js";const y={},d=e(`提示
该组件主要用于主题开发。在大多数情况下你不需要直接使用该组件。
# 继承
VuePress 默认主题有着大量的用户,因此我们对它进行了一些便于继承的设计,以便用户轻松进行定制化。
VuePress 提供了继承主题的基础能力,但不同的主题可能会提供不同的可继承的功能。因此,如果你使用的是一个社区主题的话,你最好参考主题本身的文档来了解如何继承它。
# 布局插槽
默认主题的
Layout
布局提供了一些插槽:
navbar
navbar-before
navbar-after
sidebar
sidebar-top
sidebar-bottom
page
page-top
page-bottom
page-content-top
page-content-bottom
在它们的帮助下,你可以很容易地添加或替换内容。下面通过一个示例来介绍一下如何使用布局插槽来继承默认主题。
首先,创建一个客户端配置文件
.vuepress/client.ts
:import { defineClientConfig } from '@vuepress/client' +import Layout from './layouts/Layout.vue' + +export default defineClientConfig({ + layouts: { + Layout, + }, +}) +
接下来,创建
.vuepress/layouts/Layout.vue
,并使用由默认主题的Layout
布局提供的插槽:<script setup> +import ParentLayout from '@vuepress/theme-default/layouts/Layout.vue' +</script> + +<template> + <ParentLayout> + <template #page-bottom> + <div class="my-footer">This is my custom page footer</div> + </template> + </ParentLayout> +</template> + +<style lang="css"> +.my-footer { + text-align: center; +} +</style> +
此时默认的
Layout
布局已经被你的本地布局覆盖,将会在除了首页外的所有页面添加一个自定义的页脚:# 组件替换
布局插槽十分实用,但有时候你可能会觉得它不够灵活。默认主题同样提供了替换单个组件的能力。
',15),C={href:"https://github.com/vuepress/ecosystem/tree/main/themes/theme-default/src/client/components",target:"_blank",rel:"noopener noreferrer"},v=n("code",null,"@theme",-1),u=n("code",null,"HomeFooter.vue",-1),m=n("code",null,"@theme/HomeFooter.vue",-1),b=e(`接下来,如果你想要替换
HomeFooter.vue
组件,只需要在配置文件.vuepress/config.ts
中覆盖这个别名即可:import { getDirname, path } from '@vuepress/utils' +import { defaultTheme, defineUserConfig } from 'vuepress' + +const __dirname = getDirname(import.meta.url) + +export default defineUserConfig({ + theme: defaultTheme(), + alias: { + '@theme/HomeFooter.vue': path.resolve( + __dirname, + './components/MyHomeFooter.vue', + ), + }, +}) +
# 开发一个子主题
除了在
.vuepress/config.ts
和.vuepress/client.ts
中直接扩展默认主题以外,你可以通过继承默认主题来开发一个你自己的主题:`,5);function h(E,F){const p=a("ExternalLinkIcon"),o=a("RouterLink");return r(),D("div",null,[d,n("p",null,[s("默认主题将所有 "),n("a",C,[s("非全局的组件"),l(p)]),s(" 都注册了一个带 "),v,s(" 前缀的 "),l(o,{to:"/zh/reference/plugin-api.html#alias"},{default:i(()=>[s("alias")]),_:1}),s(" 。例如,"),u,s(" 的别名是 "),m,s(" 。")]),b])}const _=t(y,[["render",h],["__file","extending.html.vue"]]);export{_ as default}; diff --git a/assets/extending.html-wJrHlIH8.js b/assets/extending.html-wJrHlIH8.js new file mode 100644 index 000000000..cae30bd9b --- /dev/null +++ b/assets/extending.html-wJrHlIH8.js @@ -0,0 +1,65 @@ +import{_ as t}from"./extending-a-theme-01-xmIu-MPG.js";import{_ as c,r as a,o as r,c as i,a as n,b as s,d as e,w as D,e as l}from"./app-eU2v8o1B.js";const d={},y=l(`import type { Theme } from '@vuepress/core' +import { defaultTheme, type DefaultThemeOptions } from '@vuepress/theme-default' +import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export const childTheme = (options: DefaultThemeOptions): Theme => { + return { + name: 'vuepress-theme-child', + extends: defaultTheme(options), + + // 在子主题的客户端配置文件中覆盖布局 + // 注意,你在发布到 NPM 之前会将 TS 构建为 JS ,因此这里需要设置为 JS 文件的路径 + clientConfigFile: path.resolve(__dirname, './client.js'), + + // 覆盖组件别名 + alias: { + '@theme/HomeFooter.vue': path.resolve( + __dirname, + './components/MyHomeFooter.vue', + ), + }, + } +} +
# Extending
VuePress default theme is widely used by users, so it is designed to be extendable, allowing users to make their own customization with ease.
VuePress provides basic ability to extend a theme, but different themes may have different features to be extended. Thus, if you are using a community theme, you'd better refer to the theme's own documentation for how to extending it.
# Layout Slots
Default theme's
Layout
provides some slots:
navbar
navbar-before
navbar-after
sidebar
sidebar-top
sidebar-bottom
page
page-top
page-bottom
page-content-top
page-content-bottom
With the help of them, you can add or replace content easily. Here comes an example to introduce how to extend default theme with layout slots.
Firstly, create a client config file
.vuepress/client.ts
:import { defineClientConfig } from '@vuepress/client' +import Layout from './layouts/Layout.vue' + +export default defineClientConfig({ + layouts: { + Layout, + }, +}) +
Next, create the
.vuepress/layouts/Layout.vue
, and make use of the slots that provided by theLayout
of default theme:<script setup> +import ParentLayout from '@vuepress/theme-default/layouts/Layout.vue' +</script> + +<template> + <ParentLayout> + <template #page-bottom> + <div class="my-footer">This is my custom page footer</div> + </template> + </ParentLayout> +</template> + +<style lang="css"> +.my-footer { + text-align: center; +} +</style> +
Then the default
Layout
layout has been overridden by your own local layout, which will add a custom footer to every normal pages in default theme (excluding homepage):# Components Replacement
The layout slots are useful, but sometimes you might find it's not flexible enough. Default theme also provides the ability to replace a single component.
',15),u={href:"https://github.com/vuepress/ecosystem/tree/main/themes/theme-default/src/client/components",target:"_blank",rel:"noopener noreferrer"},m=n("code",null,"@theme",-1),v=n("code",null,"HomeFooter.vue",-1),C=n("code",null,"@theme/HomeFooter.vue",-1),h=l(`Then, if you want to replace the
HomeFooter.vue
component, just override the alias in your config file.vuepress/config.ts
:import { getDirname, path } from '@vuepress/utils' +import { defaultTheme, defineUserConfig } from 'vuepress' + +const __dirname = getDirname(import.meta.url) + +export default defineUserConfig({ + theme: defaultTheme(), + alias: { + '@theme/HomeFooter.vue': path.resolve( + __dirname, + './components/MyHomeFooter.vue', + ), + }, +}) +
# Developing a Child Theme
Instead of extending the default theme directly in
.vuepress/config.ts
and.vuepress/client.ts
, you can also develop your own theme extending the default theme:`,5);function b(f,g){const o=a("RouterLink"),p=a("ExternalLinkIcon");return r(),i("div",null,[y,n("p",null,[s("Default theme has registered "),e(o,{to:"/reference/plugin-api.html#alias"},{default:D(()=>[s("alias")]),_:1}),s(" for every "),n("a",u,[s("non-global components"),e(p)]),s(" with a "),m,s(" prefix. For example, the alias of "),v,s(" is "),C,s(".")]),h])}const x=c(d,[["render",b],["__file","extending.html.vue"]]);export{x as default}; diff --git a/assets/external-link-icon.html-DFH8UsDb.js b/assets/external-link-icon.html-DFH8UsDb.js new file mode 100644 index 000000000..f727d2729 --- /dev/null +++ b/assets/external-link-icon.html-DFH8UsDb.js @@ -0,0 +1,28 @@ +import{_ as c,r as a,o as r,c as t,d as l,a as s,b as n,w as d,e}from"./app-eU2v8o1B.js";const D={},u=s("h1",{id:"external-link-icon",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#external-link-icon","aria-hidden":"true"},"#"),n(" external-link-icon")],-1),y=e(`import type { Theme } from '@vuepress/core' +import { defaultTheme, type DefaultThemeOptions } from '@vuepress/theme-default' +import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export const childTheme = (options: DefaultThemeOptions): Theme => { + return { + name: 'vuepress-theme-child', + extends: defaultTheme(options), + + // override layouts in child theme's client config file + // notice that you would build ts to js before publishing to npm, + // so this should be the path to the js file + clientConfigFile: path.resolve(__dirname, './client.js'), + + // override component alias + alias: { + '@theme/HomeFooter.vue': path.resolve( + __dirname, + './components/MyHomeFooter.vue', + ), + }, + } +} +
该插件已经集成到默认主题中。
# 使用方法
npm i -D @vuepress/plugin-external-link-icon@next +
import { externalLinkIconPlugin } from '@vuepress/plugin-external-link-icon' + +export default { + plugins: [ + externalLinkIconPlugin({ + // 配置项 + }), + ], +} +
# 配置项
# locales
类型:
Record<string, { openInNewWindow: string }>
详情:
外部链接图标在不同 locales 下的 A11y 文字。
如果没有指定该配置项,它会降级使用默认文字。
示例:
`,8),v=e(`export default { + plugins: [ + externalLinkIconPlugin({ + locales: { + '/': { + openInNewWindow: 'open in new window', + }, + '/zh/': { + openInNewWindow: '在新窗口打开', + }, + }, + }), + ], +} +
# Frontmatter
# externalLinkIcon
类型:
boolean
详情:
是否在当前页面的外部链接的后面添加外部链接图标。
# 样式
你可以通过 CSS 变量来自定义外部链接图标的样式:
:root { + --external-link-icon-color: #aaa; +} +
# 组件
# ExternalLinkIcon
详情:
该插件会全局注册一个
<ExternalLinkIcon />
组件,你可以不传入任何 Props 来使用它。`,10);function h(m,b){const p=a("NpmBadge"),i=a("ExternalLinkIcon"),o=a("RouterLink");return r(),t("div",null,[u,l(p,{package:"@vuepress/plugin-external-link-icon"}),s("p",null,[n("该插件会为你 Markdown 内容中的外部链接添加一个图标,即 "),l(i)]),y,s("ul",null,[s("li",null,[n("参考: "),s("ul",null,[s("li",null,[l(o,{to:"/zh/guide/i18n.html"},{default:d(()=>[n("指南 > 多语言支持")]),_:1})])])])]),v])}const x=c(D,[["render",h],["__file","external-link-icon.html.vue"]]);export{x as default}; diff --git a/assets/external-link-icon.html-Jypp8WEn.js b/assets/external-link-icon.html-Jypp8WEn.js new file mode 100644 index 000000000..f33103710 --- /dev/null +++ b/assets/external-link-icon.html-Jypp8WEn.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5c864690","path":"/reference/plugin/external-link-icon.html","title":"external-link-icon","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"Frontmatter","slug":"frontmatter","link":"#frontmatter","children":[{"level":3,"title":"externalLinkIcon","slug":"externallinkicon","link":"#externallinkicon","children":[]}]},{"level":2,"title":"Styles","slug":"styles","link":"#styles","children":[]},{"level":2,"title":"Components","slug":"components","link":"#components","children":[{"level":3,"title":"ExternalLinkIcon","slug":"externallinkicon-1","link":"#externallinkicon-1","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/external-link-icon.md"}');export{e as data}; diff --git a/assets/external-link-icon.html-hXXWH4Bv.js b/assets/external-link-icon.html-hXXWH4Bv.js new file mode 100644 index 000000000..a3b3f05a0 --- /dev/null +++ b/assets/external-link-icon.html-hXXWH4Bv.js @@ -0,0 +1,28 @@ +import{_ as t,r as a,o as c,c as r,d as e,a as n,b as s,w as d,e as l}from"./app-eU2v8o1B.js";const D={},u=n("h1",{id:"external-link-icon",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#external-link-icon","aria-hidden":"true"},"#"),s(" external-link-icon")],-1),y=l(`提示
该组件主要用于主题开发。在大多数情况下你不需要直接使用该组件。
This plugin has been integrated into the default theme.
# Usage
npm i -D @vuepress/plugin-external-link-icon@next +
import { externalLinkIconPlugin } from '@vuepress/plugin-external-link-icon' + +export default { + plugins: [ + externalLinkIconPlugin({ + // options + }), + ], +} +
# Options
# locales
Type:
Record<string, { openInNewWindow: string }>
Details:
The a11y text of the external link icon in different locales.
If this option is not specified, it will fallback to default text.
Example:
`,8),h=l(`export default { + plugins: [ + externalLinkIconPlugin({ + locales: { + '/': { + openInNewWindow: 'open in new window', + }, + '/zh/': { + openInNewWindow: '在新窗口打开', + }, + }, + }), + ], +} +
# Frontmatter
# externalLinkIcon
Type:
boolean
Details:
Whether to append an external link icon to external links in current page.
# Styles
You can customize the style of the external link icon via CSS variables:
:root { + --external-link-icon-color: #aaa; +} +
# Components
# ExternalLinkIcon
Details:
This plugin will register a
<ExternalLinkIcon />
component globally, and you can use it without any props.`,10);function v(m,b){const i=a("NpmBadge"),o=a("ExternalLinkIcon"),p=a("RouterLink");return c(),r("div",null,[u,e(i,{package:"@vuepress/plugin-external-link-icon"}),n("p",null,[s("This plugin will add an icon to the external link in your markdown content, i.e. "),e(o)]),y,n("ul",null,[n("li",null,[s("Also see: "),n("ul",null,[n("li",null,[e(p,{to:"/guide/i18n.html"},{default:d(()=>[s("Guide > I18n")]),_:1})])])])]),h])}const C=t(D,[["render",v],["__file","external-link-icon.html.vue"]]);export{C as default}; diff --git a/assets/external-link-icon.html-xe1iQbC8.js b/assets/external-link-icon.html-xe1iQbC8.js new file mode 100644 index 000000000..bf42e7ccc --- /dev/null +++ b/assets/external-link-icon.html-xe1iQbC8.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-7cc40dbf","path":"/zh/reference/plugin/external-link-icon.html","title":"external-link-icon","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"Frontmatter","slug":"frontmatter","link":"#frontmatter","children":[{"level":3,"title":"externalLinkIcon","slug":"externallinkicon","link":"#externallinkicon","children":[]}]},{"level":2,"title":"样式","slug":"样式","link":"#样式","children":[]},{"level":2,"title":"组件","slug":"组件","link":"#组件","children":[{"level":3,"title":"ExternalLinkIcon","slug":"externallinkicon-1","link":"#externallinkicon-1","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/external-link-icon.md"}');export{e as data}; diff --git a/assets/frontmatter.html-0HrMHRj6.js b/assets/frontmatter.html-0HrMHRj6.js new file mode 100644 index 000000000..16a56df64 --- /dev/null +++ b/assets/frontmatter.html-0HrMHRj6.js @@ -0,0 +1,30 @@ +import{_ as r,r as t,o as d,c,d as n,a as e,b as l,w as a,e as o}from"./app-eU2v8o1B.js";const u={},h=e("h1",{id:"frontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),l(" Frontmatter")],-1),y=e("h2",{id:"date",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#date","aria-hidden":"true"},"#"),l(" date")],-1),D=e("li",null,[e("p",null,[l("Type: "),e("code",null,"string")])],-1),m=e("p",null,"Details:",-1),f=e("p",null,"Created date for the page.",-1),g=e("code",null,"yyyy-MM-dd",-1),v={href:"https://yaml.org/type/timestamp.html",target:"_blank",rel:"noopener noreferrer"},_=e("p",null,"Also see:",-1),b=e("h2",{id:"description",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#description","aria-hidden":"true"},"#"),l(" description")],-1),C=e("li",null,[e("p",null,[l("Type: "),e("code",null,"string")])],-1),k=e("li",null,[e("p",null,"Details:"),e("p",null,"Description for the page."),e("p",null,[l("This will override the "),e("code",null,"description"),l(" option in your site config.")])],-1),E=e("p",null,"Also see:",-1),x=o(`TIP
This component is mainly used for theme development. You don't need to use it directly in most cases.
# head
Type:
HeadConfig[]
Details:
Extra tags in
<head>
tag for the page.Example:
--- +head: + - - meta + - name: foo + content: yaml array syntax + - [meta, { name: bar, content: square brackets syntax }] +--- +
Rendered as:
`,5),P=e("h2",{id:"lang",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#lang","aria-hidden":"true"},"#"),l(" lang")],-1),T=e("li",null,[e("p",null,[l("Type: "),e("code",null,"string")])],-1),w=e("li",null,[e("p",null,"Details:"),e("p",null,"Language for the page."),e("p",null,[l("This will override the "),e("code",null,"lang"),l(" option in your site config.")])],-1),A=e("p",null,"Also see:",-1),M=o(`<head> + <meta name="foo" content="yaml array syntax" /> + <meta name="bar" content="square brackets syntax" /> +</head> +
# layout
Type:
string
Details:
Layout for the page.
Layouts are provided by theme. If you don't specify this frontmatter, the default layout will be used. You should refer to the theme's own documentation to find what layouts it provides.
If the theme layouts cannot meet your needs, you can use a custom layout component.
Example:
Register a layout component in
.vuepress/client.ts
file:import { defineClientConfig } from '@vuepress/client' +import CustomLayout from './CustomLayout.vue' + +export default defineClientConfig({ + layouts: { + CustomLayout, + }, +}) +
Set custom layout in frontmatter:
--- +layout: CustomLayout +--- +
# permalink
`,7),F=e("li",null,[e("p",null,[l("Type: "),e("code",null,"string")])],-1),L=e("li",null,[e("p",null,"Details:"),e("p",null,"Permalink for the page."),e("p",null,"This will override the default route path that determined by the file path of the page.")],-1),N=e("p",null,"Also see:",-1),I=e("li",null,[e("a",{href:"#permalinkpattern"},"Frontmatter > permalinkPattern")],-1),q=o(`# permalinkPattern
Type:
string | null
Details:
Pattern to generate permalink for the page.
This will override the
permalinkPattern
option in your site config.This won't take effect if the
permalink
frontmatter has been set.Usage:
Pattern Description :year
Year part of created date :month
Month part of created date :day
Day part of created date :slug
Slug of page filename :raw
Raw route path The
:year
,:month
and:day
patterns are resolved according to the following priority:
- The
date
frontmatter.- The filename that matches the date pattern
yyyy-MM-dd-foobar.md
oryyyy-MM-foobar.md
.- The dirname that matches the date pattern
yyyy/MM/dd/foobar.md
oryyyy/MM/foobar.md
.- Fallback to
0000-00-00
.Example 1:
The page filename is
foo-bar.md
.The page frontmatter is:
--- +date: 2021-01-03 +permalinkPattern: :year/:month/:day/:slug.html +--- +
Then the permalink of the page would be
2021/01/03/foo-bar.html
.
Example 2:
The page filename is
2021-01-03-bar-baz.md
.The page frontmatter is:
--- +permalinkPattern: :year/:month/:day/:slug.html +--- +
Then the permalink of the page would be
`,7),R=e("li",null,[e("a",{href:"#date"},"Frontmatter > date")],-1),B=e("li",null,[e("a",{href:"#permalink"},"Frontmatter > permalink")],-1),V=e("h2",{id:"routemeta",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#routemeta","aria-hidden":"true"},"#"),l(" routeMeta")],-1),Y=e("li",null,[e("p",null,[l("Type: "),e("code",null,"Record2021/01/03/bar-baz.html
.")])],-1),S=e("li",null,[e("p",null,"Details:"),e("p",null,"Custom data to be attached to the page route.")],-1),z=e("p",null,"Also see:",-1),G=e("h2",{id:"title",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#title","aria-hidden":"true"},"#"),l(" title")],-1),H=e("li",null,[e("p",null,[l("Type: "),e("code",null,"string")])],-1),U=e("li",null,[e("p",null,"Details:"),e("p",null,"Title for the page."),e("p",null,[l("If you don't specify "),e("code",null,"title"),l(" in frontmatter, content of the first level-one header (i.e. "),e("code",null,"# title"),l(") will be used as the title.")])],-1),j=e("p",null,"Also see:",-1);function J(K,O){const i=t("NpmBadge"),p=t("ExternalLinkIcon"),s=t("RouterLink");return d(),c("div",null,[h,n(i,{package:"@vuepress/client"}),n(i,{package:"@vuepress/markdown"}),y,e("ul",null,[D,e("li",null,[m,f,e("p",null,[l("You should specify the date in the form of "),g,l(", or follow the "),e("a",v,[l("YAML Timestamp Type"),n(p)]),l(".")])]),e("li",null,[_,e("ul",null,[e("li",null,[n(s,{to:"/reference/node-api.html#date"},{default:a(()=>[l("Node API > Page Properties > date")]),_:1})])])])]),b,e("ul",null,[C,k,e("li",null,[E,e("ul",null,[e("li",null,[n(s,{to:"/reference/config.html#description"},{default:a(()=>[l("Config > description")]),_:1})])])])]),x,e("ul",null,[e("li",null,[l("Also see: "),e("ul",null,[e("li",null,[n(s,{to:"/reference/config.html#head"},{default:a(()=>[l("Config > head")]),_:1})])])])]),P,e("ul",null,[T,w,e("li",null,[A,e("ul",null,[e("li",null,[n(s,{to:"/reference/config.html#lang"},{default:a(()=>[l("Config > lang")]),_:1})]),e("li",null,[n(s,{to:"/reference/node-api.html#lang"},{default:a(()=>[l("Node API > Page Properties > lang")]),_:1})])])])]),M,e("ul",null,[F,L,e("li",null,[N,e("ul",null,[I,e("li",null,[n(s,{to:"/guide/page.html#routing"},{default:a(()=>[l("Guide > Page > Routing")]),_:1})]),e("li",null,[n(s,{to:"/reference/node-api.html#permalink"},{default:a(()=>[l("Node API > Page Properties > permalink")]),_:1})])])])]),q,e("ul",null,[e("li",null,[l("Also see: "),e("ul",null,[e("li",null,[n(s,{to:"/reference/config.html#permalinkpattern"},{default:a(()=>[l("Config > permalinkPattern")]),_:1})]),R,B,e("li",null,[n(s,{to:"/reference/node-api.html#permalink"},{default:a(()=>[l("Node API > Page Properties > permalink")]),_:1})])])])]),V,e("ul",null,[Y,S,e("li",null,[z,e("ul",null,[e("li",null,[n(s,{to:"/reference/node-api.html#routeMeta"},{default:a(()=>[l("Node API > Page Properties > routeMeta")]),_:1})])])])]),G,e("ul",null,[H,U,e("li",null,[j,e("ul",null,[e("li",null,[n(s,{to:"/reference/node-api.html#title"},{default:a(()=>[l("Node API > Page Properties > title")]),_:1})])])])])])}const W=r(u,[["render",J],["__file","frontmatter.html.vue"]]);export{W as default}; diff --git a/assets/frontmatter.html-3hYnultF.js b/assets/frontmatter.html-3hYnultF.js new file mode 100644 index 000000000..aa9230484 --- /dev/null +++ b/assets/frontmatter.html-3hYnultF.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-a566dc26","path":"/zh/reference/default-theme/frontmatter.html","title":"Frontmatter","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"所有页面","slug":"所有页面","link":"#所有页面","children":[{"level":3,"title":"externalLinkIcon","slug":"externallinkicon","link":"#externallinkicon","children":[]},{"level":3,"title":"navbar","slug":"navbar","link":"#navbar","children":[]},{"level":3,"title":"pageClass","slug":"pageclass","link":"#pageclass","children":[]}]},{"level":2,"title":"首页","slug":"首页","link":"#首页","children":[{"level":3,"title":"home","slug":"home","link":"#home","children":[]},{"level":3,"title":"heroImage","slug":"heroimage","link":"#heroimage","children":[]},{"level":3,"title":"heroImageDark","slug":"heroimagedark","link":"#heroimagedark","children":[]},{"level":3,"title":"heroAlt","slug":"heroalt","link":"#heroalt","children":[]},{"level":3,"title":"heroHeight","slug":"heroheight","link":"#heroheight","children":[]},{"level":3,"title":"heroText","slug":"herotext","link":"#herotext","children":[]},{"level":3,"title":"tagline","slug":"tagline","link":"#tagline","children":[]},{"level":3,"title":"actions","slug":"actions","link":"#actions","children":[]},{"level":3,"title":"features","slug":"features","link":"#features","children":[]},{"level":3,"title":"footer","slug":"footer","link":"#footer","children":[]},{"level":3,"title":"footerHtml","slug":"footerhtml","link":"#footerhtml","children":[]}]},{"level":2,"title":"普通页面","slug":"普通页面","link":"#普通页面","children":[{"level":3,"title":"editLink","slug":"editlink","link":"#editlink","children":[]},{"level":3,"title":"editLinkPattern","slug":"editlinkpattern","link":"#editlinkpattern","children":[]},{"level":3,"title":"lastUpdated","slug":"lastupdated","link":"#lastupdated","children":[]},{"level":3,"title":"contributors","slug":"contributors","link":"#contributors","children":[]},{"level":3,"title":"sidebar","slug":"sidebar","link":"#sidebar","children":[]},{"level":3,"title":"sidebarDepth","slug":"sidebardepth","link":"#sidebardepth","children":[]},{"level":3,"title":"prev","slug":"prev","link":"#prev","children":[]},{"level":3,"title":"next","slug":"next","link":"#next","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/default-theme/frontmatter.md"}');export{e as data}; diff --git a/assets/frontmatter.html-9z0BtxYw.js b/assets/frontmatter.html-9z0BtxYw.js new file mode 100644 index 000000000..e3a0eb03b --- /dev/null +++ b/assets/frontmatter.html-9z0BtxYw.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-e5e26a84","path":"/reference/default-theme/frontmatter.html","title":"Frontmatter","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"All Pages","slug":"all-pages","link":"#all-pages","children":[{"level":3,"title":"externalLinkIcon","slug":"externallinkicon","link":"#externallinkicon","children":[]},{"level":3,"title":"navbar","slug":"navbar","link":"#navbar","children":[]},{"level":3,"title":"pageClass","slug":"pageclass","link":"#pageclass","children":[]}]},{"level":2,"title":"Home Page","slug":"home-page","link":"#home-page","children":[{"level":3,"title":"home","slug":"home","link":"#home","children":[]},{"level":3,"title":"heroImage","slug":"heroimage","link":"#heroimage","children":[]},{"level":3,"title":"heroImageDark","slug":"heroimagedark","link":"#heroimagedark","children":[]},{"level":3,"title":"heroAlt","slug":"heroalt","link":"#heroalt","children":[]},{"level":3,"title":"heroHeight","slug":"heroheight","link":"#heroheight","children":[]},{"level":3,"title":"heroText","slug":"herotext","link":"#herotext","children":[]},{"level":3,"title":"tagline","slug":"tagline","link":"#tagline","children":[]},{"level":3,"title":"actions","slug":"actions","link":"#actions","children":[]},{"level":3,"title":"features","slug":"features","link":"#features","children":[]},{"level":3,"title":"footer","slug":"footer","link":"#footer","children":[]},{"level":3,"title":"footerHtml","slug":"footerhtml","link":"#footerhtml","children":[]}]},{"level":2,"title":"Normal Page","slug":"normal-page","link":"#normal-page","children":[{"level":3,"title":"editLink","slug":"editlink","link":"#editlink","children":[]},{"level":3,"title":"editLinkPattern","slug":"editlinkpattern","link":"#editlinkpattern","children":[]},{"level":3,"title":"lastUpdated","slug":"lastupdated","link":"#lastupdated","children":[]},{"level":3,"title":"contributors","slug":"contributors","link":"#contributors","children":[]},{"level":3,"title":"sidebar","slug":"sidebar","link":"#sidebar","children":[]},{"level":3,"title":"sidebarDepth","slug":"sidebardepth","link":"#sidebardepth","children":[]},{"level":3,"title":"prev","slug":"prev","link":"#prev","children":[]},{"level":3,"title":"next","slug":"next","link":"#next","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/default-theme/frontmatter.md"}');export{e as data}; diff --git a/assets/frontmatter.html-IJ5-jzXZ.js b/assets/frontmatter.html-IJ5-jzXZ.js new file mode 100644 index 000000000..84ad15b7a --- /dev/null +++ b/assets/frontmatter.html-IJ5-jzXZ.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-d147334a","path":"/zh/reference/frontmatter.html","title":"Frontmatter","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"date","slug":"date","link":"#date","children":[]},{"level":2,"title":"description","slug":"description","link":"#description","children":[]},{"level":2,"title":"head","slug":"head","link":"#head","children":[]},{"level":2,"title":"lang","slug":"lang","link":"#lang","children":[]},{"level":2,"title":"layout","slug":"layout","link":"#layout","children":[]},{"level":2,"title":"permalink","slug":"permalink","link":"#permalink","children":[]},{"level":2,"title":"permalinkPattern","slug":"permalinkpattern","link":"#permalinkpattern","children":[]},{"level":2,"title":"routeMeta","slug":"routemeta","link":"#routemeta","children":[]},{"level":2,"title":"title","slug":"title","link":"#title","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/frontmatter.md"}');export{e as data}; diff --git a/assets/frontmatter.html-T5c6-cfU.js b/assets/frontmatter.html-T5c6-cfU.js new file mode 100644 index 000000000..86af4c31a --- /dev/null +++ b/assets/frontmatter.html-T5c6-cfU.js @@ -0,0 +1,60 @@ +import{_ as r,r as t,o as d,c,d as s,a as e,b as l,w as a,e as i}from"./app-eU2v8o1B.js";const u={},h=e("h1",{id:"frontmatter",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),l(" Frontmatter")],-1),D=e("h2",{id:"all-pages",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#all-pages","aria-hidden":"true"},"#"),l(" All Pages")],-1),m=e("p",null,"Frontmatter in this section will take effect in all types of pages.",-1),y=e("h3",{id:"externallinkicon",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#externallinkicon","aria-hidden":"true"},"#"),l(" externalLinkIcon")],-1),f=e("li",null,[e("p",null,[l("Type: "),e("code",null,"boolean")])],-1),v=e("p",null,"Details:",-1),b=e("p",null,"Also see:",-1),g=e("h3",{id:"navbar",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#navbar","aria-hidden":"true"},"#"),l(" navbar")],-1),_=e("li",null,[e("p",null,[l("Type: "),e("code",null,"boolean")])],-1),k=e("li",null,[e("p",null,"Details:"),e("p",null,"Show navbar on this page or not."),e("p",null,"If you disable navbar in theme config, this frontmatter will not take effect.")],-1),C=e("p",null,"Also see:",-1),x=i(` # pageClass
Type:
string
Details:
Add extra class name to this page.
Example:
--- +pageClass: custom-page-class +--- +
Then you can customize styles of this page in
.vuepress/styles/index.scss
file:`,5),E=i(`.theme-container.custom-page-class { + /* page styles */ +} +
# Home Page
Frontmatter in this section will only take effect in home pages.
# home
Type:
boolean
Details:
Specify whether the page is homepage or a normal page.
If you don't set this frontmatter or set it to
false
, the page would be a normal page.Example:
--- +home: true +--- +
# heroImage
Type:
string
Details:
Specify the url of the hero image.
Example:
`,8),T=e("h3",{id:"heroimagedark",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#heroimagedark","aria-hidden":"true"},"#"),l(" heroImageDark")],-1),A=e("li",null,[e("p",null,[l("Type: "),e("code",null,"string")])],-1),w=e("li",null,[e("p",null,"Details:"),e("p",null,"Specify the url of hero image to be used in dark mode."),e("p",null,"You can make use of this option if you want to use different heroImage config in dark mode.")],-1),S=e("p",null,"Also see:",-1),L=e("li",null,[e("a",{href:"#heroimage"},"Default Theme > Frontmatter > heroImage")],-1),I=i('--- +# public file path +heroImage: /images/hero.png +# url +heroImage: https://vuejs.org/images/logo.png +--- +
# heroAlt
Type:
string
Details:
Specify the
alt
attribute of the hero image.This will fallback to the heroText.
# heroHeight
',3),N=e("li",null,[e("p",null,[l("Type: "),e("code",null,"number")])],-1),F=e("li",null,[e("p",null,[l("Default: "),e("code",null,"280")])],-1),P=e("p",null,"Details:",-1),B=e("p",null,[l("Specify the "),e("code",null,"height"),l(" attribute of the hero "),e("code",null,""),l(" tag.")],-1),V=e("p",null,"You may need to reduce this value if the height of your hero image is less than the default value.",-1),j={href:"https://web.dev/cls/",target:"_blank",rel:"noopener noreferrer"},H=e("h3",{id:"herotext",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#herotext","aria-hidden":"true"},"#"),l(" heroText")],-1),M=e("li",null,[e("p",null,[l("Type: "),e("code",null,"string | null")])],-1),G=e("p",null,"Details:",-1),R=e("p",null,"Specify the the hero text.",-1),U=e("p",null,[l("Set to "),e("code",null,"null"),l(" to disable hero text.")],-1),Y=e("h3",{id:"tagline",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#tagline","aria-hidden":"true"},"#"),l(" tagline")],-1),z=e("li",null,[e("p",null,[l("Type: "),e("code",null,"string | null")])],-1),O=e("p",null,"Details:",-1),q=e("p",null,"Specify the the tagline.",-1),J=e("p",null,[l("Set to "),e("code",null,"null"),l(" to disable tagline.")],-1),K=i(`# actions
- Type:
Array<{ + text: string + link: string + type?: 'primary' | 'secondary' +}> +
Details:
Configuration of the action buttons.
Example:
--- +actions: + - text: Get Started + link: /guide/getting-started.html + type: primary + - text: Introduction + link: /guide/ + type: secondary +--- +
# features
- Type:
Array<{ + title: string + details: string +}> +
Details:
Configuration of the features list.
Example:
--- +features: + - title: Simplicity First + details: Minimal setup with markdown-centered project structure helps you focus on writing. + - title: Vue-Powered + details: Enjoy the dev experience of Vue, use Vue components in markdown, and develop custom themes with Vue. + - title: Performant + details: VuePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded. +--- +
# footer
Type:
string
Details:
Specify the content of the footer.
# footerHtml
Type:
boolean
Details:
Allow HTML in footer or not.
If you set it to
true
, the footer will be treated as HTML code.# Normal Page
Frontmatter in this section will only take effect in normal pages.
# editLink
`,17),Q=e("li",null,[e("p",null,[l("Type: "),e("code",null,"boolean")])],-1),W=e("li",null,[e("p",null,"Details:"),e("p",null,[l("Enable the "),e("em",null,"edit this page"),l(" link in this page or not.")])],-1),X=e("p",null,"Also see:",-1),Z=e("h3",{id:"editlinkpattern",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#editlinkpattern","aria-hidden":"true"},"#"),l(" editLinkPattern")],-1),$=e("li",null,[e("p",null,[l("Type: "),e("code",null,"string")])],-1),ee=e("li",null,[e("p",null,"Details:"),e("p",null,[l("Specify the pattern of the "),e("em",null,"edit this page"),l(" link of this page.")])],-1),le=e("p",null,"Also see:",-1),se=e("h3",{id:"lastupdated",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#lastupdated","aria-hidden":"true"},"#"),l(" lastUpdated")],-1),ne=e("li",null,[e("p",null,[l("Type: "),e("code",null,"boolean")])],-1),ae=e("li",null,[e("p",null,"Details:"),e("p",null,[l("Enable the "),e("em",null,"last updated timestamp"),l(" in this page or not.")])],-1),ie=e("p",null,"Also see:",-1),te=e("h3",{id:"contributors",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#contributors","aria-hidden":"true"},"#"),l(" contributors")],-1),oe=e("li",null,[e("p",null,[l("Type: "),e("code",null,"boolean")])],-1),pe=e("li",null,[e("p",null,"Details:"),e("p",null,[l("Enable the "),e("em",null,"contributors list"),l(" in this page or not.")])],-1),re=e("p",null,"Also see:",-1),de=e("h3",{id:"sidebar",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#sidebar","aria-hidden":"true"},"#"),l(" sidebar")],-1),ce=e("li",null,[e("p",null,[l("Type: "),e("code",null,"false | 'auto' | SidebarConfigArray | SidebarConfigObject")])],-1),ue=e("li",null,[e("p",null,"Details:"),e("p",null,"Configure the sidebar of this page.")],-1),he=e("p",null,"Also see:",-1),De=e("h3",{id:"sidebardepth",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#sidebardepth","aria-hidden":"true"},"#"),l(" sidebarDepth")],-1),me=e("li",null,[e("p",null,[l("Type: "),e("code",null,"number")])],-1),ye=e("li",null,[e("p",null,"Details:"),e("p",null,"Configure the sidebar depth of this page.")],-1),fe=e("p",null,"Also see:",-1),ve=i(`# prev
Type:
NavLink | string
Details:
Specify the link of the previous page.
If you don't set this frontmatter, the link will be inferred from the sidebar config.
To configure the prev link manually, you can set this frontmatter to a
NavLink
object or a string:
- A
NavLink
object should have atext
field and alink
field.- A string should be the path to the target page file. It will be converted to a
NavLink
object, whosetext
is the page title, andlink
is the page route path.Example:
--- +# NavLink +prev: + text: Get Started + link: /guide/getting-started.html + +# NavLink - external url +prev: + text: GitHub + link: https://github.com + +# string - page file path +prev: /guide/getting-started.md + +# string - page file relative path +prev: ../../guide/getting-started.md +--- +
# next
`,5);function be(ge,_e){const o=t("NpmBadge"),n=t("RouterLink"),p=t("ExternalLinkIcon");return d(),c("div",null,[h,s(o,{package:"@vuepress/theme-default"}),D,m,y,e("ul",null,[f,e("li",null,[v,e("p",null,[l("Provided by "),s(n,{to:"/reference/plugin/external-link-icon.html#externallinkicon"},{default:a(()=>[l("@vuepress/plugin-external-link-icon")]),_:1}),l(".")])]),e("li",null,[b,e("ul",null,[e("li",null,[s(n,{to:"/reference/default-theme/config.html#themeplugins-externallinkicon"},{default:a(()=>[l("Default Theme > Config Reference > themePlugins.externalLinkIcon")]),_:1})])])])]),g,e("ul",null,[_,k,e("li",null,[C,e("ul",null,[e("li",null,[s(n,{to:"/reference/default-theme/config.html#navbar"},{default:a(()=>[l("Default Theme > Config > navbar")]),_:1})])])])]),x,e("ul",null,[e("li",null,[l("Also see: "),e("ul",null,[e("li",null,[s(n,{to:"/reference/default-theme/styles.html#style-file"},{default:a(()=>[l("Default Theme > Styles > Style File")]),_:1})])])])]),E,e("ul",null,[e("li",null,[l("Also see: "),e("ul",null,[e("li",null,[s(n,{to:"/guide/assets.html#public-files"},{default:a(()=>[l("Guide > Assets > Public Files")]),_:1})])])])]),T,e("ul",null,[A,w,e("li",null,[S,e("ul",null,[L,e("li",null,[s(n,{to:"/reference/default-theme/config.html#colormode"},{default:a(()=>[l("Default Theme > Config > colorMode")]),_:1})])])])]),I,e("ul",null,[N,F,e("li",null,[P,B,V,e("p",null,[l("Notice that the height is also constrained by CSS. This attribute is to reduce "),e("a",j,[l("Cumulative Layout Shift (CLS)"),s(p)]),l(" that caused by the loading of the hero image.")])])]),H,e("ul",null,[M,e("li",null,[G,R,e("p",null,[l("This will fallback to the site "),s(n,{to:"/reference/config.html#title"},{default:a(()=>[l("title")]),_:1}),l(".")]),U])]),Y,e("ul",null,[z,e("li",null,[O,q,e("p",null,[l("This will fallback to the site "),s(n,{to:"/reference/config.html#description"},{default:a(()=>[l("description")]),_:1}),l(".")]),J])]),K,e("ul",null,[Q,W,e("li",null,[X,e("ul",null,[e("li",null,[s(n,{to:"/reference/default-theme/config.html#editlink"},{default:a(()=>[l("Default Theme > Config > editLink")]),_:1})])])])]),Z,e("ul",null,[$,ee,e("li",null,[le,e("ul",null,[e("li",null,[s(n,{to:"/reference/default-theme/config.html#editlinkpattern"},{default:a(()=>[l("Default Theme > Config > editLinkPattern")]),_:1})])])])]),se,e("ul",null,[ne,ae,e("li",null,[ie,e("ul",null,[e("li",null,[s(n,{to:"/reference/default-theme/config.html#lastupdated"},{default:a(()=>[l("Default Theme > Config > lastUpdated")]),_:1})])])])]),te,e("ul",null,[oe,pe,e("li",null,[re,e("ul",null,[e("li",null,[s(n,{to:"/reference/default-theme/config.html#contributors"},{default:a(()=>[l("Default Theme > Config > contributors")]),_:1})])])])]),de,e("ul",null,[ce,ue,e("li",null,[he,e("ul",null,[e("li",null,[s(n,{to:"/reference/default-theme/config.html#sidebar"},{default:a(()=>[l("Default Theme > Config > sidebar")]),_:1})])])])]),De,e("ul",null,[me,ye,e("li",null,[fe,e("ul",null,[e("li",null,[s(n,{to:"/reference/default-theme/config.html#sidebardepth"},{default:a(()=>[l("Default Theme > Config > sidebarDepth")]),_:1})])])])]),ve])}const Ce=r(u,[["render",be],["__file","frontmatter.html.vue"]]);export{Ce as default}; diff --git a/assets/frontmatter.html-UUIM54bd.js b/assets/frontmatter.html-UUIM54bd.js new file mode 100644 index 000000000..de5e73b98 --- /dev/null +++ b/assets/frontmatter.html-UUIM54bd.js @@ -0,0 +1,30 @@ +import{_ as i,r as o,o as d,c,d as s,a as l,b as n,w as a,e as t}from"./app-eU2v8o1B.js";const u={},D=l("h1",{id:"frontmatter",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),n(" Frontmatter")],-1),h=l("h2",{id:"date",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#date","aria-hidden":"true"},"#"),n(" date")],-1),m=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string")])],-1),y=l("p",null,"详情:",-1),_=l("p",null,"页面的创建日期。",-1),v=l("code",null,"yyyy-MM-dd",-1),b={href:"https://yaml.org/type/timestamp.html",target:"_blank",rel:"noopener noreferrer"},C=l("p",null,"参考:",-1),f=l("h2",{id:"description",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#description","aria-hidden":"true"},"#"),n(" description")],-1),g=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string")])],-1),k=l("li",null,[l("p",null,"详情:"),l("p",null,"页面的描述。"),l("p",null,[n("它将会覆盖站点配置中的 "),l("code",null,"description"),n(" 配置项。")])],-1),E=l("p",null,"参考:",-1),x=t(`
Type:
NavLink | string
Details:
Specify the link of the next page.
If you don't set this frontmatter, the link will be inferred from the sidebar config.
The type is the same as prev frontmatter.
# head
类型:
HeadConfig[]
详情:
页面
<head>
标签内添加的额外标签。示例:
--- +head: + - - meta + - name: foo + content: yaml 数组语法 + - [meta, { name: bar, content: 方括号语法 }] +--- +
渲染为:
`,5),P=l("h2",{id:"lang",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#lang","aria-hidden":"true"},"#"),n(" lang")],-1),F=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string")])],-1),M=l("li",null,[l("p",null,"详情:"),l("p",null,"页面的语言。"),l("p",null,[n("它将会覆盖站点配置中的 "),l("code",null,"lang"),n(" 配置项")])],-1),z=l("p",null,"参考:",-1),N=t(`<head> + <meta name="foo" content="yaml 数组语法" /> + <meta name="bar" content="方括号语法" /> +</head> +
# layout
类型:
string
详情:
页面的布局。
布局是由主题提供的。如果你不指定该 Frontmatter ,则会使用默认布局。你应该参考主题自身的文档来了解其提供了哪些布局。
如果主题布局无法满足你的需求,你可以使用自定义布局组件。
示例:
在
.vuepress/client.ts
文件中注册一个布局组件:import { defineClientConfig } from '@vuepress/client' +import CustomLayout from './CustomLayout.vue' + +export default defineClientConfig({ + layouts: { + CustomLayout, + }, +}) +
在 Frontmatter 中设置自定义布局:
--- +layout: CustomLayout +--- +
# permalink
`,7),A=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string")])],-1),w=l("li",null,[l("p",null,"详情:"),l("p",null,"页面的永久链接。"),l("p",null,"它将会覆盖根据文件路径来决定的默认路由路径。")],-1),L=l("p",null,"参考:",-1),q=l("li",null,[l("a",{href:"#permalinkpattern"},"Frontmatter > permalinkPattern")],-1),I=t(`# permalinkPattern
类型:
string | null
详情:
为页面生成永久链接的 Pattern 。
它将会覆盖站点配置中的
permalinkPattern
配置项。如果 Frontmatter 中设置了
permalink
,那么这个字段则不会生效。使用:
Pattern 描述 :year
创建日期的 年 部分 :month
创建日期的 月 部分 :day
创建日期的 日 部分 :slug
页面文件名的 Slug :raw
原始路由路径
:year
,:month
和:day
Pattern 根据如下优先级进行解析:
- Frontmatter 中的
date
字段。- 符合
yyyy-MM-dd-foobar.md
或yyyy-MM-foobar.md
日期格式的文件名。- 符合
yyyy/MM/dd/foobar.md
或yyyy/MM/foobar.md
日期格式的目录名。- 默认值
0000-00-00
。示例 1 :
页面文件名是
foo-bar.md
。页面 Frontmatter 是:
--- +date: 2021-01-03 +permalinkPattern: :year/:month/:day/:slug.html +--- +
那么页面的永久链接将会是
2021/01/03/foo-bar.html
。
示例 2 :
页面文件名是
2021-01-03-bar-baz.md
。页面 Frontmatter 是:
--- +permalinkPattern: :year/:month/:day/:slug.html +--- +
那么页面的永久链接将会是
`,7),B=l("li",null,[l("a",{href:"#date"},"Frontmatter > date")],-1),V=l("li",null,[l("a",{href:"#permalink"},"Frontmatter > permalink")],-1),R=l("h2",{id:"routemeta",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#routemeta","aria-hidden":"true"},"#"),n(" routeMeta")],-1),T=l("li",null,[l("p",null,[n("类型: "),l("code",null,"Record2021/01/03/bar-baz.html
。")])],-1),S=l("li",null,[l("p",null,"详情:"),l("p",null,"附加到页面路由的自定义数据。")],-1),H=l("p",null,"参考:",-1),Y=l("h2",{id:"title",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#title","aria-hidden":"true"},"#"),n(" title")],-1),j=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string")])],-1),G=l("li",null,[l("p",null,"详情:"),l("p",null,"页面的标题。"),l("p",null,[n("如果你不在 Frontmatter 中设置 "),l("code",null,"title"),n(" ,那么页面中第一个一级标题(即 "),l("code",null,"# title"),n(")的内容会被当作标题使用。")])],-1),J=l("p",null,"参考:",-1);function K(O,Q){const p=o("NpmBadge"),r=o("ExternalLinkIcon"),e=o("RouterLink");return d(),c("div",null,[D,s(p,{package:"@vuepress/client"}),s(p,{package:"@vuepress/markdown"}),h,l("ul",null,[m,l("li",null,[y,_,l("p",null,[n("应按照 "),v,n(" 的格式来指定日期,或者遵循 "),l("a",b,[n("YAML Timestamp Type"),s(r)]),n(" 。")])]),l("li",null,[C,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/node-api.html#date"},{default:a(()=>[n("Node API > Page 属性 > date")]),_:1})])])])]),f,l("ul",null,[g,k,l("li",null,[E,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/config.html#description"},{default:a(()=>[n("配置 > description")]),_:1})])])])]),x,l("ul",null,[l("li",null,[n("参考: "),l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/config.html#head"},{default:a(()=>[n("配置 > head")]),_:1})])])])]),P,l("ul",null,[F,M,l("li",null,[z,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/config.html#lang"},{default:a(()=>[n("配置 > lang")]),_:1})]),l("li",null,[s(e,{to:"/zh/reference/node-api.html#lang"},{default:a(()=>[n("Node API > Page 属性 > lang")]),_:1})])])])]),N,l("ul",null,[A,w,l("li",null,[L,l("ul",null,[q,l("li",null,[s(e,{to:"/zh/guide/page.html#%E8%B7%AF%E7%94%B1"},{default:a(()=>[n("指南 > 页面 > 路由")]),_:1})]),l("li",null,[s(e,{to:"/zh/reference/node-api.html#permalink"},{default:a(()=>[n("Node API > Page 属性 > permalink")]),_:1})])])])]),I,l("ul",null,[l("li",null,[n("参考: "),l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/config.html#permalinkpattern"},{default:a(()=>[n("配置 > permalinkPattern")]),_:1})]),B,V,l("li",null,[s(e,{to:"/zh/reference/node-api.html#permalink"},{default:a(()=>[n("Node API > Page 属性 > permalink")]),_:1})])])])]),R,l("ul",null,[T,S,l("li",null,[H,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/node-api.html#routeMeta"},{default:a(()=>[n("Node API > Page 属性 > routeMeta")]),_:1})])])])]),Y,l("ul",null,[j,G,l("li",null,[J,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/node-api.html#title"},{default:a(()=>[n("Node API > Page 属性 > title")]),_:1})])])])])])}const W=i(u,[["render",K],["__file","frontmatter.html.vue"]]);export{W as default}; diff --git a/assets/frontmatter.html-pBtKj0Vl.js b/assets/frontmatter.html-pBtKj0Vl.js new file mode 100644 index 000000000..2930dc7b8 --- /dev/null +++ b/assets/frontmatter.html-pBtKj0Vl.js @@ -0,0 +1,60 @@ +import{_ as r,r as o,o as d,c,d as s,a as l,b as n,w as a,e as i}from"./app-eU2v8o1B.js";const u={},h=l("h1",{id:"frontmatter",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),n(" Frontmatter")],-1),D=l("h2",{id:"所有页面",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#所有页面","aria-hidden":"true"},"#"),n(" 所有页面")],-1),m=l("p",null,"本章节中的 Frontmatter 会在所有类型的页面中生效。",-1),v=l("h3",{id:"externallinkicon",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#externallinkicon","aria-hidden":"true"},"#"),n(" externalLinkIcon")],-1),y=l("li",null,[l("p",null,[n("类型: "),l("code",null,"boolean")])],-1),b=l("p",null,"详情:",-1),_=l("p",null,"参考:",-1),f=l("h3",{id:"navbar",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#navbar","aria-hidden":"true"},"#"),n(" navbar")],-1),g=l("li",null,[l("p",null,[n("类型: "),l("code",null,"boolean")])],-1),k=l("li",null,[l("p",null,"详情:"),l("p",null,"是否在当前页面展示导航栏。"),l("p",null,"如果你在主题配置中禁用了导航栏,那么该 Frontmatter 将不会生效。")],-1),C=l("p",null,"参考:",-1),x=i(` # pageClass
类型:
string
详情:
为当前页面添加额外的类名。
示例:
--- +pageClass: custom-page-class +--- +
然后你可以在
.vuepress/styles/index.scss
文件中为这个页面添加自定义样式:`,5),E=i(`.theme-container.custom-page-class { + /* 页面样式 */ +} +
# 首页
本章节中的 Frontmatter 只会在首页中生效。
# home
类型:
boolean
详情:
设定该页面是首页还是普通页面。
如果你不设置该 Frontmatter 或将其设为
false
,则该页面会是一个 普通页面示例:
--- +home: true +--- +
# heroImage
`,5),L=i(`类型:
string
详情:
首页图片的 URL 。
`,3),A=l("p",null,"参考:",-1),B=l("h3",{id:"heroimagedark",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#heroimagedark","aria-hidden":"true"},"#"),n(" heroImageDark")],-1),z=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string")])],-1),F=l("li",null,[l("p",null,"详情:"),l("p",null,"在夜间模式中使用的首页图片的 URL 。"),l("p",null,"如果你想在夜间模式中使用不同的首页图片,就可以使用该配置项。")],-1),N=l("p",null,"参考:",-1),w=l("li",null,[l("a",{href:"#heroimage"},"默认主题 > Frontmatter > heroImage")],-1),I=i(' 示例:
--- +# Public 文件路径 +heroImage: /images/hero.png +# URL +heroImage: https://vuejs.org/images/logo.png +--- +
# heroAlt
类型:
string
详情:
首页图片的
alt
属性。如果不设置,则默认使用 heroText 。
# heroHeight
',3),S=l("li",null,[l("p",null,[n("类型: "),l("code",null,"number")])],-1),V=l("li",null,[l("p",null,[n("默认值: "),l("code",null,"280")])],-1),P=l("p",null,"详情:",-1),H=l("p",null,[n("首页图片 "),l("code",null,""),n(" 标签的 "),l("code",null,"height"),n(" 属性。")],-1),M=l("p",null,"当你的首页图片高度小于默认值时,你可能需要减小该属性。",-1),R={href:"https://web.dev/cls/",target:"_blank",rel:"noopener noreferrer"},T=l("h3",{id:"herotext",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#herotext","aria-hidden":"true"},"#"),n(" heroText")],-1),U=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string | null")])],-1),j=l("p",null,"详情:",-1),G=l("p",null,"首页的大标题。",-1),O=l("p",null,[n("设置为 "),l("code",null,"null"),n(" 来禁用首页大标题。")],-1),q=l("h3",{id:"tagline",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#tagline","aria-hidden":"true"},"#"),n(" tagline")],-1),J=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string | null")])],-1),K=l("p",null,"详情:",-1),Q=l("p",null,"首页的标语。",-1),W=l("p",null,[n("设置为 "),l("code",null,"null"),n(" 来禁用首页标语。")],-1),X=i(`# actions
- 类型:
Array<{ + text: string + link: string + type?: 'primary' | 'secondary' +}> +
详情:
配置首页按钮。
示例:
--- +actions: + - text: 快速上手 + link: /zh/guide/getting-started.html + type: primary + - text: 项目简介 + link: /guide/ + type: secondary +--- +
# features
- 类型:
Array<{ + title: string + details: string +}> +
详情:
配置首页特性列表。
示例:
--- +features: + - title: 简洁至上 + details: 以 Markdown 为中心的项目结构,以最少的配置帮助你专注于写作。 + - title: Vue 驱动 + details: 享受 Vue 的开发体验,可以在 Markdown 中使用 Vue 组件,又可以使用 Vue 来开发自定义主题。 + - title: 高性能 + details: VuePress 会为每个页面预渲染生成静态的 HTML,同时,每个页面被加载的时候,将作为 SPA 运行。 +--- +
# footer
类型:
string
详情:
首页的页脚。
# footerHtml
类型:
boolean
详情:
是否允许页脚中使用 HTML 。
如果设置为
true
,那么 footer 会被作为 HTML 代码处理。# 普通页面
本章节中的 Frontmatter 只会在普通页面中生效。
# editLink
`,17),Y=l("li",null,[l("p",null,[n("类型: "),l("code",null,"boolean")])],-1),Z=l("li",null,[l("p",null,"详情:"),l("p",null,[n("是否在本页面中启用 "),l("em",null,"编辑此页"),n(" 链接。")])],-1),$=l("p",null,"参考:",-1),ll=l("h3",{id:"editlinkpattern",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#editlinkpattern","aria-hidden":"true"},"#"),n(" editLinkPattern")],-1),nl=l("li",null,[l("p",null,[n("类型: "),l("code",null,"string")])],-1),sl=l("li",null,[l("p",null,"详情:"),l("p",null,[n("本页面中 "),l("em",null,"编辑此页"),n(" 链接的 Pattern 。")])],-1),el=l("p",null,"参考:",-1),al=l("h3",{id:"lastupdated",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#lastupdated","aria-hidden":"true"},"#"),n(" lastUpdated")],-1),il=l("li",null,[l("p",null,[n("类型: "),l("code",null,"boolean")])],-1),ol=l("li",null,[l("p",null,"详情:"),l("p",null,[n("是否在本页面中启用 "),l("em",null,"最近更新时间戳"),n(" 。")])],-1),tl=l("p",null,"参考:",-1),pl=l("h3",{id:"contributors",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#contributors","aria-hidden":"true"},"#"),n(" contributors")],-1),rl=l("li",null,[l("p",null,[n("类型: "),l("code",null,"boolean")])],-1),dl=l("li",null,[l("p",null,"详情:"),l("p",null,[n("是否在本页面中启用 "),l("em",null,"贡献者列表"),n(" 。")])],-1),cl=l("p",null,"参考:",-1),ul=l("h3",{id:"sidebar",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#sidebar","aria-hidden":"true"},"#"),n(" sidebar")],-1),hl=l("li",null,[l("p",null,[n("类型: "),l("code",null,"false | 'auto' | SidebarConfigArray | SidebarConfigObject")])],-1),Dl=l("li",null,[l("p",null,"详情:"),l("p",null,"配置本页面的侧边栏。")],-1),ml=l("p",null,"参考:",-1),vl=l("h3",{id:"sidebardepth",tabindex:"-1"},[l("a",{class:"header-anchor",href:"#sidebardepth","aria-hidden":"true"},"#"),n(" sidebarDepth")],-1),yl=l("li",null,[l("p",null,[n("类型: "),l("code",null,"number")])],-1),bl=l("li",null,[l("p",null,"详情:"),l("p",null,"配置本页面的侧边栏深度。")],-1),_l=l("p",null,"参考:",-1),fl=i(`# prev
类型:
NavLink | string
详情:
上一个页面的链接。
如果你不设置该 Frontmatter ,该链接会自动根据侧边栏配置进行推断。
为了手动配置上一页面的链接,你可以将其设置为一个
NavLink
对象或者一个字符串:
NavLink
对象应该有一个text
字段和一个link
字段。- 字符串应为目标页面文件的路径。它将会被转换为
NavLink
对象,将页面标题作为text
,将页面路由路径作为link
。示例:
--- +# NavLink +prev: + text: Get Started + link: /guide/getting-started.html + +# NavLink - 外部 URL +prev: + text: GitHub + link: https://github.com + +# 字符串 - 页面文件路径 +prev: /guide/getting-started.md + +# 字符串 - 页面文件相对路径 +prev: ../../guide/getting-started.md +--- +
# next
`,5);function gl(kl,Cl){const t=o("NpmBadge"),e=o("RouterLink"),p=o("ExternalLinkIcon");return d(),c("div",null,[h,s(t,{package:"@vuepress/theme-default"}),D,m,v,l("ul",null,[y,l("li",null,[b,l("p",null,[n("由"),s(e,{to:"/zh/reference/plugin/external-link-icon.html#externallinkicon"},{default:a(()=>[n("@vuepress/plugin-external-link-icon")]),_:1}),n(" 提供。")])]),l("li",null,[_,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/default-theme/config.html#themeplugins-externallinkicon"},{default:a(()=>[n("默认主题 > 配置 > themePlugins.externalLinkIcon")]),_:1})])])])]),f,l("ul",null,[g,k,l("li",null,[C,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/default-theme/config.html#navbar"},{default:a(()=>[n("默认主题 > 配置 > navbar")]),_:1})])])])]),x,l("ul",null,[l("li",null,[n("参考: "),l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/default-theme/styles.html#style-%E6%96%87%E4%BB%B6"},{default:a(()=>[n("默认主题 > 样式 > Style 文件")]),_:1})])])])]),E,l("ul",null,[L,l("li",null,[A,l("ul",null,[l("li",null,[s(e,{to:"/zh/guide/assets.html#public-%E6%96%87%E4%BB%B6"},{default:a(()=>[n("指南 > 静态资源 > Public 文件")]),_:1})])])])]),B,l("ul",null,[z,F,l("li",null,[N,l("ul",null,[w,l("li",null,[s(e,{to:"/zh/reference/default-theme/config.html#colormode"},{default:a(()=>[n("默认主题 > 配置 > colorMode")]),_:1})])])])]),I,l("ul",null,[S,V,l("li",null,[P,H,M,l("p",null,[n("需要注意的是,首页图片的高度同样受到了 CSS 的约束。设置这个属性主要是为了减少由加载首页图片引起的 "),l("a",R,[n("累积布局偏移 (CLS)"),s(p)]),n(" 。")])])]),T,l("ul",null,[U,l("li",null,[j,G,l("p",null,[n("如果不设置,则默认使用站点 "),s(e,{to:"/zh/reference/config.html#title"},{default:a(()=>[n("title")]),_:1}),n(" 。")]),O])]),q,l("ul",null,[J,l("li",null,[K,Q,l("p",null,[n("如果不设置,则默认使用站点 "),s(e,{to:"/zh/reference/config.html#description"},{default:a(()=>[n("description")]),_:1}),n(" 。")]),W])]),X,l("ul",null,[Y,Z,l("li",null,[$,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/default-theme/config.html#editlink"},{default:a(()=>[n("默认主题 > 配置 > editLink")]),_:1})])])])]),ll,l("ul",null,[nl,sl,l("li",null,[el,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/default-theme/config.html#editlinkpattern"},{default:a(()=>[n("默认主题 > 配置 > editLinkPattern")]),_:1})])])])]),al,l("ul",null,[il,ol,l("li",null,[tl,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/default-theme/config.html#lastupdated"},{default:a(()=>[n("默认主题 > 配置 > lastUpdated")]),_:1})])])])]),pl,l("ul",null,[rl,dl,l("li",null,[cl,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/default-theme/config.html#contributors"},{default:a(()=>[n("默认主题 > 配置 > contributors")]),_:1})])])])]),ul,l("ul",null,[hl,Dl,l("li",null,[ml,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/default-theme/config.html#sidebar"},{default:a(()=>[n("默认主题 > 配置 > sidebar")]),_:1})])])])]),vl,l("ul",null,[yl,bl,l("li",null,[_l,l("ul",null,[l("li",null,[s(e,{to:"/zh/reference/default-theme/config.html#sidebardepth"},{default:a(()=>[n("默认主题 > 配置 > sidebarDepth")]),_:1})])])])]),fl])}const El=r(u,[["render",gl],["__file","frontmatter.html.vue"]]);export{El as default}; diff --git a/assets/frontmatter.html-sp6j5XB_.js b/assets/frontmatter.html-sp6j5XB_.js new file mode 100644 index 000000000..b81ee7b7e --- /dev/null +++ b/assets/frontmatter.html-sp6j5XB_.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3590f0ec","path":"/reference/frontmatter.html","title":"Frontmatter","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"date","slug":"date","link":"#date","children":[]},{"level":2,"title":"description","slug":"description","link":"#description","children":[]},{"level":2,"title":"head","slug":"head","link":"#head","children":[]},{"level":2,"title":"lang","slug":"lang","link":"#lang","children":[]},{"level":2,"title":"layout","slug":"layout","link":"#layout","children":[]},{"level":2,"title":"permalink","slug":"permalink","link":"#permalink","children":[]},{"level":2,"title":"permalinkPattern","slug":"permalinkpattern","link":"#permalinkpattern","children":[]},{"level":2,"title":"routeMeta","slug":"routemeta","link":"#routemeta","children":[]},{"level":2,"title":"title","slug":"title","link":"#title","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/frontmatter.md"}');export{e as data}; diff --git a/assets/getting-started.html-JooUvMS6.js b/assets/getting-started.html-JooUvMS6.js new file mode 100644 index 000000000..248a815a0 --- /dev/null +++ b/assets/getting-started.html-JooUvMS6.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-fb0f0066","path":"/guide/getting-started.html","title":"Getting Started","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Prerequisites","slug":"prerequisites","link":"#prerequisites","children":[]},{"level":2,"title":"Manual Installation","slug":"manual-installation","link":"#manual-installation","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"guide/getting-started.md"}');export{e as data}; diff --git a/assets/getting-started.html-Ya8-UCpt.js b/assets/getting-started.html-Ya8-UCpt.js new file mode 100644 index 000000000..a2c3268ca --- /dev/null +++ b/assets/getting-started.html-Ya8-UCpt.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-37781588","path":"/zh/guide/getting-started.html","title":"快速上手","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"依赖环境","slug":"依赖环境","link":"#依赖环境","children":[]},{"level":2,"title":"手动安装","slug":"手动安装","link":"#手动安装","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/guide/getting-started.md"}');export{e as data}; diff --git a/assets/getting-started.html-otXrftcQ.js b/assets/getting-started.html-otXrftcQ.js new file mode 100644 index 000000000..dac4c045c --- /dev/null +++ b/assets/getting-started.html-otXrftcQ.js @@ -0,0 +1,26 @@ +import{_ as p,r as t,o as d,c as u,a as s,b as e,d as n,w as l,e as c}from"./app-eU2v8o1B.js";const D={},h=s("h1",{id:"快速上手",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#快速上手","aria-hidden":"true"},"#"),e(" 快速上手")],-1),y={class:"custom-container warning"},_=s("p",{class:"custom-container-title"},"注意",-1),m={href:"https://github.com/vuepress/vuepress-next/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer"},b=s("h2",{id:"依赖环境",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#依赖环境","aria-hidden":"true"},"#"),e(" 依赖环境")],-1),v={href:"https://nodejs.org/",target:"_blank",rel:"noopener noreferrer"},g={href:"https://pnpm.io/zh/",target:"_blank",rel:"noopener noreferrer"},C={href:"https://classic.yarnpkg.com/en/",target:"_blank",rel:"noopener noreferrer"},E={href:"https://www.npmjs.com/",target:"_blank",rel:"noopener noreferrer"},k={class:"custom-container tip"},f=s("p",{class:"custom-container-title"},"提示",-1),A={href:"https://pnpm.io/zh/",target:"_blank",rel:"noopener noreferrer"},x=s("code",null,"vue",-1),P=s("code",null,"@vuepress/client",-1),N={href:"https://yarnpkg.com/",target:"_blank",rel:"noopener noreferrer"},V={href:"https://yarnpkg.com/configuration/yarnrc#nodeLinker",target:"_blank",rel:"noopener noreferrer"},q=s("code",null,".yarnrc.yml",-1),R=s("code",null,"nodeLinker: 'node-modules'",-1),M=c(`
类型:
NavLink | string
详情:
下一个页面的链接。
如果你不设置该 Frontmatter ,该链接会自动根据侧边栏配置进行推断。
类型和 prev Frontmatter 相同。
# 手动安装
这一章节会帮助你从头搭建一个简单的 VuePress 文档网站。如果你想在一个现有项目中使用 VuePress 管理文档,从步骤 3 开始。
- 步骤 1: 创建并进入一个新目录
mkdir vuepress-starter +cd vuepress-starter +
`,5),j=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"git"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"init")]),e(` +`),s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"pnpm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"init")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),w=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"git"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"init")]),e(` +`),s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"yarn"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"init")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),L=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"git"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"init")]),e(` +`),s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"npm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"init")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),G=s("ul",null,[s("li",null,[s("strong",null,"步骤 3"),e(": 将 VuePress 安装为本地依赖")])],-1),I=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"pnpm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"add"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#569CD6"}},"-D"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress@next"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"@vuepress/client@next"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vue")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),z=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"yarn"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"add"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#569CD6"}},"-D"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress@next")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),B=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"npm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"install"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#569CD6"}},"-D"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress@next")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),F=s("strong",null,"步骤 4",-1),H=s("code",null,"package.json",-1),Y={href:"https://classic.yarnpkg.com/zh-Hans/docs/package-json#toc-scripts",target:"_blank",rel:"noopener noreferrer"},S=c(`
- 步骤 2: 初始化项目
{ + "scripts": { + "docs:dev": "vuepress dev docs", + "docs:build": "vuepress build docs" + } +} +
- 步骤 5: 将默认的临时目录和缓存目录添加到
.gitignore
文件中echo 'node_modules' >> .gitignore +echo '.temp' >> .gitignore +echo '.cache' >> .gitignore +
- 步骤 6: 创建你的第一篇文档
mkdir docs +echo '# Hello VuePress' > docs/README.md +
`,6),O=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"pnpm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"docs:dev")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),T=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"yarn"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"docs:dev")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),J=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"npm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"run"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"docs:dev")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),K={href:"http://localhost:8080",target:"_blank",rel:"noopener noreferrer"};function Q(U,W){const a=t("ExternalLinkIcon"),o=t("CodeGroupItem"),r=t("CodeGroup"),i=t("RouterLink");return d(),u("div",null,[h,s("div",y,[_,s("p",null,[e("VuePress v2 目前仍处于 RC (Release Candidate) 阶段。你已经可以用它来构建你的站点,但是它的配置和 API 还不够稳定,有可能会发生一些微小的 Breaking Changes 。因此,在每次更新 RC 版本之后,请一定要仔细阅读 "),s("a",m,[e("更新日志"),n(a)]),e("。")])]),b,s("ul",null,[s("li",null,[s("a",v,[e("Node.js v18.16.0+"),n(a)])]),s("li",null,[e("包管理器,如 "),s("a",g,[e("pnpm"),n(a)]),e("、"),s("a",C,[e("yarn"),n(a)]),e("、"),s("a",E,[e("npm"),n(a)]),e(" 等。")])]),s("div",k,[f,s("ul",null,[s("li",null,[e("使用 "),s("a",A,[e("pnpm"),n(a)]),e(" 时,你需要安装 "),x,e(" 和 "),P,e(" 作为 peer-dependencies 。")]),s("li",null,[e("使用 "),s("a",N,[e("yarn 2+"),n(a)]),e(" 时,你需要在 "),s("a",V,[q,n(a)]),e(" 文件中设置 "),R,e(" 。")])])]),M,n(r,null,{default:l(()=>[n(o,{title:"PNPM",active:""},{default:l(()=>[j]),_:1}),n(o,{title:"YARN"},{default:l(()=>[w]),_:1}),n(o,{title:"NPM"},{default:l(()=>[L]),_:1})]),_:1}),G,n(r,null,{default:l(()=>[n(o,{title:"PNPM",active:""},{default:l(()=>[I]),_:1}),n(o,{title:"YARN"},{default:l(()=>[z]),_:1}),n(o,{title:"NPM"},{default:l(()=>[B]),_:1})]),_:1}),s("ul",null,[s("li",null,[F,e(": 在 "),H,e(" 中添加一些 "),s("a",Y,[e("scripts"),n(a)])])]),S,n(r,null,{default:l(()=>[n(o,{title:"PNPM",active:""},{default:l(()=>[O]),_:1}),n(o,{title:"YARN"},{default:l(()=>[T]),_:1}),n(o,{title:"NPM"},{default:l(()=>[J]),_:1})]),_:1}),s("p",null,[e("VuePress 会在 "),s("a",K,[e("http://localhost:8080"),n(a)]),e(" 启动一个热重载的开发服务器。当你修改你的 Markdown 文件时,浏览器中的内容也会自动更新。")]),s("p",null,[e("现在,你应该已经有了一个简单可用的 VuePress 文档网站。接下来,了解一下 VuePress "),n(i,{to:"/zh/guide/configuration.html"},{default:l(()=>[e("配置")]),_:1}),e(" 相关的内容。")])])}const Z=p(D,[["render",Q],["__file","getting-started.html.vue"]]);export{Z as default}; diff --git a/assets/getting-started.html-sCB2RJZF.js b/assets/getting-started.html-sCB2RJZF.js new file mode 100644 index 000000000..87426247d --- /dev/null +++ b/assets/getting-started.html-sCB2RJZF.js @@ -0,0 +1,26 @@ +import{_ as d,r as t,o as p,c as u,a as s,b as e,d as n,w as l,e as i}from"./app-eU2v8o1B.js";const D={},h=s("h1",{id:"getting-started",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#getting-started","aria-hidden":"true"},"#"),e(" Getting Started")],-1),y={class:"custom-container warning"},m=s("p",{class:"custom-container-title"},"WARNING",-1),b={href:"https://github.com/vuepress/vuepress-next/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer"},g=s("h2",{id:"prerequisites",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#prerequisites","aria-hidden":"true"},"#"),e(" Prerequisites")],-1),_={href:"https://nodejs.org/",target:"_blank",rel:"noopener noreferrer"},v={href:"https://pnpm.io",target:"_blank",rel:"noopener noreferrer"},C={href:"https://classic.yarnpkg.com/en/",target:"_blank",rel:"noopener noreferrer"},E={href:"https://www.npmjs.com",target:"_blank",rel:"noopener noreferrer"},k={class:"custom-container tip"},f=s("p",{class:"custom-container-title"},"TIP",-1),A={href:"https://pnpm.io/",target:"_blank",rel:"noopener noreferrer"},x=s("code",null,"vue",-1),P=s("code",null,"@vuepress/client",-1),N={href:"https://yarnpkg.com/",target:"_blank",rel:"noopener noreferrer"},w=s("code",null,"nodeLinker: 'node-modules'",-1),q={href:"https://yarnpkg.com/configuration/yarnrc#nodeLinker",target:"_blank",rel:"noopener noreferrer"},S=s("code",null,".yarnrc.yml",-1),I=i(`
- 步骤 7: 在本地启动服务器来开发你的文档网站
# Manual Installation
This section will help you build a basic VuePress documentation site from ground up. If you already have an existing project and would like to keep documentation inside the project, start from Step 3.
- Step 1: Create and change into a new directory
mkdir vuepress-starter +cd vuepress-starter +
`,5),V=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"git"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"init")]),e(` +`),s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"pnpm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"init")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),j=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"git"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"init")]),e(` +`),s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"yarn"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"init")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),R=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"git"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"init")]),e(` +`),s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"npm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"init")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"}),s("div",{class:"line-number"})])],-1),G=s("ul",null,[s("li",null,[s("strong",null,"Step 3"),e(": Install VuePress locally")])],-1),M=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"pnpm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"add"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#569CD6"}},"-D"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress@next"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"@vuepress/client@next"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vue")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),L=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"yarn"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"add"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#569CD6"}},"-D"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress@next")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),B=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"npm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"install"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#569CD6"}},"-D"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"vuepress@next")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),W=s("strong",null,"Step 4",-1),F={href:"https://classic.yarnpkg.com/en/docs/package-json#toc-scripts",target:"_blank",rel:"noopener noreferrer"},T=s("code",null,"package.json",-1),Y=i(`
- Step 2: Initialize your project
{ + "scripts": { + "docs:dev": "vuepress dev docs", + "docs:build": "vuepress build docs" + } +} +
- Step 5: Add the default temp and cache directory to
.gitignore
fileecho 'node_modules' >> .gitignore +echo '.temp' >> .gitignore +echo '.cache' >> .gitignore +
- Step 6: Create your first document
mkdir docs +echo '# Hello VuePress' > docs/README.md +
`,6),H=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"pnpm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"docs:dev")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),z=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"yarn"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"docs:dev")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),O=s("div",{class:"language-bash line-numbers-mode","data-ext":"sh"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#DCDCAA"}},"npm"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"run"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#CE9178"}},"docs:dev")]),e(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),J={href:"http://localhost:8080",target:"_blank",rel:"noopener noreferrer"};function K(Q,U){const a=t("ExternalLinkIcon"),o=t("CodeGroupItem"),r=t("CodeGroup"),c=t("RouterLink");return p(),u("div",null,[h,s("div",y,[m,s("p",null,[e("VuePress v2 is currently in RC (Release Candidate) stage. It's ready to be used for building your site, but the config and API are not stable enough, which is possibly to have minor breaking changes. So make sure to read the "),s("a",b,[e("changelog"),n(a)]),e(" carefully each time you upgrade a RC version.")])]),g,s("ul",null,[s("li",null,[s("a",_,[e("Node.js v18.16.0+"),n(a)])]),s("li",null,[e("Package manager like "),s("a",v,[e("pnpm"),n(a)]),e(", "),s("a",C,[e("yarn"),n(a)]),e(", "),s("a",E,[e("npm"),n(a)]),e(", etc.")])]),s("div",k,[f,s("ul",null,[s("li",null,[e("When using "),s("a",A,[e("pnpm"),n(a)]),e(", you need to install "),x,e(" and "),P,e(" as peer-dependencies.")]),s("li",null,[e("When using "),s("a",N,[e("yarn 2+"),n(a)]),e(", you need to set "),w,e(" in your "),s("a",q,[S,n(a)]),e(" file.")])])]),I,n(r,null,{default:l(()=>[n(o,{title:"PNPM",active:""},{default:l(()=>[V]),_:1}),n(o,{title:"YARN"},{default:l(()=>[j]),_:1}),n(o,{title:"NPM"},{default:l(()=>[R]),_:1})]),_:1}),G,n(r,null,{default:l(()=>[n(o,{title:"PNPM",active:""},{default:l(()=>[M]),_:1}),n(o,{title:"YARN"},{default:l(()=>[L]),_:1}),n(o,{title:"NPM"},{default:l(()=>[B]),_:1})]),_:1}),s("ul",null,[s("li",null,[W,e(": Add some "),s("a",F,[e("scripts"),n(a)]),e(" to "),T])]),Y,n(r,null,{default:l(()=>[n(o,{title:"PNPM",active:""},{default:l(()=>[H]),_:1}),n(o,{title:"YARN"},{default:l(()=>[z]),_:1}),n(o,{title:"NPM"},{default:l(()=>[O]),_:1})]),_:1}),s("p",null,[e("VuePress will start a hot-reloading development server at "),s("a",J,[e("http://localhost:8080"),n(a)]),e(". When you modify your markdown files, the content in the browser will be auto updated.")]),s("p",null,[e("By now, you should have a basic but functional VuePress documentation site. Next, learn about the basics of "),n(c,{to:"/guide/configuration.html"},{default:l(()=>[e("configuration")]),_:1}),e(" in VuePress.")])])}const Z=d(D,[["render",K],["__file","getting-started.html.vue"]]);export{Z as default}; diff --git a/assets/git.html-MIFkPpVx.js b/assets/git.html-MIFkPpVx.js new file mode 100644 index 000000000..770373311 --- /dev/null +++ b/assets/git.html-MIFkPpVx.js @@ -0,0 +1,30 @@ +import{_ as r,r as e,o as c,c as d,d as n,a,b as s,w as i,e as o}from"./app-eU2v8o1B.js";const D={},u=a("h1",{id:"git",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#git","aria-hidden":"true"},"#"),s(" git")],-1),h=a("p",null,"该插件会收集你的页面的 Git 信息,包括创建和更新时间、贡献者等。",-1),y=o(`
- Step 7: Serve the documentation site in the local server
该插件主要用于开发主题,大部分情况下你不需要直接使用它。
# 使用方法
npm i -D @vuepress/plugin-git@next +
import { gitPlugin } from '@vuepress/plugin-git' + +export default { + plugins: [ + gitPlugin({ + // 配置项 + }), + ], +} +
# Git 仓库
`,5),m={href:"https://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository",target:"_blank",rel:"noopener noreferrer"},v={href:"https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt",target:"_blank",rel:"noopener noreferrer"},b=o(`注意
该插件会显著降低准备数据的速度,特别是在你的页面数量很多的时候。你可以考虑在
dev
模式下禁用该插件来获取更好的开发体验。# 配置项
# createdTime
类型:
boolean
默认值:
true
详情:
是否收集页面的创建时间。
# updatedTime
类型:
boolean
默认值:
true
详情:
是否收集页面的更新时间。
# contributors
类型:
boolean
默认值:
true
详情:
是否收集页面的贡献者。
# Frontmatter
# gitInclude
类型:
string[]
详情:
文件相对路径组成的数组,该数组中的文件会在计算页面数据时被包含在内。
示例:
--- +gitInclude: + - relative/path/to/file1 + - relative/path/to/file2 +--- +
# 页面数据
该插件会向页面数据中添加一个
git
字段。在使用该插件后,可以在页面数据中获取该插件收集到的 Git 信息:
import { usePageData } from '@vuepress/client' +import type { GitPluginPageData } from '@vuepress/plugin-git' + +export default { + setup() { + const page = usePageData<GitPluginPageData>() + console.log(page.value.git) + }, +} +
# git.createdTime
类型:
number
详情:
页面第一次提交的 Unix 毫秒时间戳。
该属性将取当前页面及 gitInclude 中所列文件的第一次提交的时间戳的最小值。
# git.updatedTime
类型:
number
详情:
页面最后一次提交的 Unix 毫秒时间戳。
该属性将取当前页面及 gitInclude 中所列文件的最后一次提交的时间戳的最大值。
# git.contributors
- 类型:
GitContributor[]
interface GitContributor { + name: string + email: string + commits: number +} +
`,24);function g(C,f){const t=e("NpmBadge"),l=e("RouterLink"),p=e("ExternalLinkIcon");return c(),d("div",null,[u,n(t,{package:"@vuepress/plugin-git"}),h,a("p",null,[s("默认主题的 "),n(l,{to:"/zh/reference/default-theme/config.html#lastupdated"},{default:i(()=>[s("lastUpdated")]),_:1}),s(" 和 "),n(l,{to:"/zh/reference/default-theme/config.html#contributors"},{default:i(()=>[s("contributors")]),_:1}),s(" 就是由该插件支持的。")]),y,a("p",null,[s("该插件要求你的项目在 "),a("a",m,[s("Git 仓库"),n(p)]),s(" 下,这样它才能从提交历史记录中收集信息。")]),a("p",null,[s("在构建站点时,你应该确保所有的提交记录是可以获取到的。举例来说, CI 工作流通常会在克隆你的仓库时添加 "),a("a",v,[s("--depth 1"),n(p)]),s(" 参数来避免拉取全部的提交记录,因此你需要禁用这个功能,以便该插件在 CI 可以中正常使用。")]),b])}const x=r(D,[["render",g],["__file","git.html.vue"]]);export{x as default}; diff --git a/assets/git.html-Ztg3geGz.js b/assets/git.html-Ztg3geGz.js new file mode 100644 index 000000000..98bebb721 --- /dev/null +++ b/assets/git.html-Ztg3geGz.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0f9e4c06","path":"/reference/plugin/git.html","title":"git","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Git Repository","slug":"git-repository","link":"#git-repository","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"createdTime","slug":"createdtime","link":"#createdtime","children":[]},{"level":3,"title":"updatedTime","slug":"updatedtime","link":"#updatedtime","children":[]},{"level":3,"title":"contributors","slug":"contributors","link":"#contributors","children":[]}]},{"level":2,"title":"Frontmatter","slug":"frontmatter","link":"#frontmatter","children":[{"level":3,"title":"gitInclude","slug":"gitinclude","link":"#gitinclude","children":[]}]},{"level":2,"title":"Page Data","slug":"page-data","link":"#page-data","children":[{"level":3,"title":"git.createdTime","slug":"git-createdtime","link":"#git-createdtime","children":[]},{"level":3,"title":"git.updatedTime","slug":"git-updatedtime","link":"#git-updatedtime","children":[]},{"level":3,"title":"git.contributors","slug":"git-contributors","link":"#git-contributors","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/git.md"}');export{e as data}; diff --git a/assets/git.html-gg0deoQP.js b/assets/git.html-gg0deoQP.js new file mode 100644 index 000000000..95d19ff07 --- /dev/null +++ b/assets/git.html-gg0deoQP.js @@ -0,0 +1,30 @@ +import{_ as r,r as n,o as c,c as d,d as a,a as e,b as s,w as i,e as o}from"./app-eU2v8o1B.js";const u={},D=e("h1",{id:"git",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#git","aria-hidden":"true"},"#"),s(" git")],-1),h=e("p",null,"This plugin will collect git information of your pages, including the created and updated time, the contributors, etc.",-1),m=o(`
详情:
页面的贡献者信息。
该属性将会包含 gitInclude 所列文件的贡献者。
This plugin is mainly used to develop themes. You won't need to use it directly in most cases.
# Usage
npm i -D @vuepress/plugin-git@next +
import { gitPlugin } from '@vuepress/plugin-git' + +export default { + plugins: [ + gitPlugin({ + // options + }), + ], +} +
# Git Repository
`,5),y={href:"https://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository",target:"_blank",rel:"noopener noreferrer"},g={href:"https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt",target:"_blank",rel:"noopener noreferrer"},b=o(`WARNING
This plugin will significantly slow down the speed of data preparation, especially when you have a lot of pages. You can consider disabling this plugin in
dev
mode to get better development experience.# Options
# createdTime
Type:
boolean
Default:
true
Details:
Whether to collect page created time or not.
# updatedTime
Type:
boolean
Default:
true
Details:
Whether to collect page updated time or not.
# contributors
Type:
boolean
Default:
true
Details:
Whether to collect page contributors or not.
# Frontmatter
# gitInclude
Type:
string[]
Details:
An array of relative paths to be included when calculating page data.
Example:
--- +gitInclude: + - relative/path/to/file1 + - relative/path/to/file2 +--- +
# Page Data
This plugin will add a
git
field to page data.After using this plugin, you can get the collected git information in page data:
import { usePageData } from '@vuepress/client' +import type { GitPluginPageData } from '@vuepress/plugin-git' + +export default { + setup() { + const page = usePageData<GitPluginPageData>() + console.log(page.value.git) + }, +} +
# git.createdTime
Type:
number
Details:
Unix timestamp in milliseconds of the first commit of the page.
This attribute would take the minimum of the first commit timestamps of the current page and the files listed in gitInclude.
# git.updatedTime
Type:
number
Details:
Unix timestamp in milliseconds of the last commit of the page.
This attribute would take the maximum of the last commit timestamps of the current page and the files listed in gitInclude.
# git.contributors
- Type:
GitContributor[]
interface GitContributor { + name: string + email: string + commits: number +} +
`,24);function v(f,C){const p=n("NpmBadge"),l=n("RouterLink"),t=n("ExternalLinkIcon");return c(),d("div",null,[D,a(p,{package:"@vuepress/plugin-git"}),h,e("p",null,[s("The "),a(l,{to:"/reference/default-theme/config.html#lastupdated"},{default:i(()=>[s("lastUpdated")]),_:1}),s(" and "),a(l,{to:"/reference/default-theme/config.html#contributors"},{default:i(()=>[s("contributors")]),_:1}),s(" of default theme is powered by this plugin.")]),m,e("p",null,[s("This plugin requires your project to be inside a "),e("a",y,[s("Git Repository"),a(t)]),s(", so that it can collect information from the commit history.")]),e("p",null,[s("You should ensure all commits are available when building your site. For example, CI workflows usually clone your repository with "),e("a",g,[s("--depth 1"),a(t)]),s(" to avoid fetching all commits, so you should disable the behavior to make this plugin work properly in CI.")]),b])}const x=r(u,[["render",v],["__file","git.html.vue"]]);export{x as default}; diff --git a/assets/git.html-jPKcGQNF.js b/assets/git.html-jPKcGQNF.js new file mode 100644 index 000000000..2bbaf920e --- /dev/null +++ b/assets/git.html-jPKcGQNF.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-d2322692","path":"/zh/reference/plugin/git.html","title":"git","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"Git 仓库","slug":"git-仓库","link":"#git-仓库","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"createdTime","slug":"createdtime","link":"#createdtime","children":[]},{"level":3,"title":"updatedTime","slug":"updatedtime","link":"#updatedtime","children":[]},{"level":3,"title":"contributors","slug":"contributors","link":"#contributors","children":[]}]},{"level":2,"title":"Frontmatter","slug":"frontmatter","link":"#frontmatter","children":[{"level":3,"title":"gitInclude","slug":"gitinclude","link":"#gitinclude","children":[]}]},{"level":2,"title":"页面数据","slug":"页面数据","link":"#页面数据","children":[{"level":3,"title":"git.createdTime","slug":"git-createdtime","link":"#git-createdtime","children":[]},{"level":3,"title":"git.updatedTime","slug":"git-updatedtime","link":"#git-updatedtime","children":[]},{"level":3,"title":"git.contributors","slug":"git-contributors","link":"#git-contributors","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/git.md"}');export{e as data}; diff --git a/assets/google-analytics.html-M2qIk_Fo.js b/assets/google-analytics.html-M2qIk_Fo.js new file mode 100644 index 000000000..0a6569250 --- /dev/null +++ b/assets/google-analytics.html-M2qIk_Fo.js @@ -0,0 +1,26 @@ +import{_ as i,r as o,o as p,c as r,d as e,a as s,b as n,e as a}from"./app-eU2v8o1B.js";const c={},d=s("h1",{id:"google-analytics",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#google-analytics","aria-hidden":"true"},"#"),n(" google-analytics")],-1),D={href:"https://analytics.google.com/",target:"_blank",rel:"noopener noreferrer"},u={href:"https://developers.google.com/analytics/devguides/collection/gtagjs",target:"_blank",rel:"noopener noreferrer"},y={href:"https://support.google.com/analytics/answer/10089681",target:"_blank",rel:"noopener noreferrer"},g=a(`
Details:
The contributors information of the page.
This attribute would also include contributors to the files listed in gitInclude.
# Usage
npm i -D @vuepress/plugin-google-analytics@next +
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics' + +export default { + plugins: [ + googleAnalyticsPlugin({ + // options + }), + ], +} +
# Reporting Events
`,4),h={href:"https://support.google.com/analytics/answer/9234069",target:"_blank",rel:"noopener noreferrer"},v=s("code",null,"page_view",-1),_=s("code",null,"first_visit",-1),m=s("p",null,[n("So if you only want to collect some basic data of your site, you don't need to do anything else except setting the "),s("a",{href:"#id"},"Measurement ID"),n(" correctly.")],-1),b=s("code",null,"gtag()",-1),C=s("code",null,"window",-1),f={href:"https://developers.google.com/analytics/devguides/collection/ga4/events",target:"_blank",rel:"noopener noreferrer"},E=s("h2",{id:"options",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#options","aria-hidden":"true"},"#"),n(" Options")],-1),x=s("h3",{id:"id",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#id","aria-hidden":"true"},"#"),n(" id")],-1),k=s("li",null,[s("p",null,[n("Type: "),s("code",null,"string")])],-1),A=s("p",null,"Details:",-1),X=s("p",null,[n("The Measurement ID of Google Analytics 4, which should start with "),s("code",null,"'G-'"),n(".")],-1),w={href:"https://support.google.com/analytics/answer/9539598",target:"_blank",rel:"noopener noreferrer"},I=s("li",null,[s("p",null,"Example:")],-1),G=a(`export default { + plugins: [ + googleAnalyticsPlugin({ + id: 'G-XXXXXXXXXX', + }), + ], +} +
# debug
`,2),F=s("li",null,[s("p",null,[n("Type: "),s("code",null,"boolean")])],-1),N=s("p",null,"Details:",-1),V=s("code",null,"true",-1),T={href:"https://support.google.com/analytics/answer/7201382",target:"_blank",rel:"noopener noreferrer"},B=s("li",null,[s("p",null,"Example:")],-1),P=a(``,1);function M(S,j){const t=o("NpmBadge"),l=o("ExternalLinkIcon");return p(),r("div",null,[d,e(t,{package:"@vuepress/plugin-google-analytics"}),s("p",null,[n("Integrate "),s("a",D,[n("Google Analytics"),e(l)]),n(" into VuePress.")]),s("p",null,[n("This plugin will import "),s("a",u,[n("gtag.js"),e(l)]),n(" for "),s("a",y,[n("Google Analytics 4"),e(l)]),n(".")]),g,s("p",null,[n("Google Analytics will "),s("a",h,[n("automatically collect some events"),e(l)]),n(", such as "),v,n(", "),_,n(", etc.")]),m,s("p",null,[n("After using this plugin, the global "),b,n(" function is available on the "),C,n(" object, and you can use it for "),s("a",f,[n("custom events reporting"),e(l)]),n(".")]),E,x,s("ul",null,[k,s("li",null,[A,X,s("p",null,[n("You can follow the instructions "),s("a",w,[n("here"),e(l)]),n(' to find your Measurement ID. Notice the difference between Google Analytics 4 Measurement ID (i.e. "G-" ID) and Universal Analytics Tracking ID (i.e. "UA-" ID).')])]),I]),G,s("ul",null,[F,s("li",null,[N,s("p",null,[n("Set to "),V,n(" to enable sending events to DebugView. "),s("a",T,[n("See more information on DebugView"),e(l)]),n(".")])]),B]),P])}const L=i(c,[["render",M],["__file","google-analytics.html.vue"]]);export{L as default}; diff --git a/assets/google-analytics.html-WyEii0XV.js b/assets/google-analytics.html-WyEii0XV.js new file mode 100644 index 000000000..9141fcff8 --- /dev/null +++ b/assets/google-analytics.html-WyEii0XV.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-07ca2692","path":"/zh/reference/plugin/google-analytics.html","title":"google-analytics","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"上报事件","slug":"上报事件","link":"#上报事件","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"id","slug":"id","link":"#id","children":[]},{"level":3,"title":"debug","slug":"debug","link":"#debug","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/google-analytics.md"}');export{e as data}; diff --git a/assets/google-analytics.html-ncL2DNzR.js b/assets/google-analytics.html-ncL2DNzR.js new file mode 100644 index 000000000..6a7cc5c8d --- /dev/null +++ b/assets/google-analytics.html-ncL2DNzR.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-b3f1b470","path":"/reference/plugin/google-analytics.html","title":"google-analytics","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Reporting Events","slug":"reporting-events","link":"#reporting-events","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"id","slug":"id","link":"#id","children":[]},{"level":3,"title":"debug","slug":"debug","link":"#debug","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/google-analytics.md"}');export{e as data}; diff --git a/assets/google-analytics.html-p-WIn3G5.js b/assets/google-analytics.html-p-WIn3G5.js new file mode 100644 index 000000000..0bf14ea14 --- /dev/null +++ b/assets/google-analytics.html-p-WIn3G5.js @@ -0,0 +1,26 @@ +import{_ as i,r as o,o as t,c as r,d as e,a as s,b as n,e as a}from"./app-eU2v8o1B.js";const c={},d=s("h1",{id:"google-analytics",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#google-analytics","aria-hidden":"true"},"#"),n(" google-analytics")],-1),D={href:"https://analytics.google.com/",target:"_blank",rel:"noopener noreferrer"},u={href:"https://developers.google.com/analytics/devguides/collection/gtagjs",target:"_blank",rel:"noopener noreferrer"},y={href:"https://support.google.com/analytics/answer/10089681",target:"_blank",rel:"noopener noreferrer"},g=a(`export default { + plugins: [ + googleAnalyticsPlugin({ + id: 'G-XXXXXXXXXX', + debug: true, + }), + ], +} +
# 使用方法
npm i -D @vuepress/plugin-google-analytics@next +
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics' + +export default { + plugins: [ + googleAnalyticsPlugin({ + // 配置项 + }), + ], +} +
# 上报事件
`,4),h={href:"https://support.google.com/analytics/answer/9234069",target:"_blank",rel:"noopener noreferrer"},v=s("code",null,"page_view",-1),_=s("code",null,"first_visit",-1),b=s("p",null,[n("因此,如果你只是想收集站点的一些基础数据,你只需要正确设置 "),s("a",{href:"#id"},"Measurement ID"),n(" ,不需要再额外做其他事情。")],-1),m=s("code",null,"gtag()",-1),C=s("code",null,"window",-1),f={href:"https://developers.google.com/analytics/devguides/collection/ga4/events",target:"_blank",rel:"noopener noreferrer"},E=s("h2",{id:"配置项",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#配置项","aria-hidden":"true"},"#"),n(" 配置项")],-1),k=s("h3",{id:"id",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#id","aria-hidden":"true"},"#"),n(" id")],-1),x=s("li",null,[s("p",null,[n("类型: "),s("code",null,"string")])],-1),A=s("p",null,"详情:",-1),X=s("p",null,[n("Google Analytics 4 的 Measurement ID ,应以 "),s("code",null,"'G-'"),n(" 开头。")],-1),w={href:"https://support.google.com/analytics/answer/9539598",target:"_blank",rel:"noopener noreferrer"},G=s("li",null,[s("p",null,"示例:")],-1),I=a(`export default { + plugins: [ + googleAnalyticsPlugin({ + id: 'G-XXXXXXXXXX', + }), + ], +} +
# debug
`,2),F=s("li",null,[s("p",null,[n("类型: "),s("code",null,"boolean")])],-1),V=s("p",null,"详情:",-1),N=s("code",null,"true",-1),B={href:"https://support.google.com/analytics/answer/7201382",target:"_blank",rel:"noopener noreferrer"},P=s("li",null,[s("p",null,"示例:")],-1),M=a(``,1);function j(L,T){const p=o("NpmBadge"),l=o("ExternalLinkIcon");return t(),r("div",null,[d,e(p,{package:"@vuepress/plugin-google-analytics"}),s("p",null,[n("将 "),s("a",D,[n("Google Analytics"),e(l)]),n(" 集成到 VuePress 中。")]),s("p",null,[n("该插件会通过引入 "),s("a",u,[n("gtag.js"),e(l)]),n(" 来启用 "),s("a",y,[n("Google Analytics 4"),e(l)]),n(" 。")]),g,s("p",null,[n("Google Analytics 会 "),s("a",h,[n("自动收集部分事件"),e(l)]),n(" ,比如 "),v,n(", "),_,n(" 等。")]),b,s("p",null,[n("在引入该插件之后,一个全局的 "),m,n(" 函数会被挂载到 "),C,n(" 对象上,你可以使用它进行 "),s("a",f,[n("自定义事件的上报"),e(l)]),n(" 。")]),E,k,s("ul",null,[x,s("li",null,[A,X,s("p",null,[n("你可以通过 "),s("a",w,[n("这里"),e(l)]),n(' 的指引来找到你的 Measurement ID 。注意区分 Google Analytics 4 的 Measurement ID (即 "G-" 开头的 ID) 和 Universal Analytics 的 Tracking ID (即 "UA-" 开头的 ID)。')])]),G]),I,s("ul",null,[F,s("li",null,[V,s("p",null,[n("设置为 "),N,n(" 可以向 DebugView 发送事件。"),s("a",B,[n("了解更多关于 DebugView 的信息"),e(l)]),n(" 。")])]),P]),M])}const S=i(c,[["render",j],["__file","google-analytics.html.vue"]]);export{S as default}; diff --git a/assets/hero-RIx3NWRP.js b/assets/hero-RIx3NWRP.js new file mode 100644 index 000000000..d90d6d577 --- /dev/null +++ b/assets/hero-RIx3NWRP.js @@ -0,0 +1 @@ +const o="/images/hero.png";export{o as _}; diff --git a/assets/i18n.html-326CaaCk.js b/assets/i18n.html-326CaaCk.js new file mode 100644 index 000000000..de55b79e1 --- /dev/null +++ b/assets/i18n.html-326CaaCk.js @@ -0,0 +1,41 @@ +import{_ as o,r as c,o as i,c as r,a as n,b as s,d as l,w as e,e as p}from"./app-eU2v8o1B.js";const t={},D=p(`export default { + plugins: [ + googleAnalyticsPlugin({ + id: 'G-XXXXXXXXXX', + debug: true, + }), + ], +} +
# 多语言支持
# 站点多语言配置
要启用 VuePress 的多语言支持,首先需要使用如下的文件目录结构:
`,4),d=n("code",null,"locales",-1),y=p(`docs +├─ README.md +├─ foo.md +├─ nested +│ └─ README.md +└─ zh + ├─ README.md + ├─ foo.md + └─ nested + └─ README.md +
export default { + locales: { + // 键名是该语言所属的子路径 + // 作为特例,默认语言可以使用 '/' 作为其路径。 + '/': { + lang: 'en-US', + title: 'VuePress', + description: 'Vue-powered Static Site Generator', + }, + '/zh/': { + lang: 'zh-CN', + title: 'VuePress', + description: 'Vue 驱动的静态网站生成器', + }, + }, +} +
如果一个语言没有声明
`,2),v={class:"custom-container tip"},u=n("p",{class:"custom-container-title"},"提示",-1),m=p(`lang
,title
,description
或者head
,VuePress 将会尝试使用顶层配置的对应值。如果每个语言都声明了这些值,那么顶层配置中的对应值可以被省略。# 主题多语言配置
VuePress 没有限制主题如何提供多语言支持,因此每个主题可能会有不同的多语言配置方式,而且部分主题可能不会提供多语言支持。建议你查看主题本身的文档来获取更详细的指引。
如果你使用的是默认主题,那么它提供多语言支持的方式和上述是一致的:
`,4),C={class:"custom-container tip"},b=n("p",{class:"custom-container-title"},"提示",-1);function E(h,_){const a=c("RouterLink");return i(),r("div",null,[D,n("p",null,[s("然后,在你的 "),l(a,{to:"/zh/guide/configuration.html#%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"},{default:e(()=>[s("配置文件")]),_:1}),s(" 中设置 "),d,s(" 选项:")]),y,n("div",v,[u,n("p",null,[s("配置参考: "),l(a,{to:"/zh/reference/config.html#locales"},{default:e(()=>[s("locales")]),_:1})])]),m,n("div",C,[b,n("p",null,[s("配置参考: "),l(a,{to:"/zh/reference/default-theme/config.html#locales"},{default:e(()=>[s("默认主题 > locales")]),_:1})])])])}const g=o(t,[["render",E],["__file","i18n.html.vue"]]);export{g as default}; diff --git a/assets/i18n.html-5KgXR2re.js b/assets/i18n.html-5KgXR2re.js new file mode 100644 index 000000000..fc2db333d --- /dev/null +++ b/assets/i18n.html-5KgXR2re.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-acb10be2","path":"/guide/i18n.html","title":"I18n","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Site I18n Config","slug":"site-i18n-config","link":"#site-i18n-config","children":[]},{"level":2,"title":"Theme I18n Config","slug":"theme-i18n-config","link":"#theme-i18n-config","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"guide/i18n.md"}');export{e as data}; diff --git a/assets/i18n.html-s1H71rsL.js b/assets/i18n.html-s1H71rsL.js new file mode 100644 index 000000000..f252bb4e2 --- /dev/null +++ b/assets/i18n.html-s1H71rsL.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4b8f1400","path":"/zh/guide/i18n.html","title":"多语言支持","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"站点多语言配置","slug":"站点多语言配置","link":"#站点多语言配置","children":[]},{"level":2,"title":"主题多语言配置","slug":"主题多语言配置","link":"#主题多语言配置","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/guide/i18n.md"}');export{e as data}; diff --git a/assets/i18n.html-y-3sWUaJ.js b/assets/i18n.html-y-3sWUaJ.js new file mode 100644 index 000000000..ee88e274a --- /dev/null +++ b/assets/i18n.html-y-3sWUaJ.js @@ -0,0 +1,41 @@ +import{_ as p,r as c,o as i,c as t,a as n,b as s,d as e,w as l,e as o}from"./app-eU2v8o1B.js";const r={},D=o(`import { defaultTheme } from 'vuepress' + +export default { + theme: defaultTheme({ + locales: { + '/': { + selectLanguageName: 'English', + }, + '/zh/': { + selectLanguageName: '简体中文', + }, + }, + }), +} +
# I18n
# Site I18n Config
To take advantage of multi-language support in VuePress, you first need to use the following file and directory structure:
`,4),d=n("code",null,"locales",-1),u=o(`docs +├─ README.md +├─ foo.md +├─ nested +│ └─ README.md +└─ zh + ├─ README.md + ├─ foo.md + └─ nested + └─ README.md +
export default { + locales: { + // The key is the path for the locale to be nested under. + // As a special case, the default locale can use '/' as its path. + '/': { + lang: 'en-US', + title: 'VuePress', + description: 'Vue-powered Static Site Generator', + }, + '/zh/': { + lang: 'zh-CN', + title: 'VuePress', + description: 'Vue 驱动的静态网站生成器', + }, + }, +} +
If a locale does not have a
`,2),y={class:"custom-container tip"},v=n("p",{class:"custom-container-title"},"TIP",-1),m=o(`lang
,title
,description
orhead
, VuePress will fallback to the root-level values. You can omit the root level config as long as they are provided in each locale.# Theme I18n Config
VuePress does not restrict how themes provide multi-language support, so each theme may have different way to handle i18n, and some themes may not provide multi-language support at all. You'd better refer to the theme documentation for detailed guide.
If you are using default theme, the multi-language support is the same as above:
`,4),h={class:"custom-container tip"},C=n("p",{class:"custom-container-title"},"TIP",-1);function b(f,E){const a=c("RouterLink");return i(),t("div",null,[D,n("p",null,[s("Then, specify the "),d,s(" option in your "),e(a,{to:"/guide/configuration.html#config-file"},{default:l(()=>[s("config file")]),_:1}),s(":")]),u,n("div",y,[v,n("p",null,[s("Config reference: "),e(a,{to:"/reference/config.html#locales"},{default:l(()=>[s("locales")]),_:1})])]),m,n("div",h,[C,n("p",null,[s("Config reference: "),e(a,{to:"/reference/default-theme/config.html#locales"},{default:l(()=>[s("Default Theme > locales")]),_:1})])])])}const _=p(r,[["render",b],["__file","i18n.html.vue"]]);export{_ as default}; diff --git a/assets/index-QOy62Fup.js b/assets/index-QOy62Fup.js new file mode 100644 index 000000000..8855e2467 --- /dev/null +++ b/assets/index-QOy62Fup.js @@ -0,0 +1,17 @@ +/*! @docsearch/js 3.5.2 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */function ur(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function I(t){for(var e=1;eimport { defaultTheme } from 'vuepress' + +export default { + theme: defaultTheme({ + locales: { + '/': { + selectLanguageName: 'English', + }, + '/zh/': { + selectLanguageName: '简体中文', + }, + }, + }), +} +
=0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function se(t,e){return function(r){if(Array.isArray(r))return r}(t)||function(r,n){var o=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(o!=null){var i,a,c=[],u=!0,s=!1;try{for(o=o.call(r);!(u=(i=o.next()).done)&&(c.push(i.value),!n||c.length!==n);u=!0);}catch(l){s=!0,a=l}finally{try{u||o.return==null||o.return()}finally{if(s)throw a}}return c}}(t,e)||yn(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ft(t){return function(e){if(Array.isArray(e))return Lt(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||yn(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function yn(t,e){if(t){if(typeof t=="string")return Lt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Lt(t,e):void 0}}function Lt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r 3)for(r=[r],i=3;i 0?Ie(v.type,v.props,v.key,null,v.__v):v)!=null){if(v.__=r,v.__b=r.__b+1,(p=b[l])===null||p&&v.key==p.key&&v.type===p.type)b[l]=void 0;else for(m=0;m<_;m++){if((p=b[m])&&v.key==p.key&&v.type===p.type){b[m]=void 0;break}p=null}Yt(t,v,p=p||mt,o,i,a,c,u,s),d=v.__e,(m=v.ref)&&p.ref!=m&&(y||(y=[]),p.ref&&y.push(p.ref,null,v),y.push(m,v.__c||d,v)),d!=null?(h==null&&(h=d),typeof v.type=="function"&&v.__k!=null&&v.__k===p.__k?v.__d=u=jn(v,u,t):u=wn(t,v,p,b,d,u),s||r.type!=="option"?typeof r.type=="function"&&(r.__d=u):t.value=""):u&&p.__e==u&&u.parentNode!=t&&(u=We(p))}for(r.__e=h,l=_;l--;)b[l]!=null&&(typeof r.type=="function"&&b[l].__e!=null&&b[l].__e==r.__d&&(r.__d=We(n,l+1)),In(b[l],b[l]));if(y)for(l=0;l 3)for(r=[r],i=3;i =r.__.length&&r.__.push({}),r.__[t]}function kn(t){return pe=1,An(xn,t)}function An(t,e,r){var n=Je(de++,2);return n.t=t,n.__c||(n.__=[r?r(e):xn(void 0,e),function(o){var i=n.t(n.__[0],o);n.__[0]!==i&&(n.__=[i,n.__[1]],n.__c.setState({}))}],n.__c=q),n.__}function Cn(t,e){var r=Je(de++,3);!j.__s&&Gt(r.__H,e)&&(r.__=t,r.__H=e,q.__H.__h.push(r))}function gr(t,e){var r=Je(de++,4);!j.__s&&Gt(r.__H,e)&&(r.__=t,r.__H=e,q.__h.push(r))}function Pt(t,e){var r=Je(de++,7);return Gt(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function yo(){Ht.forEach(function(t){if(t.__P)try{t.__H.__h.forEach(ut),t.__H.__h.forEach(Ut),t.__H.__h=[]}catch(e){t.__H.__h=[],j.__e(e,t.__v)}}),Ht=[]}j.__b=function(t){q=null,pr&&pr(t)},j.__r=function(t){vr&&vr(t),de=0;var e=(q=t.__c).__H;e&&(e.__h.forEach(ut),e.__h.forEach(Ut),e.__h=[])},j.diffed=function(t){dr&&dr(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(Ht.push(e)!==1&&mr===j.requestAnimationFrame||((mr=j.requestAnimationFrame)||function(r){var n,o=function(){clearTimeout(i),br&&cancelAnimationFrame(n),setTimeout(r)},i=setTimeout(o,100);br&&(n=requestAnimationFrame(o))})(yo)),q=void 0},j.__c=function(t,e){e.some(function(r){try{r.__h.forEach(ut),r.__h=r.__h.filter(function(n){return!n.__||Ut(n)})}catch(n){e.some(function(o){o.__h&&(o.__h=[])}),e=[],j.__e(n,r.__v)}}),hr&&hr(t,e)},j.unmount=function(t){yr&&yr(t);var e=t.__c;if(e&&e.__H)try{e.__H.__.forEach(ut)}catch(r){j.__e(r,e.__v)}};var br=typeof requestAnimationFrame=="function";function ut(t){var e=q;typeof t.__c=="function"&&t.__c(),q=e}function Ut(t){var e=q;t.__c=t.__(),q=e}function Gt(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function xn(t,e){return typeof e=="function"?e(t):e}function Nn(t,e){for(var r in e)t[r]=e[r];return t}function Ft(t,e){for(var r in t)if(r!=="__source"&&!(r in e))return!0;for(var n in e)if(n!=="__source"&&t[n]!==e[n])return!0;return!1}function Bt(t){this.props=t}(Bt.prototype=new K).isPureReactComponent=!0,Bt.prototype.shouldComponentUpdate=function(t,e){return Ft(this.props,t)||Ft(this.state,e)};var _r=j.__b;j.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),_r&&_r(t)};var go=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,Or=function(t,e){return t==null?null:$($(t).map(e))},bo={map:Or,forEach:Or,count:function(t){return t?$(t).length:0},only:function(t){var e=$(t);if(e.length!==1)throw"Children.only";return e[0]},toArray:$},_o=j.__e;function ct(){this.__u=0,this.t=null,this.__b=null}function Tn(t){var e=t.__.__c;return e&&e.__e&&e.__e(t)}function we(){this.u=null,this.o=null}j.__e=function(t,e,r){if(t.then){for(var n,o=e;o=o.__;)if((n=o.__c)&&n.__c)return e.__e==null&&(e.__e=r.__e,e.__k=r.__k),n.__c(t,e)}_o(t,e,r)},(ct.prototype=new K).__c=function(t,e){var r=e.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var o=Tn(n.__v),i=!1,a=function(){i||(i=!0,r.componentWillUnmount=r.__c,o?o(c):c())};r.__c=r.componentWillUnmount,r.componentWillUnmount=function(){a(),r.__c&&r.__c()};var c=function(){if(!--n.__u){if(n.state.__e){var s=n.state.__e;n.__v.__k[0]=function m(p,v,d){return p&&(p.__v=null,p.__k=p.__k&&p.__k.map(function(h){return m(h,v,d)}),p.__c&&p.__c.__P===v&&(p.__e&&d.insertBefore(p.__e,p.__d),p.__c.__e=!0,p.__c.__P=d)),p}(s,s.__c.__P,s.__c.__O)}var l;for(n.setState({__e:n.__b=null});l=n.t.pop();)l.forceUpdate()}},u=e.__h===!0;n.__u++||u||n.setState({__e:n.__b=n.__v.__k[0]}),t.then(a,a)},ct.prototype.componentWillUnmount=function(){this.t=[]},ct.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=function i(a,c,u){return a&&(a.__c&&a.__c.__H&&(a.__c.__H.__.forEach(function(s){typeof s.__c=="function"&&s.__c()}),a.__c.__H=null),(a=Nn({},a)).__c!=null&&(a.__c.__P===u&&(a.__c.__P=c),a.__c=null),a.__k=a.__k&&a.__k.map(function(s){return i(s,c,u)})),a}(this.__b,r,n.__O=n.__P)}this.__b=null}var o=e.__e&&W(X,null,t.fallback);return o&&(o.__h=null),[W(X,null,e.__e?null:t.children),o]};var Sr=function(t,e,r){if(++r[1]===r[0]&&t.o.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.o.size))for(r=t.u;r;){for(;r.length>3;)r.pop()();if(r[1] >>1,1),e.i.removeChild(n)}}),Ke(W(Oo,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}function Rn(t,e){return W(So,{__v:t,i:e})}(we.prototype=new K).__e=function(t){var e=this,r=Tn(e.__v),n=e.o.get(t);return n[0]++,function(o){var i=function(){e.props.revealOrder?(n.push(o),Sr(e,t,n)):o()};r?r(i):i()}},we.prototype.render=function(t){this.u=null,this.o=new Map;var e=$(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var r=e.length;r--;)this.o.set(e[r],this.u=[1,0,this.u]);return t.children},we.prototype.componentDidUpdate=we.prototype.componentDidMount=function(){var t=this;this.o.forEach(function(e,r){Sr(t,r,e)})};var qn=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,jo=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,wo=function(t){return(typeof Symbol<"u"&&Ve(Symbol())=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(t)};function Ln(t,e,r){return e.__k==null&&(e.textContent=""),Ke(t,e),typeof r=="function"&&r(),t?t.__c:null}K.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(K.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var jr=j.event;function Eo(){}function Po(){return this.cancelBubble}function Io(){return this.defaultPrevented}j.event=function(t){return jr&&(t=jr(t)),t.persist=Eo,t.isPropagationStopped=Po,t.isDefaultPrevented=Io,t.nativeEvent=t};var Mn,wr={configurable:!0,get:function(){return this.class}},Er=j.vnode;j.vnode=function(t){var e=t.type,r=t.props,n=r;if(typeof e=="string"){for(var o in n={},r){var i=r[o];o==="value"&&"defaultValue"in r&&i==null||(o==="defaultValue"&&"value"in r&&r.value==null?o="value":o==="download"&&i===!0?i="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+e)&&!wo(r.type)?o="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(o)?o=o.toLowerCase():jo.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():i===null&&(i=void 0),n[o]=i)}e=="select"&&n.multiple&&Array.isArray(n.value)&&(n.value=$(r.children).forEach(function(a){a.props.selected=n.value.indexOf(a.props.value)!=-1})),e=="select"&&n.defaultValue!=null&&(n.value=$(r.children).forEach(function(a){a.props.selected=n.multiple?n.defaultValue.indexOf(a.props.value)!=-1:n.defaultValue==a.props.value})),t.props=n}e&&r.class!=r.className&&(wr.enumerable="className"in r,r.className!=null&&(n.class=r.className),Object.defineProperty(n,"className",wr)),t.$$typeof=qn,Er&&Er(t)};var Pr=j.__r;j.__r=function(t){Pr&&Pr(t),Mn=t.__c};var Do={ReactCurrentDispatcher:{current:{readContext:function(t){return Mn.__n[t.__c].props.value}}}};(typeof performance>"u"?"undefined":Ve(performance))=="object"&&typeof performance.now=="function"&&performance.now.bind(performance);function Ir(t){return!!t&&t.$$typeof===qn}var f={useState:kn,useReducer:An,useEffect:Cn,useLayoutEffect:gr,useRef:function(t){return pe=5,Pt(function(){return{current:t}},[])},useImperativeHandle:function(t,e,r){pe=6,gr(function(){typeof t=="function"?t(e()):t&&(t.current=e())},r==null?r:r.concat(t))},useMemo:Pt,useCallback:function(t,e){return pe=8,Pt(function(){return t},e)},useContext:function(t){var e=q.context[t.__c],r=Je(de++,9);return r.__c=t,e?(r.__==null&&(r.__=!0,e.sub(q)),e.props.value):t.__},useDebugValue:function(t,e){j.useDebugValue&&j.useDebugValue(e?e(t):t)},version:"16.8.0",Children:bo,render:Ln,hydrate:function(t,e,r){return Dn(t,e),typeof r=="function"&&r(),t?t.__c:null},unmountComponentAtNode:function(t){return!!t.__k&&(Ke(null,t),!0)},createPortal:Rn,createElement:W,createContext:function(t,e){var r={__c:e="__cC"+bn++,__:t,Consumer:function(n,o){return n.children(o)},Provider:function(n){var o,i;return this.getChildContext||(o=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&o.some(Mt)},this.sub=function(a){o.push(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){o.splice(o.indexOf(a),1),c&&c.call(a)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r},createFactory:function(t){return W.bind(null,t)},cloneElement:function(t){return Ir(t)?ho.apply(null,arguments):t},createRef:function(){return{current:null}},Fragment:X,isValidElement:Ir,findDOMNode:function(t){return t&&(t.base||t.nodeType===1&&t)||null},Component:K,PureComponent:Bt,memo:function(t,e){function r(o){var i=this.props.ref,a=i==o.ref;return!a&&i&&(i.call?i(null):i.current=null),e?!e(this.props,o)||!a:Ft(this.props,o)}function n(o){return this.shouldComponentUpdate=r,W(t,o)}return n.displayName="Memo("+(t.displayName||t.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n},forwardRef:function(t){function e(r,n){var o=Nn({},r);return delete o.ref,t(o,(n=r.ref||n)&&(Ve(n)!="object"||"current"in n)?n:null)}return e.$$typeof=go,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e},unstable_batchedUpdates:function(t,e){return t(e)},StrictMode:X,Suspense:ct,SuspenseList:we,lazy:function(t){var e,r,n;function o(i){if(e||(e=t()).then(function(a){r=a.default||a},function(a){n=a}),n)throw n;if(!r)throw e;return W(r,i)}return o.displayName="Lazy",o.__f=!0,o},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Do};function ko(){return f.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},f.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}function Hn(){return f.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},f.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}var Ao=["translations"];function Vt(){return Vt=Object.assign||function(t){for(var e=1;e t.length)&&(e=t.length);for(var r=0,n=new Array(e);r =0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var No=f.forwardRef(function(t,e){var r=t.translations,n=r===void 0?{}:r,o=xo(t,Ao),i=n.buttonText,a=i===void 0?"Search":i,c=n.buttonAriaLabel,u=c===void 0?"Search":c,s=Co(kn(null),2),l=s[0],m=s[1];return Cn(function(){typeof navigator<"u"&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?m("⌘"):m("Ctrl"))},[]),f.createElement("button",Vt({type:"button",className:"DocSearch DocSearch-Button","aria-label":u},o,{ref:e}),f.createElement("span",{className:"DocSearch-Button-Container"},f.createElement(Hn,null),f.createElement("span",{className:"DocSearch-Button-Placeholder"},a)),f.createElement("span",{className:"DocSearch-Button-Keys"},l!==null&&f.createElement(f.Fragment,null,f.createElement("kbd",{className:"DocSearch-Button-Key"},l==="Ctrl"?f.createElement(ko,null):l),f.createElement("kbd",{className:"DocSearch-Button-Key"},"K"))))});function Un(t,e){var r=void 0;return function(){for(var n=arguments.length,o=new Array(n),i=0;i t.length)&&(e=t.length);for(var r=0,n=new Array(e);r t.length)&&(e=t.length);for(var r=0,n=new Array(e);r =0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function xr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function ve(t){for(var e=1;e 1&&arguments[1]!==void 0?arguments[1]:20,r=[],n=0;n =3||r===2&&n>=4||r===1&&n>=10);function i(a,c,u){if(o&&u!==void 0){var s=u[0].__autocomplete_algoliaCredentials,l={"X-Algolia-Application-Id":s.appId,"X-Algolia-API-Key":s.apiKey};t.apply(void 0,[a].concat(Ge(c),[{headers:l}]))}else t.apply(void 0,[a].concat(Ge(c)))}return{init:function(a,c){t("init",{appId:a,apiKey:c})},setUserToken:function(a){t("setUserToken",a)},clickedObjectIDsAfterSearch:function(){for(var a=arguments.length,c=new Array(a),u=0;u0&&i("clickedObjectIDsAfterSearch",Xe(c),c[0].items)},clickedObjectIDs:function(){for(var a=arguments.length,c=new Array(a),u=0;u0&&i("clickedObjectIDs",Xe(c),c[0].items)},clickedFilters:function(){for(var a=arguments.length,c=new Array(a),u=0;u0&&t.apply(void 0,["clickedFilters"].concat(c))},convertedObjectIDsAfterSearch:function(){for(var a=arguments.length,c=new Array(a),u=0;u0&&i("convertedObjectIDsAfterSearch",Xe(c),c[0].items)},convertedObjectIDs:function(){for(var a=arguments.length,c=new Array(a),u=0;u0&&i("convertedObjectIDs",Xe(c),c[0].items)},convertedFilters:function(){for(var a=arguments.length,c=new Array(a),u=0;u0&&t.apply(void 0,["convertedFilters"].concat(c))},viewedObjectIDs:function(){for(var a=arguments.length,c=new Array(a),u=0;u0&&c.reduce(function(s,l){var m=l.items,p=Bn(l,Mo);return[].concat(Ge(s),Ge(Uo(ve(ve({},p),{},{objectIDs:(m==null?void 0:m.map(function(v){return v.objectID}))||p.objectIDs})).map(function(v){return{items:m,payload:v}})))},[]).forEach(function(s){var l=s.items;return i("viewedObjectIDs",[s.payload],l)})},viewedFilters:function(){for(var a=arguments.length,c=new Array(a),u=0;u0&&t.apply(void 0,["viewedFilters"].concat(c))}}}function Bo(t){var e=t.items.reduce(function(r,n){var o;return r[n.__autocomplete_indexName]=((o=r[n.__autocomplete_indexName])!==null&&o!==void 0?o:[]).concat(n),r},{});return Object.keys(e).map(function(r){return{index:r,items:e[r],algoliaSource:["autocomplete"]}})}function Dt(t){return t.objectID&&t.__autocomplete_indexName&&t.__autocomplete_queryID}function ke(t){return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke(t)}function ie(t){return function(e){if(Array.isArray(e))return kt(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,r){if(e){if(typeof e=="string")return kt(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kt(e,r)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function kt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r 0&&Ko({onItemsChange:n,items:p,insights:c,state:m}))}},0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(l){var m=l.setContext,p=l.onSelect,v=l.onActive;a("addAlgoliaAgent","insights-plugin"),m({algoliaInsightsPlugin:{__algoliaSearchParameters:{clickAnalytics:!0},insights:c}}),p(function(d){var h=d.item,y=d.state,b=d.event;Dt(h)&&o({state:y,event:b,insights:c,item:h,insightsEvents:[G({eventName:"Item Selected"},Ar({item:h,items:u.current}))]})}),v(function(d){var h=d.item,y=d.state,b=d.event;Dt(h)&&i({state:y,event:b,insights:c,item:h,insightsEvents:[G({eventName:"Item Active"},Ar({item:h,items:u.current}))]})})},onStateChange:function(l){var m=l.state;s({state:m})},__autocomplete_pluginOptions:t}}function lt(t,e){var r=e;return{then:function(n,o){return lt(t.then(et(n,r,t),et(o,r,t)),r)},catch:function(n){return lt(t.catch(et(n,r,t)),r)},finally:function(n){return n&&r.onCancelList.push(n),lt(t.finally(et(n&&function(){return r.onCancelList=[],n()},r,t)),r)},cancel:function(){r.isCanceled=!0;var n=r.onCancelList;r.onCancelList=[],n.forEach(function(o){o()})},isCanceled:function(){return r.isCanceled===!0}}}function Tr(t){return lt(t,{isCanceled:!1,onCancelList:[]})}function et(t,e,r){return t?function(n){return e.isCanceled?n:t(n)}:r}function Rr(t,e,r,n){if(!r)return null;if(t<0&&(e===null||n!==null&&e===0))return r+t;var o=(e===null?-1:e)+t;return o<=-1||o>=r?n===null?null:0:o}function qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function Lr(t){for(var e=1;e t.length)&&(e=t.length);for(var r=0,n=new Array(e);r 0},reshape:function(i){return i.sources}},t),{},{id:(r=t.id)!==null&&r!==void 0?r:"autocomplete-".concat(To++),plugins:o,initialState:ae({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},t.initialState),onStateChange:function(i){var a;(a=t.onStateChange)===null||a===void 0||a.call(t,i),o.forEach(function(c){var u;return(u=c.onStateChange)===null||u===void 0?void 0:u.call(c,i)})},onSubmit:function(i){var a;(a=t.onSubmit)===null||a===void 0||a.call(t,i),o.forEach(function(c){var u;return(u=c.onSubmit)===null||u===void 0?void 0:u.call(c,i)})},onReset:function(i){var a;(a=t.onReset)===null||a===void 0||a.call(t,i),o.forEach(function(c){var u;return(u=c.onReset)===null||u===void 0?void 0:u.call(c,i)})},getSources:function(i){return Promise.all([].concat(Go(o.map(function(a){return a.getSources})),[t.getSources]).filter(Boolean).map(function(a){return function(c,u){var s=[];return Promise.resolve(c(u)).then(function(l){return Promise.all(l.filter(function(m){return!!m}).map(function(m){if(m.sourceId,s.includes(m.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(m.sourceId)," is not unique."));s.push(m.sourceId);var p={getItemInputValue:function(d){return d.state.query},getItemUrl:function(){},onSelect:function(d){(0,d.setIsOpen)(!1)},onActive:vt,onResolve:vt};Object.keys(p).forEach(function(d){p[d].__default=!0});var v=Lr(Lr({},p),m);return Promise.resolve(v)}))})}(a,i)})).then(function(a){return ze(a)}).then(function(a){return a.map(function(c){return ae(ae({},c),{},{onSelect:function(u){c.onSelect(u),e.forEach(function(s){var l;return(l=s.onSelect)===null||l===void 0?void 0:l.call(s,u)})},onActive:function(u){c.onActive(u),e.forEach(function(s){var l;return(l=s.onActive)===null||l===void 0?void 0:l.call(s,u)})},onResolve:function(u){c.onResolve(u),e.forEach(function(s){var l;return(l=s.onResolve)===null||l===void 0?void 0:l.call(s,u)})}})})})},navigator:ae({navigate:function(i){var a=i.itemUrl;n.location.assign(a)},navigateNewTab:function(i){var a=i.itemUrl,c=n.open(a,"_blank","noopener");c==null||c.focus()},navigateNewWindow:function(i){var a=i.itemUrl;n.open(a,"_blank","noopener")}},t.navigator)})}function Te(t){return Te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Te(t)}function Fr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function rt(t){for(var e=1;e t.length)&&(e=t.length);for(var r=0,n=new Array(e);r =0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var Wr,xt,ot,je=null,Kr=(Wr=-1,xt=-1,ot=void 0,function(t){var e=++Wr;return Promise.resolve(t).then(function(r){return ot&&e =0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Me(t){return Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(t)}var fi=["props","refresh","store"],mi=["inputElement","formElement","panelElement"],pi=["inputElement"],vi=["inputElement","maxLength"],di=["sourceIndex"],hi=["sourceIndex"],yi=["item","source","sourceIndex"];function Jr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function R(t){for(var e=1;e =0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function bi(t){var e=t.props,r=t.refresh,n=t.store,o=re(t,fi),i=function(a,c){return c!==void 0?"".concat(a,"-").concat(c):a};return{getEnvironmentProps:function(a){var c=a.inputElement,u=a.formElement,s=a.panelElement;function l(m){!n.getState().isOpen&&n.pendingRequests.isEmpty()||m.target===c||[u,s].some(function(p){return v=p,d=m.target,v===d||v.contains(d);var v,d})===!1&&(n.dispatch("blur",null),e.debug||n.pendingRequests.cancelAll())}return R({onTouchStart:l,onMouseDown:l,onTouchMove:function(m){n.getState().isOpen!==!1&&c===e.environment.document.activeElement&&m.target!==c&&c.blur()}},re(a,mi))},getRootProps:function(a){return R({role:"combobox","aria-expanded":n.getState().isOpen,"aria-haspopup":"listbox","aria-owns":n.getState().isOpen?"".concat(e.id,"-list"):void 0,"aria-labelledby":"".concat(e.id,"-label")},a)},getFormProps:function(a){return a.inputElement,R({action:"",noValidate:!0,role:"search",onSubmit:function(c){var u;c.preventDefault(),e.onSubmit(R({event:c,refresh:r,state:n.getState()},o)),n.dispatch("submit",null),(u=a.inputElement)===null||u===void 0||u.blur()},onReset:function(c){var u;c.preventDefault(),e.onReset(R({event:c,refresh:r,state:n.getState()},o)),n.dispatch("reset",null),(u=a.inputElement)===null||u===void 0||u.focus()}},re(a,pi))},getLabelProps:function(a){var c=a||{},u=c.sourceIndex,s=re(c,di);return R({htmlFor:"".concat(i(e.id,u),"-input"),id:"".concat(i(e.id,u),"-label")},s)},getInputProps:function(a){var c;function u(y){(e.openOnFocus||n.getState().query)&&le(R({event:y,props:e,query:n.getState().completion||n.getState().query,refresh:r,store:n},o)),n.dispatch("focus",null)}var s=a||{},l=(s.inputElement,s.maxLength),m=l===void 0?512:l,p=re(s,vi),v=fe(n.getState()),d=function(y){return!!(y&&y.match($o))}(((c=e.environment.navigator)===null||c===void 0?void 0:c.userAgent)||""),h=v!=null&&v.itemUrl&&!d?"go":"search";return R({"aria-autocomplete":"both","aria-activedescendant":n.getState().isOpen&&n.getState().activeItemId!==null?"".concat(e.id,"-item-").concat(n.getState().activeItemId):void 0,"aria-controls":n.getState().isOpen?"".concat(e.id,"-list"):void 0,"aria-labelledby":"".concat(e.id,"-label"),value:n.getState().completion||n.getState().query,id:"".concat(e.id,"-input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:h,spellCheck:"false",autoFocus:e.autoFocus,placeholder:e.placeholder,maxLength:m,type:"search",onChange:function(y){le(R({event:y,props:e,query:y.currentTarget.value.slice(0,m),refresh:r,store:n},o))},onKeyDown:function(y){(function(b){var _=b.event,S=b.props,O=b.refresh,g=b.store,P=si(b,ci);if(_.key==="ArrowUp"||_.key==="ArrowDown"){var C=function(){var M=S.environment.document.getElementById("".concat(S.id,"-item-").concat(g.getState().activeItemId));M&&(M.scrollIntoViewIfNeeded?M.scrollIntoViewIfNeeded(!1):M.scrollIntoView(!1))},L=function(){var M=fe(g.getState());if(g.getState().activeItemId!==null&&M){var Ot=M.item,St=M.itemInputValue,$e=M.itemUrl,B=M.source;B.onActive(te({event:_,item:Ot,itemInputValue:St,itemUrl:$e,refresh:O,source:B,state:g.getState()},P))}};_.preventDefault(),g.getState().isOpen===!1&&(S.openOnFocus||g.getState().query)?le(te({event:_,props:S,query:g.getState().query,refresh:O,store:g},P)).then(function(){g.dispatch(_.key,{nextActiveItemId:S.defaultActiveItemId}),L(),setTimeout(C,0)}):(g.dispatch(_.key,{}),L(),C())}else if(_.key==="Escape")_.preventDefault(),g.dispatch(_.key,null),g.pendingRequests.cancelAll();else if(_.key==="Tab")g.dispatch("blur",null),g.pendingRequests.cancelAll();else if(_.key==="Enter"){if(g.getState().activeItemId===null||g.getState().collections.every(function(M){return M.items.length===0}))return void(S.debug||g.pendingRequests.cancelAll());_.preventDefault();var x=fe(g.getState()),k=x.item,N=x.itemInputValue,U=x.itemUrl,F=x.source;if(_.metaKey||_.ctrlKey)U!==void 0&&(F.onSelect(te({event:_,item:k,itemInputValue:N,itemUrl:U,refresh:O,source:F,state:g.getState()},P)),S.navigator.navigateNewTab({itemUrl:U,item:k,state:g.getState()}));else if(_.shiftKey)U!==void 0&&(F.onSelect(te({event:_,item:k,itemInputValue:N,itemUrl:U,refresh:O,source:F,state:g.getState()},P)),S.navigator.navigateNewWindow({itemUrl:U,item:k,state:g.getState()}));else if(!_.altKey){if(U!==void 0)return F.onSelect(te({event:_,item:k,itemInputValue:N,itemUrl:U,refresh:O,source:F,state:g.getState()},P)),void S.navigator.navigate({itemUrl:U,item:k,state:g.getState()});le(te({event:_,nextState:{isOpen:!1},props:S,query:N,refresh:O,store:g},P)).then(function(){F.onSelect(te({event:_,item:k,itemInputValue:N,itemUrl:U,refresh:O,source:F,state:g.getState()},P))})}}})(R({event:y,props:e,refresh:r,store:n},o))},onFocus:u,onBlur:vt,onClick:function(y){a.inputElement!==e.environment.document.activeElement||n.getState().isOpen||u(y)}},p)},getPanelProps:function(a){return R({onMouseDown:function(c){c.preventDefault()},onMouseLeave:function(){n.dispatch("mouseleave",null)}},a)},getListProps:function(a){var c=a||{},u=c.sourceIndex,s=re(c,hi);return R({role:"listbox","aria-labelledby":"".concat(i(e.id,u),"-label"),id:"".concat(i(e.id,u),"-list")},s)},getItemProps:function(a){var c=a.item,u=a.source,s=a.sourceIndex,l=re(a,yi);return R({id:"".concat(i(e.id,s),"-item-").concat(c.__autocomplete_id),role:"option","aria-selected":n.getState().activeItemId===c.__autocomplete_id,onMouseMove:function(m){if(c.__autocomplete_id!==n.getState().activeItemId){n.dispatch("mousemove",c.__autocomplete_id);var p=fe(n.getState());if(n.getState().activeItemId!==null&&p){var v=p.item,d=p.itemInputValue,h=p.itemUrl,y=p.source;y.onActive(R({event:m,item:v,itemInputValue:d,itemUrl:h,refresh:r,source:y,state:n.getState()},o))}}},onMouseDown:function(m){m.preventDefault()},onClick:function(m){var p=u.getItemInputValue({item:c,state:n.getState()}),v=u.getItemUrl({item:c,state:n.getState()});(v?Promise.resolve():le(R({event:m,nextState:{isOpen:!1},props:e,query:p,refresh:r,store:n},o))).then(function(){u.onSelect(R({event:m,item:c,itemInputValue:p,itemUrl:v,refresh:r,source:u,state:n.getState()},o))})}},l)}}}function He(t){return He=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},He(t)}function $r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function _i(t){for(var e=1;e t.length)&&(e=t.length);for(var r=0,n=new Array(e);r =0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Bi(t){var e=t.translations,r=e===void 0?{}:e,n=Fi(t,Hi),o=r.noResultsText,i=o===void 0?"No results for":o,a=r.suggestedQueryText,c=a===void 0?"Try searching for":a,u=r.reportMissingResultsText,s=u===void 0?"Believe this query should return results?":u,l=r.reportMissingResultsLinkText,m=l===void 0?"Let us know.":l,p=n.state.context.searchSuggestions;return f.createElement("div",{className:"DocSearch-NoResults"},f.createElement("div",{className:"DocSearch-Screen-Icon"},f.createElement(Li,null)),f.createElement("p",{className:"DocSearch-Title"},i,' "',f.createElement("strong",null,n.state.query),'"'),p&&p.length>0&&f.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},f.createElement("p",{className:"DocSearch-Help"},c,":"),f.createElement("ul",null,p.slice(0,3).reduce(function(v,d){return[].concat(Ui(v),[f.createElement("li",{key:d},f.createElement("button",{className:"DocSearch-Prefill",key:d,type:"button",onClick:function(){n.setQuery(d.toLowerCase()+" "),n.refresh(),n.inputRef.current.focus()}},d))])},[]))),n.getMissingResultsUrl&&f.createElement("p",{className:"DocSearch-Help"},"".concat(s," "),f.createElement("a",{href:n.getMissingResultsUrl({query:n.state.query}),target:"_blank",rel:"noopener noreferrer"},m)))}var Vi=["hit","attribute","tagName"];function Xr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function en(t){for(var e=1;e =0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function tn(t,e){return e.split(".").reduce(function(r,n){return r!=null&&r[n]?r[n]:null},t)}function ce(t){var e=t.hit,r=t.attribute,n=t.tagName;return W(n===void 0?"span":n,en(en({},Ki(t,Vi)),{},{dangerouslySetInnerHTML:{__html:tn(e,"_snippetResult.".concat(r,".value"))||tn(e,r)}}))}function rn(t,e){return function(r){if(Array.isArray(r))return r}(t)||function(r,n){var o=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(o!=null){var i,a,c=[],u=!0,s=!1;try{for(o=o.call(r);!(u=(i=o.next()).done)&&(c.push(i.value),!n||c.length!==n);u=!0);}catch(l){s=!0,a=l}finally{try{u||o.return==null||o.return()}finally{if(s)throw a}}return c}}(t,e)||function(r,n){if(r){if(typeof r=="string")return nn(r,n);var o=Object.prototype.toString.call(r).slice(8,-1);if(o==="Object"&&r.constructor&&(o=r.constructor.name),o==="Map"||o==="Set")return Array.from(r);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return nn(r,n)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function nn(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r |<\/mark>)/g,$i=RegExp(zn.source);function Jn(t){var e,r,n=t;if(!n.__docsearch_parent&&!t._highlightResult)return t.hierarchy.lvl0;var o=((n.__docsearch_parent?(e=n.__docsearch_parent)===null||e===void 0||(e=e._highlightResult)===null||e===void 0||(e=e.hierarchy)===null||e===void 0?void 0:e.lvl0:(r=t._highlightResult)===null||r===void 0||(r=r.hierarchy)===null||r===void 0?void 0:r.lvl0)||{}).value;return o&&$i.test(o)?o.replace(zn,""):o}function Jt(){return Jt=Object.assign||function(t){for(var e=1;e =0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Gi(t){var e=t.translations,r=e===void 0?{}:e,n=Yi(t,Zi),o=r.recentSearchesTitle,i=o===void 0?"Recent":o,a=r.noRecentSearchesText,c=a===void 0?"No recent searches":a,u=r.saveRecentSearchButtonTitle,s=u===void 0?"Save this search":u,l=r.removeRecentSearchButtonTitle,m=l===void 0?"Remove this search from history":l,p=r.favoriteSearchesTitle,v=p===void 0?"Favorite":p,d=r.removeFavoriteSearchButtonTitle,h=d===void 0?"Remove this search from favorites":d;return n.state.status==="idle"&&n.hasCollections===!1?n.disableUserPersonalization?null:f.createElement("div",{className:"DocSearch-StartScreen"},f.createElement("p",{className:"DocSearch-Help"},c)):n.hasCollections===!1?null:f.createElement("div",{className:"DocSearch-Dropdown-Container"},f.createElement(zt,ht({},n,{title:i,collection:n.state.collections[0],renderIcon:function(){return f.createElement("div",{className:"DocSearch-Hit-icon"},f.createElement(Ai,null))},renderAction:function(y){var b=y.item,_=y.runFavoriteTransition,S=y.runDeleteTransition;return f.createElement(f.Fragment,null,f.createElement("div",{className:"DocSearch-Hit-action"},f.createElement("button",{className:"DocSearch-Hit-action-button",title:s,type:"submit",onClick:function(O){O.preventDefault(),O.stopPropagation(),_(function(){n.favoriteSearches.add(b),n.recentSearches.remove(b),n.refresh()})}},f.createElement(Gr,null))),f.createElement("div",{className:"DocSearch-Hit-action"},f.createElement("button",{className:"DocSearch-Hit-action-button",title:m,type:"submit",onClick:function(O){O.preventDefault(),O.stopPropagation(),S(function(){n.recentSearches.remove(b),n.refresh()})}},f.createElement(Kt,null))))}})),f.createElement(zt,ht({},n,{title:v,collection:n.state.collections[1],renderIcon:function(){return f.createElement("div",{className:"DocSearch-Hit-icon"},f.createElement(Gr,null))},renderAction:function(y){var b=y.item,_=y.runDeleteTransition;return f.createElement("div",{className:"DocSearch-Hit-action"},f.createElement("button",{className:"DocSearch-Hit-action-button",title:h,type:"submit",onClick:function(S){S.preventDefault(),S.stopPropagation(),_(function(){n.favoriteSearches.remove(b),n.refresh()})}},f.createElement(Kt,null)))}})))}var Xi=["translations"];function yt(){return yt=Object.assign||function(t){for(var e=1;e =0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var ta=f.memo(function(t){var e=t.translations,r=e===void 0?{}:e,n=ea(t,Xi);if(n.state.status==="error")return f.createElement(Mi,{translations:r==null?void 0:r.errorScreen});var o=n.state.collections.some(function(i){return i.items.length>0});return n.state.query?o===!1?f.createElement(Bi,yt({},n,{translations:r==null?void 0:r.noResultsScreen})):f.createElement(Qi,n):f.createElement(Gi,yt({},n,{hasCollections:o,translations:r==null?void 0:r.startScreen}))},function(t,e){return e.state.status==="loading"||e.state.status==="stalled"}),ra=["translations"];function gt(){return gt=Object.assign||function(t){for(var e=1;e =0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function oa(t){var e=t.translations,r=e===void 0?{}:e,n=na(t,ra),o=r.resetButtonTitle,i=o===void 0?"Clear the query":o,a=r.resetButtonAriaLabel,c=a===void 0?"Clear the query":a,u=r.cancelButtonText,s=u===void 0?"Cancel":u,l=r.cancelButtonAriaLabel,m=l===void 0?"Cancel":l,p=n.getFormProps({inputElement:n.inputRef.current}).onReset;return f.useEffect(function(){n.autoFocus&&n.inputRef.current&&n.inputRef.current.focus()},[n.autoFocus,n.inputRef]),f.useEffect(function(){n.isFromSelection&&n.inputRef.current&&n.inputRef.current.select()},[n.isFromSelection,n.inputRef]),f.createElement(f.Fragment,null,f.createElement("form",{className:"DocSearch-Form",onSubmit:function(v){v.preventDefault()},onReset:p},f.createElement("label",gt({className:"DocSearch-MagnifierLabel"},n.getLabelProps()),f.createElement(Hn,null)),f.createElement("div",{className:"DocSearch-LoadingIndicator"},f.createElement(ki,null)),f.createElement("input",gt({className:"DocSearch-Input",ref:n.inputRef},n.getInputProps({inputElement:n.inputRef.current,autoFocus:n.autoFocus,maxLength:64}))),f.createElement("button",{type:"reset",title:i,className:"DocSearch-Reset","aria-label":c,hidden:!n.state.query},f.createElement(Kt,null))),f.createElement("button",{className:"DocSearch-Cancel",type:"reset","aria-label":m,onClick:n.onClose},s))}var ia=["_highlightResult","_snippetResult"];function aa(t,e){if(t==null)return{};var r,n,o=function(a,c){if(a==null)return{};var u,s,l={},m=Object.keys(a);for(s=0;s =0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function ua(t){return function(){var e="__TEST_KEY__";try{return localStorage.setItem(e,""),localStorage.removeItem(e),!0}catch{return!1}}()===!1?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(e){return window.localStorage.setItem(t,JSON.stringify(e))},getItem:function(){var e=window.localStorage.getItem(t);return e?JSON.parse(e):[]}}}function un(t){var e=t.key,r=t.limit,n=r===void 0?5:r,o=ua(e),i=o.getItem().slice(0,n);return{add:function(a){var c=a,u=(c._highlightResult,c._snippetResult,aa(c,ia)),s=i.findIndex(function(l){return l.objectID===u.objectID});s>-1&&i.splice(s,1),i.unshift(u),i=i.slice(0,n),o.setItem(i)},remove:function(a){i=i.filter(function(c){return c.objectID!==a.objectID}),o.setItem(i)},getAll:function(){return i}}}var ca=["facetName","facetQuery"];function la(t){var e,r="algoliasearch-client-js-".concat(t.key),n=function(){return e===void 0&&(e=t.localStorage||window.localStorage),e},o=function(){return JSON.parse(n().getItem(r)||"{}")},i=function(c){n().setItem(r,JSON.stringify(c))},a=function(){var c=t.timeToLive?1e3*t.timeToLive:null,u=o(),s=Object.fromEntries(Object.entries(u).filter(function(m){return se(m,2)[1].timestamp!==void 0}));if(i(s),c){var l=Object.fromEntries(Object.entries(s).filter(function(m){var p=se(m,2)[1],v=new Date().getTime();return!(p.timestamp+c 2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){a();var l=JSON.stringify(c);return o()[l]}).then(function(l){return Promise.all([l?l.value:u(),l!==void 0])}).then(function(l){var m=se(l,2),p=m[0],v=m[1];return Promise.all([p,v||s.miss(p)])}).then(function(l){return se(l,1)[0]})},set:function(c,u){return Promise.resolve().then(function(){var s=o();return s[JSON.stringify(c)]={timestamp:new Date().getTime(),value:u},n().setItem(r,JSON.stringify(s)),u})},delete:function(c){return Promise.resolve().then(function(){var u=o();delete u[JSON.stringify(c)],n().setItem(r,JSON.stringify(u))})},clear:function(){return Promise.resolve().then(function(){n().removeItem(r)})}}}function Ee(t){var e=ft(t.caches),r=e.shift();return r===void 0?{get:function(n,o){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return o().then(function(a){return Promise.all([a,i.miss(a)])}).then(function(a){return se(a,1)[0]})},set:function(n,o){return Promise.resolve(o)},delete:function(n){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(n,o){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(n,o,i).catch(function(){return Ee({caches:e}).get(n,o,i)})},set:function(n,o){return r.set(n,o).catch(function(){return Ee({caches:e}).set(n,o)})},delete:function(n){return r.delete(n).catch(function(){return Ee({caches:e}).delete(n)})},clear:function(){return r.clear().catch(function(){return Ee({caches:e}).clear()})}}}function Tt(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},e={};return{get:function(r,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},i=JSON.stringify(r);if(i in e)return Promise.resolve(t.serializable?JSON.parse(e[i]):e[i]);var a=n(),c=o&&o.miss||function(){return Promise.resolve()};return a.then(function(u){return c(u)}).then(function(){return a})},set:function(r,n){return e[JSON.stringify(r)]=t.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(r){return delete e[JSON.stringify(r)],Promise.resolve()},clear:function(){return e={},Promise.resolve()}}}function sa(t){for(var e=t.length-1;e>0;e--){var r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}function $n(t,e){return e&&Object.keys(e).forEach(function(r){t[r]=e[r](t)}),t}function bt(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n 0?n:void 0,timeout:r.timeout||e,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var me={Read:1,Write:2,Any:3},Qn=1,fa=2,Zn=3;function Yn(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qn;return I(I({},t),{},{status:e,lastUpdate:Date.now()})}function Gn(t){return typeof t=="string"?{protocol:"https",url:t,accept:me.Any}:{protocol:t.protocol||"https",url:t.url,accept:t.accept||me.Any}}var $t="GET",_t="POST";function ma(t,e){return Promise.all(e.map(function(r){return t.get(r,function(){return Promise.resolve(Yn(r))})})).then(function(r){var n=r.filter(function(a){return function(c){return c.status===Qn||Date.now()-c.lastUpdate>12e4}(a)}),o=r.filter(function(a){return function(c){return c.status===Zn&&Date.now()-c.lastUpdate<=12e4}(a)}),i=[].concat(ft(n),ft(o));return{getTimeout:function(a,c){return(o.length===0&&a===0?1:o.length+3+a)*c},statelessHosts:i.length>0?i.map(function(a){return Gn(a)}):e}})}function ln(t,e,r,n){var o=[],i=function(p,v){if(!(p.method===$t||p.data===void 0&&v.data===void 0)){var d=Array.isArray(p.data)?p.data:I(I({},p.data),v.data);return JSON.stringify(d)}}(r,n),a=function(p,v){var d=I(I({},p.headers),v.headers),h={};return Object.keys(d).forEach(function(y){var b=d[y];h[y.toLowerCase()]=b}),h}(t,n),c=r.method,u=r.method!==$t?{}:I(I({},r.data),n.data),s=I(I(I({"x-algolia-agent":t.userAgent.value},t.queryParameters),u),n.queryParameters),l=0,m=function p(v,d){var h=v.pop();if(h===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:sn(o)};var y={data:i,headers:a,method:c,url:va(h,r.path,s),connectTimeout:d(l,t.timeouts.connect),responseTimeout:d(l,n.timeout)},b=function(S){var O={request:y,response:S,host:h,triesLeft:v.length};return o.push(O),O},_={onSuccess:function(S){return function(O){try{return JSON.parse(O.content)}catch(g){throw function(P,C){return{name:"DeserializationError",message:P,response:C}}(g.message,O)}}(S)},onRetry:function(S){var O=b(S);return S.isTimedOut&&l++,Promise.all([t.logger.info("Retryable failure",eo(O)),t.hostsCache.set(h,Yn(h,S.isTimedOut?Zn:fa))]).then(function(){return p(v,d)})},onFail:function(S){throw b(S),function(O,g){var P=O.content,C=O.status,L=P;try{L=JSON.parse(P).message}catch{}return function(x,k,N){return{name:"ApiError",message:x,status:k,transporterStackTrace:N}}(L,C,g)}(S,sn(o))}};return t.requester.send(y).then(function(S){return function(O,g){return function(P){var C=P.status;return P.isTimedOut||function(L){var x=L.isTimedOut,k=L.status;return!x&&~~k==0}(P)||~~(C/100)!=2&&~~(C/100)!=4}(O)?g.onRetry(O):~~(O.status/100)==2?g.onSuccess(O):g.onFail(O)}(S,_)})};return ma(t.hostsCache,e).then(function(p){return m(ft(p.statelessHosts).reverse(),p.getTimeout)})}function pa(t){var e={value:"Algolia for JavaScript (".concat(t,")"),add:function(r){var n="; ".concat(r.segment).concat(r.version!==void 0?" (".concat(r.version,")"):"");return e.value.indexOf(n)===-1&&(e.value="".concat(e.value).concat(n)),e}};return e}function va(t,e,r){var n=Xn(r),o="".concat(t.protocol,"://").concat(t.url,"/").concat(e.charAt(0)==="/"?e.substr(1):e);return n.length&&(o+="?".concat(n)),o}function Xn(t){return Object.keys(t).map(function(e){return bt("%s=%s",e,(r=t[e],Object.prototype.toString.call(r)==="[object Object]"||Object.prototype.toString.call(r)==="[object Array]"?JSON.stringify(t[e]):t[e]));var r}).join("&")}function sn(t){return t.map(function(e){return eo(e)})}function eo(t){var e=t.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return I(I({},t),{},{request:I(I({},t.request),{},{headers:I(I({},t.request.headers),e)})})}var da=function(t){var e=t.appId,r=function(i,a,c){var u={"x-algolia-api-key":c,"x-algolia-application-id":a};return{headers:function(){return i===st.WithinHeaders?u:{}},queryParameters:function(){return i===st.WithinQueryParameters?u:{}}}}(t.authMode!==void 0?t.authMode:st.WithinHeaders,e,t.apiKey),n=function(i){var a=i.hostsCache,c=i.logger,u=i.requester,s=i.requestsCache,l=i.responsesCache,m=i.timeouts,p=i.userAgent,v=i.hosts,d=i.queryParameters,h={hostsCache:a,logger:c,requester:u,requestsCache:s,responsesCache:l,timeouts:m,userAgent:p,headers:i.headers,queryParameters:d,hosts:v.map(function(y){return Gn(y)}),read:function(y,b){var _=cn(b,h.timeouts.read),S=function(){return ln(h,h.hosts.filter(function(g){return(g.accept&me.Read)!=0}),y,_)};if((_.cacheable!==void 0?_.cacheable:y.cacheable)!==!0)return S();var O={request:y,mappedRequestOptions:_,transporter:{queryParameters:h.queryParameters,headers:h.headers}};return h.responsesCache.get(O,function(){return h.requestsCache.get(O,function(){return h.requestsCache.set(O,S()).then(function(g){return Promise.all([h.requestsCache.delete(O),g])},function(g){return Promise.all([h.requestsCache.delete(O),Promise.reject(g)])}).then(function(g){var P=se(g,2);return P[0],P[1]})})},{miss:function(g){return h.responsesCache.set(O,g)}})},write:function(y,b){return ln(h,h.hosts.filter(function(_){return(_.accept&me.Write)!=0}),y,cn(b,h.timeouts.write))}};return h}(I(I({hosts:[{url:"".concat(e,"-dsn.algolia.net"),accept:me.Read},{url:"".concat(e,".algolia.net"),accept:me.Write}].concat(sa([{url:"".concat(e,"-1.algolianet.com")},{url:"".concat(e,"-2.algolianet.com")},{url:"".concat(e,"-3.algolianet.com")}]))},t),{},{headers:I(I(I({},r.headers()),{"content-type":"application/x-www-form-urlencoded"}),t.headers),queryParameters:I(I({},r.queryParameters()),t.queryParameters)})),o={transporter:n,appId:e,addAlgoliaAgent:function(i,a){n.userAgent.add({segment:i,version:a})},clearCache:function(){return Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then(function(){})}};return $n(o,t.methods)},ha=function(t){return function(e,r){return e.method===$t?t.transporter.read(e,r):t.transporter.write(e,r)}},to=function(t){return function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={transporter:t.transporter,appId:t.appId,indexName:e};return $n(n,r.methods)}},fn=function(t){return function(e,r){var n=e.map(function(o){return I(I({},o),{},{params:Xn(o.params||{})})});return t.transporter.read({method:_t,path:"1/indexes/*/queries",data:{requests:n},cacheable:!0},r)}},mn=function(t){return function(e,r){return Promise.all(e.map(function(n){var o=n.params,i=o.facetName,a=o.facetQuery,c=fo(o,ca);return to(t)(n.indexName,{methods:{searchForFacetValues:ro}}).searchForFacetValues(i,a,I(I({},r),c))}))}},ya=function(t){return function(e,r,n){return t.transporter.read({method:_t,path:bt("1/answers/%s/prediction",t.indexName),data:{query:e,queryLanguages:r},cacheable:!0},n)}},ga=function(t){return function(e,r){return t.transporter.read({method:_t,path:bt("1/indexes/%s/query",t.indexName),data:{query:e},cacheable:!0},r)}},ro=function(t){return function(e,r,n){return t.transporter.read({method:_t,path:bt("1/indexes/%s/facets/%s/query",t.indexName,e),data:{facetQuery:r},cacheable:!0},n)}},ba=1,_a=2,Oa=3;function no(t,e,r){var n,o={appId:t,apiKey:e,timeouts:{connect:1,read:2,write:30},requester:{send:function(i){return new Promise(function(a){var c=new XMLHttpRequest;c.open(i.method,i.url,!0),Object.keys(i.headers).forEach(function(m){return c.setRequestHeader(m,i.headers[m])});var u,s=function(m,p){return setTimeout(function(){c.abort(),a({status:0,content:p,isTimedOut:!0})},1e3*m)},l=s(i.connectTimeout,"Connection timeout");c.onreadystatechange=function(){c.readyState>c.OPENED&&u===void 0&&(clearTimeout(l),u=s(i.responseTimeout,"Socket timeout"))},c.onerror=function(){c.status===0&&(clearTimeout(l),clearTimeout(u),a({content:c.responseText||"Network request failed",status:c.status,isTimedOut:!1}))},c.onload=function(){clearTimeout(l),clearTimeout(u),a({content:c.responseText,status:c.status,isTimedOut:!1})},c.send(i.data)})}},logger:(n=Oa,{debug:function(i,a){return ba>=n&&console.debug(i,a),Promise.resolve()},info:function(i,a){return _a>=n&&console.info(i,a),Promise.resolve()},error:function(i,a){return console.error(i,a),Promise.resolve()}}),responsesCache:Tt(),requestsCache:Tt({serializable:!1}),hostsCache:Ee({caches:[la({key:"".concat("4.19.1","-").concat(t)}),Tt()]}),userAgent:pa("4.19.1").add({segment:"Browser",version:"lite"}),authMode:st.WithinQueryParameters};return da(I(I(I({},o),r),{},{methods:{search:fn,searchForFacetValues:mn,multipleQueries:fn,multipleSearchForFacetValues:mn,customRequest:ha,initIndex:function(i){return function(a){return to(i)(a,{methods:{search:ga,searchForFacetValues:ro,findAnswers:ya}})}}}}))}no.version="4.19.1";var Sa=["footer","searchBox"];function Be(){return Be=Object.assign||function(t){for(var e=1;e t.length)&&(e=t.length);for(var r=0,n=new Array(e);r =0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n =0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Pa(t){var e=t.appId,r=t.apiKey,n=t.indexName,o=t.placeholder,i=o===void 0?"Search docs":o,a=t.searchParameters,c=t.maxResultsPerGroup,u=t.onClose,s=u===void 0?Ji:u,l=t.transformItems,m=l===void 0?an:l,p=t.hitComponent,v=p===void 0?Di:p,d=t.resultsFooterComponent,h=d===void 0?function(){return null}:d,y=t.navigator,b=t.initialScrollY,_=b===void 0?0:b,S=t.transformSearchClient,O=S===void 0?an:S,g=t.disableUserPersonalization,P=g!==void 0&&g,C=t.initialQuery,L=C===void 0?"":C,x=t.translations,k=x===void 0?{}:x,N=t.getMissingResultsUrl,U=t.insights,F=U!==void 0&&U,M=k.footer,Ot=k.searchBox,St=Ea(k,Sa),$e=wa(f.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),B=$e[0],oo=$e[1],Xt=f.useRef(null),jt=f.useRef(null),er=f.useRef(null),Qe=f.useRef(null),he=f.useRef(null),Q=f.useRef(10),tr=f.useRef(typeof window<"u"?window.getSelection().toString().slice(0,64):"").current,ee=f.useRef(L||tr).current,rr=function(w,D,T){return f.useMemo(function(){var H=no(w,D);return H.addAlgoliaAgent("docsearch","3.5.2"),/docsearch.js \(.*\)/.test(H.transporter.userAgent.value)===!1&&H.addAlgoliaAgent("docsearch-react","3.5.2"),T(H)},[w,D,T])}(e,r,O),oe=f.useRef(un({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(n),limit:10})).current,ye=f.useRef(un({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(n),limit:oe.getAll().length===0?7:4})).current,ge=f.useCallback(function(w){if(!P){var D=w.type==="content"?w.__docsearch_parent:w;D&&oe.getAll().findIndex(function(T){return T.objectID===D.objectID})===-1&&ye.add(D)}},[oe,ye,P]),io=f.useCallback(function(w){if(B.context.algoliaInsightsPlugin&&w.__autocomplete_id){var D=w,T={eventName:"Item Selected",index:D.__autocomplete_indexName,items:[D],positions:[w.__autocomplete_id],queryID:D.__autocomplete_queryID};B.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch(T)}},[B.context.algoliaInsightsPlugin]),be=f.useMemo(function(){return Ei({id:"docsearch",defaultActiveItemId:0,placeholder:i,openOnFocus:!0,initialState:{query:ee,context:{searchSuggestions:[]}},insights:F,navigator:y,onStateChange:function(w){oo(w.state)},getSources:function(w){var D=w.query,T=w.state,H=w.setContext,Z=w.setStatus;if(!D)return P?[]:[{sourceId:"recentSearches",onSelect:function(A){var V=A.item,_e=A.event;ge(V),at(_e)||s()},getItemUrl:function(A){return A.item.url},getItems:function(){return ye.getAll()}},{sourceId:"favoriteSearches",onSelect:function(A){var V=A.item,_e=A.event;ge(V),at(_e)||s()},getItemUrl:function(A){return A.item.url},getItems:function(){return oe.getAll()}}];var Y=!!F;return rr.search([{query:D,indexName:n,params:Rt({attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat(Q.current),"hierarchy.lvl2:".concat(Q.current),"hierarchy.lvl3:".concat(Q.current),"hierarchy.lvl4:".concat(Q.current),"hierarchy.lvl5:".concat(Q.current),"hierarchy.lvl6:".concat(Q.current),"content:".concat(Q.current)],snippetEllipsisText:"…",highlightPreTag:"",highlightPostTag:"",hitsPerPage:20,clickAnalytics:Y},a)}]).catch(function(A){throw A.name==="RetryError"&&Z("error"),A}).then(function(A){var V=A.results[0],_e=V.hits,co=V.nbHits,wt=on(_e,function(Et){return Jn(Et)},c);T.context.searchSuggestions.length 0&&(nr(),he.current&&he.current.focus())},[ee,nr]),f.useEffect(function(){function w(){if(jt.current){var D=.01*window.innerHeight;jt.current.style.setProperty("--docsearch-vh","".concat(D,"px"))}}return w(),window.addEventListener("resize",w),function(){window.removeEventListener("resize",w)}},[]),f.createElement("div",Be({ref:Xt},uo({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container",B.status==="stalled"&&"DocSearch-Container--Stalled",B.status==="error"&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(w){w.target===w.currentTarget&&s()}}),f.createElement("div",{className:"DocSearch-Modal",ref:jt},f.createElement("header",{className:"DocSearch-SearchBar",ref:er},f.createElement(oa,Be({},be,{state:B,autoFocus:ee.length===0,inputRef:he,isFromSelection:!!ee&&ee===tr,translations:Ot,onClose:s}))),f.createElement("div",{className:"DocSearch-Dropdown",ref:Qe},f.createElement(ta,Be({},be,{indexName:n,state:B,hitComponent:v,resultsFooterComponent:h,disableUserPersonalization:P,recentSearches:ye,favoriteSearches:oe,inputRef:he,translations:St,getMissingResultsUrl:N,onItemClick:function(w,D){io(w),ge(w),at(D)||s()}}))),f.createElement("footer",{className:"DocSearch-Footer"},f.createElement(Ii,{translations:M}))))}function Qt(){return Qt=Object.assign||function(t){for(var e=1;e t.length)&&(e=t.length);for(var r=0,n=new Array(e);r 1&&arguments[1]!==void 0?arguments[1]:window;return typeof e=="string"?r.document.querySelector(e):e}(t.container,t.environment))}export{Da as default}; diff --git a/assets/index.html-4Jlev2wy.js b/assets/index.html-4Jlev2wy.js new file mode 100644 index 000000000..f570ca1e1 --- /dev/null +++ b/assets/index.html-4Jlev2wy.js @@ -0,0 +1 @@ +import{_ as a,r as n,o as s,c as i,a as t,b as e,d as r,e as d}from"./app-eU2v8o1B.js";const h={},c=t("h1",{id:"introduction",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#introduction","aria-hidden":"true"},"#"),e(" Introduction")],-1),u={href:"https://en.wikipedia.org/wiki/Markdown",target:"_blank",rel:"noopener noreferrer"},l=t("p",null,"The purpose of creating VuePress was to support the documentation of Vue.js and its sub-projects, but now it has been helping a large amount of users to build their documentation, blogs, and other static sites.",-1),p=t("h2",{id:"how-it-works",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#how-it-works","aria-hidden":"true"},"#"),e(" How It Works")],-1),f={href:"https://vuejs.org/",target:"_blank",rel:"noopener noreferrer"},g={href:"https://router.vuejs.org",target:"_blank",rel:"noopener noreferrer"},m={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},b=t("p",null,"During development, we start a normal dev-server, and serve the VuePress site as a normal SPA. If you’ve used Vue before, you will notice the familiar development experience when you are writing and developing with VuePress.",-1),w={href:"https://nuxtjs.org/",target:"_blank",rel:"noopener noreferrer"},_=t("code",null,"nuxt generate",-1),y={href:"https://www.gatsbyjs.org/",target:"_blank",rel:"noopener noreferrer"},k=d(' # Why Not ...?
# Nuxt
Nuxt is an outstanding Vue SSR framework, and it is capable of doing what VuePress does. But Nuxt is designed for building applications, while VuePress is more lightweight and focused on content-centric static sites.
# VitePress
VitePress is the little brother of VuePress. It's also created and maintained by our Vue.js team. It's even more lightweight and faster than VuePress. However, as a tradeoff, it's more opinionated and less configurable. For example, it does not support plugins. But VitePress is powerful enough to make your content online if you don't need advanced customizations.
It might not be an appropriate comparison, but you can take VuePress and VitePress as Laravel and Lumen.
# Docsify / Docute
Both are great projects and also Vue-powered. Except they are both fully runtime-driven and therefore not SEO-friendly. If you don’t care for SEO and don’t want to mess with installing dependencies, these are still great choices.
# Hexo
Hexo has been serving the Vue 2.x docs well. The biggest problem is that its theming system is static and string-based - we want to take advantage of Vue for both the layout and the interactivity. Also, Hexo’s Markdown rendering isn’t the most flexible to configure.
# GitBook
We’ve been using GitBook for most of our sub project docs. The primary problem with GitBook is that its development reload performance is intolerable with a large amount of files. The default theme also has a pretty limiting navigation structure, and the theming system is, again, not Vue based. The team behind GitBook is also more focused on turning it into a commercial product rather than an open-source tool.
',12);function x(V,v){const o=n("ExternalLinkIcon");return s(),i("div",null,[c,t("p",null,[e("VuePress is a markdown-centered static site generator. You can write your content (documentations, blogs, etc.) in "),t("a",u,[e("Markdown"),r(o)]),e(", then VuePress will help you to generate a static site to host them.")]),l,p,t("p",null,[e("A VuePress site is in fact a single-page application (SPA) powered by "),t("a",f,[e("Vue"),r(o)]),e(" and "),t("a",g,[e("Vue Router"),r(o)]),e(".")]),t("p",null,[e("Routes are generated according to the relative path of your markdown files. Each Markdown file is compiled into HTML with "),t("a",m,[e("markdown-it"),r(o)]),e(" and then processed as the template of a Vue component. This allows you to directly use Vue inside your Markdown files and is great when you need to embed dynamic content.")]),b,t("p",null,[e("During build, we create a server-rendered version of the VuePress site and render the corresponding HTML by virtually visiting each route. This approach is inspired by "),t("a",w,[e("Nuxt"),r(o)]),e("'s "),_,e(" command and other projects like "),t("a",y,[e("Gatsby"),r(o)]),e(".")]),k])}const j=a(h,[["render",x],["__file","index.html.vue"]]);export{j as default}; diff --git a/assets/index.html-Ahzl3jpH.js b/assets/index.html-Ahzl3jpH.js new file mode 100644 index 000000000..75984afcf --- /dev/null +++ b/assets/index.html-Ahzl3jpH.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2d0ad528","path":"/zh/","title":"首页","lang":"zh-CN","frontmatter":{"home":true,"title":"首页","heroImage":"/images/hero.png","actions":[{"text":"快速上手","link":"/zh/guide/getting-started.html","type":"primary"},{"text":"项目简介","link":"/zh/guide/","type":"secondary"}],"features":[{"title":"简洁至上","details":"以 Markdown 为中心的项目结构,以最少的配置帮助你专注于写作。"},{"title":"Vue 驱动","details":"享受 Vue 的开发体验,可以在 Markdown 中使用 Vue 组件,又可以使用 Vue 来开发自定义主题。"},{"title":"高性能","details":"VuePress 会为每个页面预渲染生成静态的 HTML,同时,每个页面被加载的时候,将作为 SPA 运行。"},{"title":"主题","details":"提供了一个开箱即用的默认主题。你也可以挑选一个社区主题,或者创建一个你自己的主题。"},{"title":"插件","details":"灵活的插件API,使得插件可以为你的站点提供许多即插即用的功能。"},{"title":"打包工具","details":"默认的打包工具是 Vite ,也同样支持 Webpack 。选一个你喜欢的来使用吧!"}],"footer":"MIT 协议 | 版权所有 © 2018-至今 VuePress 社区"},"headers":[],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/README.md"}');export{e as data}; diff --git a/assets/index.html-EaoSe4Mj.js b/assets/index.html-EaoSe4Mj.js new file mode 100644 index 000000000..a5433fc73 --- /dev/null +++ b/assets/index.html-EaoSe4Mj.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-8daa1a0e","path":"/","title":"Home","lang":"en-US","frontmatter":{"home":true,"title":"Home","heroImage":"/images/hero.png","actions":[{"text":"Get Started","link":"/guide/getting-started.html","type":"primary"},{"text":"Introduction","link":"/guide/","type":"secondary"}],"features":[{"title":"Simplicity First","details":"Minimal setup with markdown-centered project structure helps you focus on writing."},{"title":"Vue-Powered","details":"Enjoy the dev experience of Vue, use Vue components in markdown, and develop custom themes with Vue."},{"title":"Performant","details":"VuePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded."},{"title":"Themes","details":"Providing a default theme out of the box. You can also choose a community theme or create your own one."},{"title":"Plugins","details":"Flexible plugin API, allowing plugins to provide lots of plug-and-play features for your site."},{"title":"Bundlers","details":"Default bundler is Vite, while Webpack is also supported. Choose the one you like!"}],"footer":"MIT Licensed | Copyright © 2018-present VuePress Community"},"headers":[],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"README.md"}');export{e as data}; diff --git a/assets/index.html-LIeZHVSg.js b/assets/index.html-LIeZHVSg.js new file mode 100644 index 000000000..56ccd5c9e --- /dev/null +++ b/assets/index.html-LIeZHVSg.js @@ -0,0 +1 @@ +import{_ as e,o,c as t,e as a}from"./app-eU2v8o1B.js";const r={},n=a('# 介绍
# Cookbook 的目的是什么?
- 我们在 指南 中介绍了基本概念,但你可能不知道怎么才能了解得更深入。
- 我们在 参考 中列出了 API ,但你可能不知道如何充分利用它们。
于是就有了 Cookbook 。
每个案例都会针对某个特定的方面,通过提供更详细的示例来向你展示 VuePress 的用法和其他可能性。
',5),s=[n];function c(i,d){return o(),t("div",null,s)}const l=e(r,[["render",c],["__file","index.html.vue"]]);export{l as default}; diff --git a/assets/index.html-OVZ3rK4C.js b/assets/index.html-OVZ3rK4C.js new file mode 100644 index 000000000..9dce3d77a --- /dev/null +++ b/assets/index.html-OVZ3rK4C.js @@ -0,0 +1 @@ +import{_ as e,o,c as t,e as n}from"./app-eU2v8o1B.js";const i={},a=n('# Introduction
# What's the Cookbook for?
- We are introducing essential concepts in the Guide, but you may not know how to dig deeper.
- We are listing APIs in the Reference, but you may not know how to take full advantage of them.
So here comes the Cookbook.
Each recipe will focus on one specific aspect, providing more detailed examples to show you the usages and possibilities of VuePress.
',5),s=[a];function r(c,h){return o(),t("div",null,s)}const l=e(i,[["render",r],["__file","index.html.vue"]]);export{l as default}; diff --git a/assets/index.html-__AKVf_E.js b/assets/index.html-__AKVf_E.js new file mode 100644 index 000000000..fb11b7af9 --- /dev/null +++ b/assets/index.html-__AKVf_E.js @@ -0,0 +1 @@ +import{_ as e,o as c,c as t}from"./app-eU2v8o1B.js";const n={};function _(o,r){return c(),t("div")}const a=e(n,[["render",_],["__file","index.html.vue"]]);export{a as default}; diff --git a/assets/index.html-hVy-ihXY.js b/assets/index.html-hVy-ihXY.js new file mode 100644 index 000000000..564b80d05 --- /dev/null +++ b/assets/index.html-hVy-ihXY.js @@ -0,0 +1 @@ +import{_ as o,r as s,o as n,c as d,a as r,b as e,d as a,e as i}from"./app-eU2v8o1B.js";const h={},u=r("h1",{id:"介绍",tabindex:"-1"},[r("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),e(" 介绍")],-1),c={href:"https://zh.wikipedia.org/wiki/Markdown",target:"_blank",rel:"noopener noreferrer"},l=r("p",null,"VuePress 诞生的初衷是为了支持 Vue.js 及其子项目的文档需求,但是现在它已经在帮助大量用户构建他们的文档、博客和其他静态网站。",-1),_=r("h2",{id:"它是如何工作的",tabindex:"-1"},[r("a",{class:"header-anchor",href:"#它是如何工作的","aria-hidden":"true"},"#"),e(" 它是如何工作的?")],-1),p={href:"https://vuejs.org/",target:"_blank",rel:"noopener noreferrer"},x={href:"https://router.vuejs.org",target:"_blank",rel:"noopener noreferrer"},V={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},f=r("p",null,"在开发过程中,我们启动一个常规的开发服务器 (dev-server) ,并将 VuePress 站点作为一个常规的 SPA。如果你以前使用过 Vue 的话,你在使用时会感受到非常熟悉的开发体验。",-1),k={href:"https://nuxtjs.org/",target:"_blank",rel:"noopener noreferrer"},b=r("code",null,"nuxt generate",-1),P={href:"https://www.gatsbyjs.org/",target:"_blank",rel:"noopener noreferrer"},g=i('# 为什么不是 ...?
# Nuxt
Nuxt 是一套出色的 Vue SSR 框架, VuePress 能做的事情,Nuxt 实际上也同样能够胜任。但 Nuxt 是为构建应用程序而生的,而 VuePress 则更为轻量化并且专注在以内容为中心的静态网站上。
# VitePress
VitePress 是 VuePress 的孪生兄弟,它同样由 Vue.js 团队创建和维护。 VitePress 甚至比 VuePress 要更轻更快,但它在灵活性和可配置性上作出了一些让步,比如它不支持插件系统。当然,如果你没有进阶的定制化需求, VitePress 已经足够支持你将你的内容部署到线上。
这个比喻可能不是很恰当,但是你可以把 VuePress 和 VitePress 的关系看作 Laravel 和 Lumen 。
# Docsify / Docute
这两个项目同样都是基于 Vue,然而它们都是完全的运行时驱动,因此对 SEO 不够友好。如果你并不关注 SEO,同时也不想安装大量依赖,它们仍然是非常好的选择!
# Hexo
Hexo 一直驱动着 Vue 2.x 的文档。Hexo 最大的问题在于他的主题系统太过于静态以及过度地依赖纯字符串,而我们十分希望能够好好地利用 Vue 来处理我们的布局和交互。同时,Hexo 在配置 Markdown 渲染方面的灵活性也不是最佳的。
# GitBook
过去我们的子项目文档一直都在使用 GitBook 。 GitBook 最大的问题在于当文件很多时,每次编辑后的重新加载时间长得令人无法忍受。它的默认主题导航结构也比较有限制性,并且,主题系统也不是 Vue 驱动的。GitBook 背后的团队如今也更专注于将其打造为一个商业产品而不是开源工具。
',12);function w(m,v){const t=s("ExternalLinkIcon");return n(),d("div",null,[u,r("p",null,[e("VuePress 是一个以 Markdown 为中心的静态网站生成器。你可以使用 "),r("a",c,[e("Markdown"),a(t)]),e(" 来书写内容(如文档、博客等),然后 VuePress 会帮助你生成一个静态网站来展示它们。")]),l,_,r("p",null,[e("一个 VuePress 站点本质上是一个由 "),r("a",p,[e("Vue"),a(t)]),e(" 和 "),r("a",x,[e("Vue Router"),a(t)]),e(" 驱动的单页面应用 (SPA)。")]),r("p",null,[e("路由会根据你的 Markdown 文件的相对路径来自动生成。每个 Markdown 文件都通过 "),r("a",V,[e("markdown-it"),a(t)]),e(" 编译为 HTML ,然后将其作为 Vue 组件的模板。因此,你可以在 Markdown 文件中直接使用 Vue 语法,便于你嵌入一些动态内容。")]),f,r("p",null,[e("在构建过程中,我们会为 VuePress 站点创建一个服务端渲染 (SSR) 的版本,然后通过虚拟访问每一条路径来渲染对应的 HTML 。这种做法的灵感来源于 "),r("a",k,[e("Nuxt"),a(t)]),e(" 的 "),b,e(" 命令,以及其他的一些项目,比如 "),r("a",P,[e("Gatsby"),a(t)]),e("。")]),g])}const N=o(h,[["render",w],["__file","index.html.vue"]]);export{N as default}; diff --git a/assets/index.html-jGrnmanP.js b/assets/index.html-jGrnmanP.js new file mode 100644 index 000000000..cfa0a2e99 --- /dev/null +++ b/assets/index.html-jGrnmanP.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-47357bdb","path":"/zh/guide/","title":"介绍","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"它是如何工作的?","slug":"它是如何工作的","link":"#它是如何工作的","children":[]},{"level":2,"title":"为什么不是 ...?","slug":"为什么不是","link":"#为什么不是","children":[{"level":3,"title":"Nuxt","slug":"nuxt","link":"#nuxt","children":[]},{"level":3,"title":"VitePress","slug":"vitepress","link":"#vitepress","children":[]},{"level":3,"title":"Docsify / Docute","slug":"docsify-docute","link":"#docsify-docute","children":[]},{"level":3,"title":"Hexo","slug":"hexo","link":"#hexo","children":[]},{"level":3,"title":"GitBook","slug":"gitbook","link":"#gitbook","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/guide/README.md"}');export{e as data}; diff --git a/assets/index.html-jH3Iv2-7.js b/assets/index.html-jH3Iv2-7.js new file mode 100644 index 000000000..93a3a7dca --- /dev/null +++ b/assets/index.html-jH3Iv2-7.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-fffb8e28","path":"/guide/","title":"Introduction","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"How It Works","slug":"how-it-works","link":"#how-it-works","children":[]},{"level":2,"title":"Why Not ...?","slug":"why-not","link":"#why-not","children":[{"level":3,"title":"Nuxt","slug":"nuxt","link":"#nuxt","children":[]},{"level":3,"title":"VitePress","slug":"vitepress","link":"#vitepress","children":[]},{"level":3,"title":"Docsify / Docute","slug":"docsify-docute","link":"#docsify-docute","children":[]},{"level":3,"title":"Hexo","slug":"hexo","link":"#hexo","children":[]},{"level":3,"title":"GitBook","slug":"gitbook","link":"#gitbook","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"guide/README.md"}');export{e as data}; diff --git a/assets/index.html-owSzs6LV.js b/assets/index.html-owSzs6LV.js new file mode 100644 index 000000000..fb11b7af9 --- /dev/null +++ b/assets/index.html-owSzs6LV.js @@ -0,0 +1 @@ +import{_ as e,o as c,c as t}from"./app-eU2v8o1B.js";const n={};function _(o,r){return c(),t("div")}const a=e(n,[["render",_],["__file","index.html.vue"]]);export{a as default}; diff --git a/assets/index.html-rTEwPOLI.js b/assets/index.html-rTEwPOLI.js new file mode 100644 index 000000000..5e384b740 --- /dev/null +++ b/assets/index.html-rTEwPOLI.js @@ -0,0 +1 @@ +const o=JSON.parse('{"key":"v-0a7c8599","path":"/zh/advanced/cookbook/","title":"介绍","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"Cookbook 的目的是什么?","slug":"cookbook-的目的是什么","link":"#cookbook-的目的是什么","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/advanced/cookbook/README.md"}');export{o as data}; diff --git a/assets/index.html-sFLocUcL.js b/assets/index.html-sFLocUcL.js new file mode 100644 index 000000000..e0dae6e48 --- /dev/null +++ b/assets/index.html-sFLocUcL.js @@ -0,0 +1 @@ +const o=JSON.parse(`{"key":"v-03c9312a","path":"/advanced/cookbook/","title":"Introduction","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"What's the Cookbook for?","slug":"what-s-the-cookbook-for","link":"#what-s-the-cookbook-for","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"advanced/cookbook/README.md"}`);export{o as data}; diff --git a/assets/making-a-theme-extendable.html-hlHjGq6k.js b/assets/making-a-theme-extendable.html-hlHjGq6k.js new file mode 100644 index 000000000..45f506bf0 --- /dev/null +++ b/assets/making-a-theme-extendable.html-hlHjGq6k.js @@ -0,0 +1,35 @@ +import{_ as o,r as p,o as t,c as r,a as n,b as s,d as e,w as l,e as c}from"./app-eU2v8o1B.js";const i={},D=n("h1",{id:"making-a-theme-extendable",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#making-a-theme-extendable","aria-hidden":"true"},"#"),s(" Making a Theme Extendable")],-1),y=n("p",null,"Sometimes users might want make some minor changes to a theme, but they don't want to fork and modify the entire project.",-1),d=c(`# Layout Slots
This approach requires you to determine which parts of your theme could be extended. It is more suitable for those common customizations like page footer or header.
You just need to provide slots in your layouts, and tell users how to make use of them:
<template> + <div class="my-theme-layout"> + <slot name="page-header" /> + <Content /> + <slot name="page-footer" /> + </div> +</template> +
# Component Aliases
This approach requires you to consider which components of your theme should be replaceable, and you also need to split components into a suitable granularity.
First, set
alias
for replaceable components of you theme:import type { Theme } from '@vuepress/core' +import { getDirname } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export const fooTheme = (options): Theme => { + return { + name: 'vuepress-theme-foo', + alias: { + // set alias for replaceable components + '@theme/Navbar.vue': path.resolve(__dirname, 'components/Navbar.vue'), + '@theme/Sidebar.vue': path.resolve(__dirname, 'components/Sidebar.vue'), + }, + } +} +
Next, use those components via aliases in your theme:
<script setup lang="ts"> +import Navbar from '@theme/Navbar.vue' +import Sidebar from '@theme/Sidebar.vue' +</script> + +<template> + <div class="my-theme-layout"> + <Navbar /> + <Sidebar /> + <Content /> + </div> +</template> +
Then, users can replace specific components by overriding the
`,11);function m(u,v){const a=p("RouterLink");return t(),r("div",null,[D,y,n("p",null,[s("With the help of "),e(a,{to:"/reference/theme-api.html"},{default:l(()=>[s("Theme API")]),_:1}),s(", you can make your theme extendable, allowing users to make their own modifications easily.")]),n("p",null,[s("You must have known that how to "),e(a,{to:"/reference/default-theme/extending.html"},{default:l(()=>[s("extend default theme")]),_:1}),s(". Here we'll introduce how to make your own theme extendable like default theme.")]),d])}const h=o(i,[["render",m],["__file","making-a-theme-extendable.html.vue"]]);export{h as default}; diff --git a/assets/making-a-theme-extendable.html-meYav6NP.js b/assets/making-a-theme-extendable.html-meYav6NP.js new file mode 100644 index 000000000..dfb6c7980 --- /dev/null +++ b/assets/making-a-theme-extendable.html-meYav6NP.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-04c514ac","path":"/zh/advanced/cookbook/making-a-theme-extendable.html","title":"开发一个可继承的主题","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"布局插槽","slug":"布局插槽","link":"#布局插槽","children":[]},{"level":2,"title":"组件别名","slug":"组件别名","link":"#组件别名","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/advanced/cookbook/making-a-theme-extendable.md"}');export{e as data}; diff --git a/assets/making-a-theme-extendable.html-rrr09wUd.js b/assets/making-a-theme-extendable.html-rrr09wUd.js new file mode 100644 index 000000000..158f7da26 --- /dev/null +++ b/assets/making-a-theme-extendable.html-rrr09wUd.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-06adec7d","path":"/advanced/cookbook/making-a-theme-extendable.html","title":"Making a Theme Extendable","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Layout Slots","slug":"layout-slots","link":"#layout-slots","children":[]},{"level":2,"title":"Component Aliases","slug":"component-aliases","link":"#component-aliases","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"advanced/cookbook/making-a-theme-extendable.md"}');export{e as data}; diff --git a/assets/making-a-theme-extendable.html-wDYHhuw8.js b/assets/making-a-theme-extendable.html-wDYHhuw8.js new file mode 100644 index 000000000..d9b43a05f --- /dev/null +++ b/assets/making-a-theme-extendable.html-wDYHhuw8.js @@ -0,0 +1,35 @@ +import{_ as p,r as o,o as t,c as r,a as n,b as s,d as l,w as e,e as c}from"./app-eU2v8o1B.js";const D={},i=n("h1",{id:"开发一个可继承的主题",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#开发一个可继承的主题","aria-hidden":"true"},"#"),s(" 开发一个可继承的主题")],-1),y=n("p",null,"有时用户可能希望对一个主题进行一些小改动,但是又不想 Fork 并修改整个项目。",-1),d=c(`alias
when extending or using your theme.# 布局插槽
这种方式需要你来决定主题的哪些部分是可以被扩展的,它更适合用于一些常见的自定义需求,比如页眉或页脚。
你只需要在你的布局文件中提供 slots ,并告诉用户如何使用它们即可:
<template> + <div class="my-theme-layout"> + <slot name="page-header" /> + <Content /> + <slot name="page-footer" /> + </div> +</template> +
# 组件别名
这种方式需要你考虑清楚你的主题的哪些组件可以被替换,并且你需要将组件拆分到合适的粒度。
首先,为你主题的可替换组件设置
alias
别名:import type { Theme } from '@vuepress/core' +import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export const fooTheme = (options): Theme => { + return { + name: 'vuepress-theme-foo', + alias: { + // 为可替换的组件设置别名 + '@theme/Navbar.vue': path.resolve(__dirname, 'components/Navbar.vue'), + '@theme/Sidebar.vue': path.resolve(__dirname, 'components/Sidebar.vue'), + }, + } +} +
然后,在你的主题中通过别名来使用这些组件:
<script setup lang="ts"> +import Navbar from '@theme/Navbar.vue' +import Sidebar from '@theme/Sidebar.vue' +</script> + +<template> + <div class="my-theme-layout"> + <Navbar /> + <Sidebar /> + <Content /> + </div> +</template> +
这样,用户在继承或使用你的主题时,就可以通过覆盖
`,11);function C(v,u){const a=o("RouterLink");return t(),r("div",null,[i,y,n("p",null,[s("借助于 "),l(a,{to:"/zh/reference/theme-api.html"},{default:e(()=>[s("主题 API")]),_:1}),s(" ,你可以让用户继承你的主题,允许用户对你的主题进行改动。")]),n("p",null,[s("你肯定已经知道了如何 "),l(a,{to:"/zh/reference/default-theme/extending.html"},{default:e(()=>[s("继承默认主题")]),_:1}),s(" 。接下来我们将介绍如何让你的主题像默认主题一样被用户继承。")]),d])}const b=p(D,[["render",C],["__file","making-a-theme-extendable.html.vue"]]);export{b as default}; diff --git a/assets/markdown-and-vue-sfc.html-4gGUwagr.js b/assets/markdown-and-vue-sfc.html-4gGUwagr.js new file mode 100644 index 000000000..0b673decf --- /dev/null +++ b/assets/markdown-and-vue-sfc.html-4gGUwagr.js @@ -0,0 +1,31 @@ +import{_ as p,g as t,o as c,c as r,a as s,t as a,d as i,w as D,e as d,h as y}from"./app-eU2v8o1B.js";const u=d(`alias
来替换特定的组件了。# Markdown and Vue SFC
Each Markdown file is first compiled into HTML, and then converted to a Vue SFC. In other words, you can write a Markdown file like a Vue SFC:
- Blocks
<script>
and<style>
are treated as Vue SFC blocks as they are. In other words, they are hoisted from the<template>
block to the top-level of SFC.- Everything outside
<script>
and<style>
will be compiled into HTML, and be treated as Vue SFC<template>
block.WARNING
As Vue SFC can contain only one
<script>
element, you should avoid using more than one<script>
in VuePress markdown.Here comes an example:
Input
_Hello, {{ msg }}_ + +<RedDiv> + +_Current count is: {{ count }}_ + +</RedDiv> + +<button @click="count++">Click Me!</button> + +<script setup> +import { h, ref } from 'vue' + +const RedDiv = (_, ctx) => + h( + 'div', + { + class: 'red-div', + }, + ctx.slots.default(), + ) +const msg = 'Vue in Markdown' +const count = ref(0) +</script> + +<style> +.red-div { + color: red; +} +</style> +
Output
`,8),v="Vue in Markdown",C={__name:"markdown-and-vue-sfc.html",setup(m){const e=(o,n)=>y("div",{class:"red-div"},n.slots.default()),l=t(0);return(o,n)=>(c(),r("div",null,[u,s("p",null,[s("em",null,"Hello, "+a(v))]),i(e,null,{default:D(()=>[s("p",null,[s("em",null,"Current count is: "+a(l.value),1)])]),_:1}),s("p",null,[s("button",{onClick:n[0]||(n[0]=b=>l.value++)},"Click Me!")])]))}},h=p(C,[["__file","markdown-and-vue-sfc.html.vue"]]);export{h as default}; diff --git a/assets/markdown-and-vue-sfc.html-7cfmbOwj.js b/assets/markdown-and-vue-sfc.html-7cfmbOwj.js new file mode 100644 index 000000000..78be388c7 --- /dev/null +++ b/assets/markdown-and-vue-sfc.html-7cfmbOwj.js @@ -0,0 +1,31 @@ +import{_ as o,g as c,o as t,c as r,a as s,t as a,d as i,w as D,e as d,h as y}from"./app-eU2v8o1B.js";const v=d(`# Markdown 与 Vue SFC
每一个 Markdown 文件,首先都会编译为 HTML ,然后转换为一个 Vue 单文件组件 (SFC) 。换句话说,你可以像写 Vue SFC 一样来写 Markdown 文件:
<script>
和<style>
标签会直接被当作 Vue SFC 中的标签。换句话说,它们是从<template>
标签中提升到了 SFC 的顶层。- 所有
<script>
和<style>
标签的以外的内容,会先被编译为 HTML ,然后被当作 Vue SFC 的<template>
标签。注意
由于 Vue 单文件组件只能包含一个
<script>
标签,你应该避免在 VuePress Markdown 中使用多于一个<script>
标签。我们来看一个例子:
输入
_你好, {{ msg }}_ + +<RedDiv> + +_当前计数为: {{ count }}_ + +</RedDiv> + +<button @click="count++">点我!</button> + +<script setup> +import { h, ref } from 'vue' + +const RedDiv = (_, ctx) => + h( + 'div', + { + class: 'red-div', + }, + ctx.slots.default(), + ) +const msg = 'Markdown 中的 Vue' +const count = ref(0) +</script> + +<style> +.red-div { + color: red; +} +</style> +
输出
`,8),u="Markdown 中的 Vue",C={__name:"markdown-and-vue-sfc.html",setup(m){const e=(p,n)=>y("div",{class:"red-div"},n.slots.default()),l=c(0);return(p,n)=>(t(),r("div",null,[v,s("p",null,[s("em",null,"你好, "+a(u))]),i(e,null,{default:D(()=>[s("p",null,[s("em",null,"当前计数为: "+a(l.value),1)])]),_:1}),s("p",null,[s("button",{onClick:n[0]||(n[0]=b=>l.value++)},"点我!")])]))}},F=o(C,[["__file","markdown-and-vue-sfc.html.vue"]]);export{F as default}; diff --git a/assets/markdown-and-vue-sfc.html-8CMAPm9t.js b/assets/markdown-and-vue-sfc.html-8CMAPm9t.js new file mode 100644 index 000000000..189d94cb3 --- /dev/null +++ b/assets/markdown-and-vue-sfc.html-8CMAPm9t.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-63e02eaa","path":"/zh/advanced/cookbook/markdown-and-vue-sfc.html","title":"Markdown 与 Vue SFC","lang":"zh-CN","frontmatter":{},"headers":[],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/advanced/cookbook/markdown-and-vue-sfc.md"}');export{e as data}; diff --git a/assets/markdown-and-vue-sfc.html-UyAjVe0G.js b/assets/markdown-and-vue-sfc.html-UyAjVe0G.js new file mode 100644 index 000000000..e84a612d2 --- /dev/null +++ b/assets/markdown-and-vue-sfc.html-UyAjVe0G.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4e3c9b8c","path":"/advanced/cookbook/markdown-and-vue-sfc.html","title":"Markdown and Vue SFC","lang":"en-US","frontmatter":{},"headers":[],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"advanced/cookbook/markdown-and-vue-sfc.md"}');export{e as data}; diff --git a/assets/markdown.html-E9TdBNq2.js b/assets/markdown.html-E9TdBNq2.js new file mode 100644 index 000000000..c27c91b95 --- /dev/null +++ b/assets/markdown.html-E9TdBNq2.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-176c9c4a","path":"/reference/default-theme/markdown.html","title":"Markdown","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Custom Containers","slug":"custom-containers","link":"#custom-containers","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/default-theme/markdown.md"}');export{e as data}; diff --git a/assets/markdown.html-O0xMZyR_.js b/assets/markdown.html-O0xMZyR_.js new file mode 100644 index 000000000..50194415a --- /dev/null +++ b/assets/markdown.html-O0xMZyR_.js @@ -0,0 +1,130 @@ +import{_ as u,r,o as i,c,a as s,b as n,d as l,w as a,F as y,f as m,t as v,e as t}from"./app-eU2v8o1B.js";const h={},b=s("h1",{id:"markdown",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#markdown","aria-hidden":"true"},"#"),n(" Markdown")],-1),g={href:"https://commonmark.org/help/",target:"_blank",rel:"noopener noreferrer"},_=s("h2",{id:"语法扩展",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#语法扩展","aria-hidden":"true"},"#"),n(" 语法扩展")],-1),C={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},k={href:"https://github.com/markdown-it/markdown-it#syntax-extensions",target:"_blank",rel:"noopener noreferrer"},E=s("p",null,"本章节将会介绍 VuePress 内置支持的 Markdown 语法扩展。",-1),f=s("h3",{id:"内置",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#内置","aria-hidden":"true"},"#"),n(" 内置")],-1),w=s("p",null,"由 markdown-it 内置支持:",-1),x={href:"https://help.github.com/articles/organizing-information-with-tables/",target:"_blank",rel:"noopener noreferrer"},F={href:"https://help.github.com/articles/basic-writing-and-formatting-syntax/#styling-text",target:"_blank",rel:"noopener noreferrer"},A=s("h3",{id:"标题锚点",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#标题锚点","aria-hidden":"true"},"#"),n(" 标题锚点")],-1),M=s("p",null,[n("你可能已经注意到,当你把鼠标放在各个章节的标题上时,会显示出一个 "),s("code",null,"#"),n(" 锚点。点击这个 "),s("code",null,"#"),n(" 锚点,可以直接跳转到对应章节。")],-1),j={class:"custom-container tip"},z=s("p",{class:"custom-container-title"},"提示",-1),L={href:"https://github.com/valeriangalliat/markdown-it-anchor",target:"_blank",rel:"noopener noreferrer"},T=s("h3",{id:"链接",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#链接","aria-hidden":"true"},"#"),n(" 链接")],-1),V={href:"https://spec.commonmark.org/0.29/#link-reference-definitions",target:"_blank",rel:"noopener noreferrer"},q=t(`以我们文档的源文件为例:
└─ docs + └─ zh + ├─ guide + │ ├─ getting-started.md + │ ├─ markdown.md # <- 我们在这里 + │ └─ README.md + ├─ reference + │ └─ config.md + └─ README.md +
原始 Markdown
<!-- 相对路径 --> + +[首页](../README.md) +[配置参考](../reference/config.md) +[快速上手](./getting-started.md) + +<!-- 绝对路径 --> + +[指南](/zh/guide/README.md) +[配置参考 > markdown.links](/zh/reference/config.md#links) + +<!-- URL --> + +[GitHub](https://github.com) +
转换为
<template> + <RouterLink to="/zh/">首页</RouterLink> + <RouterLink to="/zh/reference/config.html">配置参考</RouterLink> + <RouterLink to="/zh/guide/getting-started.html">快速上手</RouterLink> + <RouterLink to="/zh/guide/">指南</RouterLink> + <RouterLink to="/zh/reference/config.html#links"> + 配置参考 > markdown.links + </RouterLink> + <a href="https://github.com" target="_blank" rel="noopener noreferrer"> + GitHub + </a> +</template> +
渲染为
`,7),B=s("br",null,null,-1),R=s("br",null,null,-1),P=s("br",null,null,-1),H=s("br",null,null,-1),S=s("br",null,null,-1),N={href:"https://github.com",target:"_blank",rel:"noopener noreferrer"},U=s("p",null,[s("strong",null,"解释")],-1),O=s("li",null,[n("内部链接会被转换为 "),s("code",null,""),n(" 以便进行 SPA 导航。")],-1),G=s("code",null,".md",-1),I=s("li",null,[n("外部链接会被添加 "),s("code",null,'target="_blank" rel="noopener noreferrer"'),n(" 属性。")],-1),J=s("p",null,[s("strong",null,"建议")],-1),W=s("p",null,"对于指向内部 Markdown 文件的链接,尽可能使用相对路径而不是绝对路径。",-1),X=s("ul",null,[s("li",null,"相对路径是指向目标文件的有效链接,在你的编辑器或者代码仓库中浏览源文件时也可以正确跳转。"),s("li",null,"相对路径在不同 locales 下都是一致的,这样在翻译你的内容时就不需要修改 locale 路径了。")],-1),K={class:"custom-container tip"},Q=s("p",{class:"custom-container-title"},"提示",-1),Y=s("p",null,"链接扩展是由我们的内置插件支持的。",-1),Z=s("h3",{id:"emoji",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#emoji","aria-hidden":"true"},"#"),n(" Emoji 🎉")],-1),$=s("p",null,[n("你可以在你的 Markdown 内容中输入 "),s("code",null,":EMOJICODE:"),n(" 来添加 Emoji 表情。")],-1),ss={href:"https://github.com/ikatyang/emoji-cheat-sheet",target:"_blank",rel:"noopener noreferrer"},ns=t(` 输入
VuePress 2 已经发布 :tada: ! +
输出
VuePress 2 已经发布 🎉 !
`,4),ls={class:"custom-container tip"},as=s("p",{class:"custom-container-title"},"提示",-1),es={href:"https://github.com/markdown-it/markdown-it-emoji",target:"_blank",rel:"noopener noreferrer"},os=t(`# 目录
如果你想要把当前页面的目录添加到 Markdown 内容中,你可以使用
[[toc]]
语法。输入
[[toc]] +
输出
`,5),ps={class:"table-of-contents"},ts=s("p",null,[n("目录中的标题将会链接到对应的 "),s("a",{href:"#%E6%A0%87%E9%A2%98%E9%94%9A%E7%82%B9"},"标题锚点"),n(",因此如果你禁用了标题锚点,可能会影响目录的功能。")],-1),rs={class:"custom-container tip"},is=s("p",{class:"custom-container-title"},"提示",-1),cs={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc",target:"_blank",rel:"noopener noreferrer"},ds=t(`# 代码块
下列代码块扩展是在 Node 端进行 Markdown 解析的时候实现的。这意味着代码块并不会在客户端被处理。
# 行高亮
你可以在代码块添加行数范围标记,来为对应代码行进行高亮:
输入
\`\`\`ts{1,6-8} +import { defaultTheme, defineUserConfig } from 'vuepress' + +export default defineUserConfig({ + title: '你好, VuePress', + + theme: defaultTheme({ + logo: 'https://vuejs.org/images/logo.png', + }), +}) +\`\`\` +
输出
import { defaultTheme, defineUserConfig } from 'vuepress' + +export default defineUserConfig({ + title: '你好, VuePress', + + theme: defaultTheme({ + logo: 'https://vuejs.org/images/logo.png', + }), +}) +
行数范围标记的例子:
`,10),Ds={class:"custom-container tip"},us=s("p",{class:"custom-container-title"},"提示",-1),ys={href:"https://github.com/egoist/markdown-it-highlight-lines",target:"_blank",rel:"noopener noreferrer"},ms=t(`
- 行数范围:
{5-8}
- 多个单行:
{4,7,9}
- 组合:
{4,7-13,16,23-27,40}
# 行号
你肯定已经注意到在代码块的最左侧会展示行号。这个功能是默认启用的,你可以通过配置来禁用它。
你可以在代码块添加
:line-numbers
/:no-line-numbers
标记来覆盖配置项中的设置。输入
\`\`\`ts +// 行号默认是启用的 +const line2 = 'This is line 2' +const line3 = 'This is line 3' +\`\`\` + +\`\`\`ts:no-line-numbers +// 行号被禁用 +const line2 = 'This is line 2' +const line3 = 'This is line 3' +\`\`\` +
输出
// 行号默认是启用的 +const line2 = 'This is line 2' +const line3 = 'This is line 3' +
`,8),vs={class:"custom-container tip"},hs=s("p",{class:"custom-container-title"},"提示",-1),bs=s("p",null,"行号扩展是由我们的内置插件支持的。",-1),gs=s("h4",{id:"添加-v-pre",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#添加-v-pre","aria-hidden":"true"},"#"),n(" 添加 v-pre")],-1),_s=s("p",null,[n("由于 "),s("a",{href:"#%E6%A8%A1%E6%9D%BF%E8%AF%AD%E6%B3%95"},"模板语法可以在 Markdown 中使用"),n(",它也同样可以在代码块中生效。")],-1),Cs={href:"https://v3.vuejs.org/api/directives.html#v-pre",target:"_blank",rel:"noopener noreferrer"},ks=t(`// 行号被禁用 +const line2 = 'This is line 2' +const line3 = 'This is line 3' +
你可以在代码块添加
:v-pre
/:no-v-pre
标记来覆盖配置项中的设置。注意
模板语法的字符有可能会被语法高亮器解析,比如 "Mustache" 语法(即双花括号)。因此,就像下面的例子一样,在某些语言中
:no-v-pre
可能并不能生效。如果你无论如何都想在这种语言中使用 Vue 语法,你可以尝试禁用默认的语法高亮,然后在客户端实现你的自定义代码高亮。
输入
\`\`\`md +<!-- 默认情况下,这里会被保持原样 --> + +1 + 2 + 3 = {{ 1 + 2 + 3 }} +\`\`\` + +\`\`\`md:no-v-pre +<!-- 这里会被 Vue 编译 --> + +1 + 2 + 3 = {{ 1 + 2 + 3 }} +\`\`\` + +\`\`\`js:no-v-pre +// 由于 JS 代码高亮,这里不会被正确编译 +const onePlusTwoPlusThree = {{ 1 + 2 + 3 }} +\`\`\` +
输出
<!-- 默认情况下,这里会被保持原样 --> + +1 + 2 + 3 = {{ 1 + 2 + 3 }} +
<!-- 这里会被 Vue 编译 --> + +1 + 2 + 3 = 6 +
`,8),Es={class:"custom-container tip"},fs=s("p",{class:"custom-container-title"},"提示",-1),ws=s("p",null,"v-pre 扩展是由我们的内置插件支持的。",-1),xs=t(`// 由于 JS 代码高亮,这里不会被正确编译 +const onePlusTwoPlusThree = {{ 1 + 2 + 3 }} +
# 导入代码块
你可以使用下面的语法,从文件中导入代码块:
<!-- 最简单的语法 --> + +@[code](../foo.js) +
如果你只想导入这个文件的一部分:
<!-- 仅导入第 1 行至第 10 行 --> + +@[code{1-10}](../foo.js) +
代码语言会根据文件扩展名进行推断,但我们建议你显式指定:
<!-- 指定代码语言 --> + +@[code js](../foo.js) +
实际上,
[]
内的第二部分会被作为代码块标记来处理,因此在上面 代码块 章节中提到的语法在这里都可以支持:<!-- 行高亮 --> + +@[code js{2,4-5}](../foo.js) +
下面是一个复杂的例子:
- 导入
'../foo.js'
文件的第 3 行至第 10 行- 指定语言为
'js'
- 对导入代码的第 3 行进行高亮,即
'../foo.js'
文件的第 5 行- 禁用行号
@[code{3-10} js{3}:no-line-numbers](../foo.js) +
需要注意的是,路径别名在导入代码语法中不会生效。你可以通过下面的配置来自行处理路径别名:
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + markdown: { + importCode: { + handleImportPath: (str) => + str.replace(/^@src/, path.resolve(__dirname, 'path/to/src')), + }, + }, +} +
`,15),Fs={class:"custom-container tip"},As=s("p",{class:"custom-container-title"},"提示",-1),Ms=s("p",null,"导入代码扩展是由我们的内置插件支持的。",-1),js=s("h2",{id:"在-markdown-中使用-vue",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#在-markdown-中使用-vue","aria-hidden":"true"},"#"),n(" 在 Markdown 中使用 Vue")],-1),zs=s("p",null,"这一章节会介绍 Vue 在 Markdown 中一些基本用法。",-1),Ls=s("h3",{id:"模板语法",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#模板语法","aria-hidden":"true"},"#"),n(" 模板语法")],-1),Ts=s("p",null,"我们知道:",-1),Vs=s("ul",null,[s("li",null,"Markdown 中允许使用 HTML。"),s("li",null,"Vue 模板语法是和 HTML 兼容的。")],-1),qs={href:"https://v3.vuejs.org/guide/template-syntax.html",target:"_blank",rel:"noopener noreferrer"},Bs=t(`<!-- 会被解析至 'path/to/src/foo.js' --> + +@[code](@src/foo.js) +
输入
一加一等于: {{ 1 + 1 }} + +<span v-for="i in 3"> span: {{ i }} </span> +
输出
一加一等于: 2
`,4),Rs=t('# 组件
你可以在 Markdown 中直接使用 Vue 组件。
输入
这是默认主题内置的 `<Badge />` 组件 <Badge text="演示" />\n
输出
',5),Ps=s("code",null,"",-1),Hs={class:"custom-container tip"},Ss=s("p",{class:"custom-container-title"},"提示",-1),Ns=s("h2",{id:"注意事项",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#注意事项","aria-hidden":"true"},"#"),n(" 注意事项")],-1),Us=s("h3",{id:"非标准的-html-标签",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#非标准的-html-标签","aria-hidden":"true"},"#"),n(" 非标准的 HTML 标签")],-1),Os=s("p",null,"非标准的 HTML 标签不会被 Vue 模板编译器识别成原生 HTML 标签。相反,Vue 会尝试将这些标签解析为 Vue 组件,而显然这些组件通常是不存在的。 例如:",-1),Gs={href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center",target:"_blank",rel:"noopener noreferrer"},Is={href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font",target:"_blank",rel:"noopener noreferrer"},Js={href:"https://developer.mozilla.org/zh-CN/docs/Web/MathML",target:"_blank",rel:"noopener noreferrer"},Ws=s("p",null,"如果你无论如何都要使用这些标签的话,可以尝试下面两种方法之一:",-1),Xs={href:"https://v3.cn.vuejs.org/api/directives.html#v-pre",target:"_blank",rel:"noopener noreferrer"},Ks={href:"https://v3.vuejs.org/api/application-config.html#compileroptions",target:"_blank",rel:"noopener noreferrer"},Qs=s("code",null,"@bundler-webpack",-1),Ys=s("code",null,"@bundler-vite",-1);function Zs($s,sn){const o=r("ExternalLinkIcon"),e=r("RouterLink"),p=r("router-link"),d=r("Badge");return i(),c("div",null,[b,s("p",null,[n("在阅读本章节之前,请确保你已经对 Markdown 有所了解。如果你还不了解 Markdown ,请先学习一些 "),s("a",g,[n("Markdown 教程"),l(o)]),n("。")]),_,s("p",null,[n("VuePress 会使用 "),s("a",C,[n("markdown-it"),l(o)]),n(" 来解析 Markdown 内容,因此可以借助于 markdown-it 插件来实现 "),s("a",k,[n("语法扩展"),l(o)]),n(" 。")]),E,s("p",null,[n("你也可以通过 "),l(e,{to:"/zh/reference/config.html#markdown"},{default:a(()=>[n("markdown")]),_:1}),n(" 和 "),l(e,{to:"/zh/reference/plugin-api.html#extendsmarkdown"},{default:a(()=>[n("extendsMarkdown")]),_:1}),n(" 来配置这些内置扩展、加载更多 markdown-it 插件、实现你自己的扩展等。")]),f,w,s("ul",null,[s("li",null,[s("a",x,[n("表格"),l(o)]),n(" (GFM)")]),s("li",null,[s("a",F,[n("删除线"),l(o)]),n(" (GFM)")])]),A,M,s("div",j,[z,s("p",null,[n("标题锚点扩展由 "),s("a",L,[n("markdown-it-anchor"),l(o)]),n(" 支持。")]),s("p",null,[n("配置参考: "),l(e,{to:"/zh/reference/config.html#markdown-anchor"},{default:a(()=>[n("markdown.anchor")]),_:1})])]),T,s("p",null,[n("在你使用 Markdown 的 "),s("a",V,[n("链接语法"),l(o)]),n(" 时, VuePress 会为你进行一些转换。")]),q,s("p",null,[l(e,{to:"/zh/"},{default:a(()=>[n("首页")]),_:1}),B,l(e,{to:"/zh/reference/config.html"},{default:a(()=>[n("配置参考")]),_:1}),R,l(e,{to:"/zh/guide/getting-started.html"},{default:a(()=>[n("快速上手")]),_:1}),P,l(e,{to:"/zh/guide/"},{default:a(()=>[n("指南")]),_:1}),H,l(e,{to:"/zh/reference/config.html#links"},{default:a(()=>[n("配置参考 > markdown.links")]),_:1}),S,s("a",N,[n("GitHub"),l(o)])]),U,s("ul",null,[O,s("li",null,[n("指向 "),G,n(" 文件的内部链接会被转换为目标页面的 "),l(e,{to:"/zh/guide/page.html#%E8%B7%AF%E7%94%B1"},{default:a(()=>[n("路由路径")]),_:1}),n(",并且支持绝对路径和相对路径。")]),I]),J,W,X,s("div",K,[Q,Y,s("p",null,[n("配置参考: "),l(e,{to:"/zh/reference/config.html#markdown-links"},{default:a(()=>[n("markdown.links")]),_:1})])]),Z,$,s("p",null,[n("前往 "),s("a",ss,[n("emoji-cheat-sheet"),l(o)]),n(" 来查看所有可用的 Emoji 表情和对应代码。")]),ns,s("div",ls,[as,s("p",null,[n("Emoji 扩展由 "),s("a",es,[n("markdown-it-emoji"),l(o)]),n(" 支持。")]),s("p",null,[n("配置参考: "),l(e,{to:"/zh/reference/config.html#markdown-emoji"},{default:a(()=>[n("markdown.emoji")]),_:1})])]),os,s("nav",ps,[s("ul",null,[s("li",null,[l(p,{to:"#语法扩展"},{default:a(()=>[n("语法扩展")]),_:1}),s("ul",null,[s("li",null,[l(p,{to:"#内置"},{default:a(()=>[n("内置")]),_:1})]),s("li",null,[l(p,{to:"#标题锚点"},{default:a(()=>[n("标题锚点")]),_:1})]),s("li",null,[l(p,{to:"#链接"},{default:a(()=>[n("链接")]),_:1})]),s("li",null,[l(p,{to:"#emoji"},{default:a(()=>[n("Emoji 🎉")]),_:1})]),s("li",null,[l(p,{to:"#目录"},{default:a(()=>[n("目录")]),_:1})]),s("li",null,[l(p,{to:"#代码块"},{default:a(()=>[n("代码块")]),_:1})]),s("li",null,[l(p,{to:"#导入代码块"},{default:a(()=>[n("导入代码块")]),_:1})])])]),s("li",null,[l(p,{to:"#在-markdown-中使用-vue"},{default:a(()=>[n("在 Markdown 中使用 Vue")]),_:1}),s("ul",null,[s("li",null,[l(p,{to:"#模板语法"},{default:a(()=>[n("模板语法")]),_:1})]),s("li",null,[l(p,{to:"#组件"},{default:a(()=>[n("组件")]),_:1})])])]),s("li",null,[l(p,{to:"#注意事项"},{default:a(()=>[n("注意事项")]),_:1}),s("ul",null,[s("li",null,[l(p,{to:"#非标准的-html-标签"},{default:a(()=>[n("非标准的 HTML 标签")]),_:1})])])])])]),ts,s("div",rs,[is,s("p",null,[n("目录扩展由 "),s("a",cs,[n("@mdit-vue/plugin-toc"),l(o)]),n(" 支持。")]),s("p",null,[n("配置参考: "),l(e,{to:"/zh/reference/config.html#markdown-toc"},{default:a(()=>[n("markdown.toc")]),_:1})])]),ds,s("div",Ds,[us,s("p",null,[n("行高亮扩展是由我们的内置插件支持的,该扩展 Fork 并修改自 "),s("a",ys,[n("markdown-it-highlight-lines"),l(o)]),n("。")]),s("p",null,[n("配置参考: "),l(e,{to:"/zh/reference/config.html#markdown-code-highlightlines"},{default:a(()=>[n("markdown.code.highlightLines")]),_:1})])]),ms,s("div",vs,[hs,bs,s("p",null,[n("配置参考: "),l(e,{to:"/zh/reference/config.html#markdown-code-linenumbers"},{default:a(()=>[n("markdown.code.lineNumbers")]),_:1})])]),gs,_s,s("p",null,[n("为了避免你的代码块被 Vue 编译, VuePress 默认会在你的代码块添加 "),s("a",Cs,[n("v-pre"),l(o)]),n(" 指令。这一默认行为可以在配置中关闭。")]),ks,s("div",Es,[fs,ws,s("p",null,[n("配置参考: "),l(e,{to:"/zh/reference/config.html#markdown-code-vpre-block"},{default:a(()=>[n("markdown.code.vPre.block")]),_:1})])]),xs,s("div",Fs,[As,Ms,s("p",null,[n("配置参考: "),l(e,{to:"/zh/reference/config.html#markdown-importcode"},{default:a(()=>[n("markdown.importCode")]),_:1})])]),js,zs,s("p",null,[n("可以前往 "),l(e,{to:"/zh/advanced/cookbook/markdown-and-vue-sfc.html"},{default:a(()=>[n("Cookbook > Markdown 和 Vue SFC")]),_:1}),n(" 来了解更多内容。")]),Ls,Ts,Vs,s("p",null,[n("这意味着, Markdown 中允许直接使用 "),s("a",qs,[n("Vue 模板语法"),l(o)]),n("。")]),Bs,s("p",null,[(i(),c(y,null,m(3,D=>s("span",null," span: "+v(D),1)),64))]),Rs,s("p",null,[n("这是默认主题内置的 "),Ps,n(" 组件 "),l(d,{text:"演示"})]),s("div",Hs,[Ss,s("p",null,[n("前往 "),l(e,{to:"/zh/reference/components.html"},{default:a(()=>[n("内置组件")]),_:1}),n(" 查看所有内置组件。")]),s("p",null,[n("前往 "),l(e,{to:"/zh/reference/default-theme/components.html"},{default:a(()=>[n("默认主题 > 内置组件")]),_:1}),n(" 查看默认主题中的所有内置组件。")])]),Ns,Us,Os,s("ul",null,[s("li",null,[n("已废弃的 HTML 标签,比如 "),s("a",Gs,[n(" "),l(o)]),n(" 和 "),s("a",Is,[n(""),l(o)]),n(" 等。")]),s("li",null,[s("a",Js,[n("MathML 标签"),l(o)]),n(",它们可能会被一些 markdown-it 的 LaTeX 插件用到。")])]),Ws,s("ul",null,[s("li",null,[n("添加一个 "),s("a",Xs,[n("v-pre"),l(o)]),n(" 指令来跳过这个元素和它的子元素的编译过程。注意所有的模板语法也都会失效。")]),s("li",null,[n("设置 "),s("a",Ks,[n("compilerOptions.isCustomElement"),l(o)]),n(" 来告诉 Vue 模板编译器不要尝试作为组件来解析它们。 "),s("ul",null,[s("li",null,[n("对于 "),Qs,n(" ,设置 "),l(e,{to:"/zh/reference/bundler/webpack.html#vue"},{default:a(()=>[n("vue.compilerOptions")]),_:1})]),s("li",null,[n("对于 "),Ys,n(" ,设置 "),l(e,{to:"/zh/reference/bundler/vite.html#vuepluginoptions"},{default:a(()=>[n("vuePluginOptions.template.compilerOptions")]),_:1})])])])])])}const ln=u(h,[["render",Zs],["__file","markdown.html.vue"]]);export{ln as default}; diff --git a/assets/markdown.html-Pg4gltF4.js b/assets/markdown.html-Pg4gltF4.js new file mode 100644 index 000000000..b7df63a2a --- /dev/null +++ b/assets/markdown.html-Pg4gltF4.js @@ -0,0 +1,50 @@ +import{_ as d,r as e,o as r,c as u,d as a,a as s,b as n,w as l,e as p}from"./app-eU2v8o1B.js";const D={},v=s("h1",{id:"markdown",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#markdown","aria-hidden":"true"},"#"),n(" Markdown")],-1),m=s("h2",{id:"custom-containers",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#custom-containers","aria-hidden":"true"},"#"),n(" Custom Containers")],-1),b=p(` Usage:
::: <type> [title] +[content] +::: +
The
type
is required, and thetitle
andcontent
are optional.Supported
`,4),y=s("li",null,[s("code",null,"tip")],-1),g=s("li",null,[s("code",null,"warning")],-1),h=s("li",null,[s("code",null,"danger")],-1),_=s("li",null,[s("code",null,"details")],-1),k=s("ul",null,[s("li",null,[s("code",null,"code-group")]),s("li",null,[s("code",null,"code-group-item")])],-1),C=s("li",null,[s("p",null,"Example 1 (default title):")],-1),E=p(`type
:Input
::: tip +This is a tip +::: + +::: warning +This is a warning +::: + +::: danger +This is a dangerous warning +::: + +::: details +This is a details block +::: +
Output
TIP
This is a tip
WARNING
This is a warning
DANGER
This is a dangerous warning
This is a details block
- Example 2 (custom title):
Input
::: danger STOP +Danger zone, do not proceed +::: + +::: details Click me to view the code + +\`\`\`ts +console.log('Hello, VuePress!') +\`\`\` + +::: +
Output
STOP
Danger zone, do not proceed
Click me to view the code
console.log('Hello, VuePress!') +
- Example 3 (code group alias):
Input
:::: code-group +::: code-group-item FOO + +\`\`\`ts +const foo = 'foo' +\`\`\` + +::: + +::: code-group-item BAR + +\`\`\`ts +const bar = 'bar' +\`\`\` + +::: +:::: +
Output
`,17),f=s("div",{class:"language-typescript line-numbers-mode","data-ext":"ts"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#569CD6"}},"const"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#4FC1FF"}},"foo"),s("span",{style:{color:"#D4D4D4"}}," = "),s("span",{style:{color:"#CE9178"}},"'foo'")]),n(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),x=s("div",{class:"language-typescript line-numbers-mode","data-ext":"ts"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#569CD6"}},"const"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#4FC1FF"}},"bar"),s("span",{style:{color:"#D4D4D4"}}," = "),s("span",{style:{color:"#CE9178"}},"'bar'")]),n(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1);function w(F,T){const c=e("NpmBadge"),i=e("RouterLink"),o=e("CodeGroupItem"),t=e("CodeGroup");return r(),u("div",null,[v,a(c,{package:"@vuepress/theme-default"}),m,s("ul",null,[s("li",null,[b,s("ul",null,[y,g,h,_,s("li",null,[n("Alias of "),a(i,{to:"/reference/default-theme/components.html#codegroup"},{default:l(()=>[n("CodeGroup")]),_:1}),n(" and "),a(i,{to:"/reference/default-theme/components.html#codegroupitem"},{default:l(()=>[n("CodeGroupItem")]),_:1}),n(": "),k])])]),C]),E,a(t,null,{default:l(()=>[a(o,{title:"FOO"},{default:l(()=>[f]),_:1}),a(o,{title:"BAR"},{default:l(()=>[x]),_:1})]),_:1})])}const N=d(D,[["render",w],["__file","markdown.html.vue"]]);export{N as default}; diff --git a/assets/markdown.html-RaKgDcuz.js b/assets/markdown.html-RaKgDcuz.js new file mode 100644 index 000000000..5b62b989a --- /dev/null +++ b/assets/markdown.html-RaKgDcuz.js @@ -0,0 +1,129 @@ +import{_ as D,r as p,o as r,c,a as s,b as n,d as e,w as a,F as h,f as m,t as y,e as i}from"./app-eU2v8o1B.js";const v={},b=s("h1",{id:"markdown",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#markdown","aria-hidden":"true"},"#"),n(" Markdown")],-1),g={href:"https://commonmark.org/help/",target:"_blank",rel:"noopener noreferrer"},f=s("h2",{id:"syntax-extensions",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#syntax-extensions","aria-hidden":"true"},"#"),n(" Syntax Extensions")],-1),k={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},_={href:"https://github.com/markdown-it/markdown-it#syntax-extensions",target:"_blank",rel:"noopener noreferrer"},C=s("p",null,"This section will introduce built-in Markdown syntax extensions of VuePress.",-1),E=s("h3",{id:"embedded",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#embedded","aria-hidden":"true"},"#"),n(" Embedded")],-1),w=s("p",null,"Embedded by markdown-it:",-1),x={href:"https://help.github.com/articles/organizing-information-with-tables/",target:"_blank",rel:"noopener noreferrer"},F={href:"https://help.github.com/articles/basic-writing-and-formatting-syntax/#styling-text",target:"_blank",rel:"noopener noreferrer"},T=s("h3",{id:"header-anchors",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#header-anchors","aria-hidden":"true"},"#"),n(" Header Anchors")],-1),A=s("p",null,[n("You might have noticed that, a "),s("code",null,"#"),n(" anchor is displayed when you hover the mouse on the headers of each section. By clicking the "),s("code",null,"#"),n(" anchor, you can jump to the section directly.")],-1),M={class:"custom-container tip"},j=s("p",{class:"custom-container-title"},"TIP",-1),L={href:"https://github.com/valeriangalliat/markdown-it-anchor",target:"_blank",rel:"noopener noreferrer"},I=s("h3",{id:"links",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#links","aria-hidden":"true"},"#"),n(" Links")],-1),R={href:"https://spec.commonmark.org/0.29/#link-reference-definitions",target:"_blank",rel:"noopener noreferrer"},V=i(`Take our documentation source files as an example:
└─ docs + ├─ guide + │ ├─ getting-started.md + │ ├─ markdown.md # <- Here we are + │ └─ README.md + ├─ reference + │ └─ config.md + └─ README.md +
Raw Markdown
<!-- relative path --> + +[Home](../README.md) +[Config Reference](../reference/config.md) +[Getting Started](./getting-started.md) + +<!-- absolute path --> + +[Guide](/guide/README.md) +[Config Reference > markdown.links](/reference/config.md#links) + +<!-- URL --> + +[GitHub](https://github.com) +
Converted to
<template> + <RouterLink to="/">Home</RouterLink> + <RouterLink to="/reference/config.html">Config Reference</RouterLink> + <RouterLink to="/guide/getting-started.html">Getting Started</RouterLink> + <RouterLink to="/guide/">Guide</RouterLink> + <RouterLink to="/reference/config.html#links"> + Config Reference > markdown.links + </RouterLink> + <a href="https://github.com" target="_blank" rel="noopener noreferrer"> + GitHub + </a> +</template> +
Rendered as
`,7),P=s("br",null,null,-1),q=s("br",null,null,-1),B=s("br",null,null,-1),H=s("br",null,null,-1),O=s("br",null,null,-1),S={href:"https://github.com",target:"_blank",rel:"noopener noreferrer"},N=s("p",null,[s("strong",null,"Explanation")],-1),G=s("li",null,[n("Internal links will be converted to "),s("code",null,""),n(" for SPA navigation.")],-1),U=s("code",null,".md",-1),Y=s("li",null,[n("External links will get "),s("code",null,'target="_blank" rel="noopener noreferrer"'),n(" attrs.")],-1),W=s("p",null,[s("strong",null,"Suggestion")],-1),z=s("p",null,"Try to use relative paths instead of absolute paths for internal links to markdown files.",-1),J=s("ul",null,[s("li",null,"Relative paths are a valid links to the target files, and they can navigate correctly when browsing the source files in your editor or repository."),s("li",null,"Relative paths are consistent in different locales, so you don't need to change the locale path when translating your content.")],-1),X={class:"custom-container tip"},K=s("p",{class:"custom-container-title"},"TIP",-1),Q=s("p",null,"This links extension is supported by our built-in plugin.",-1),Z=s("h3",{id:"emoji",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#emoji","aria-hidden":"true"},"#"),n(" Emoji 🎉")],-1),$=s("p",null,[n("You can add emoji to your Markdown content by typing "),s("code",null,":EMOJICODE:"),n(".")],-1),ss={href:"https://github.com/ikatyang/emoji-cheat-sheet",target:"_blank",rel:"noopener noreferrer"},ns=i(` Input
VuePress 2 is out :tada: ! +
Output
VuePress 2 is out 🎉 !
`,4),es={class:"custom-container tip"},as=s("p",{class:"custom-container-title"},"TIP",-1),ls={href:"https://github.com/markdown-it/markdown-it-emoji",target:"_blank",rel:"noopener noreferrer"},os=i(`# Table of Contents
If you want to put the table of contents (TOC) of your current page inside your Markdown content, you can use the
[[toc]]
syntax.Input
[[toc]] +
Output
`,5),ts={class:"table-of-contents"},is=s("p",null,[n("The headers in TOC will link to the corresponding "),s("a",{href:"#header-anchors"},"header anchors"),n(", so TOC won't work well if you disable header anchors.")],-1),ps={class:"custom-container tip"},rs=s("p",{class:"custom-container-title"},"TIP",-1),cs={href:"https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc",target:"_blank",rel:"noopener noreferrer"},ds=i(`# Code Blocks
Following code blocks extensions are implemented during markdown parsing in Node side. That means, the code blocks won't be processed in client side.
# Line Highlighting
You can highlight specified lines of your code blocks by adding line ranges mark in your fenced code blocks:
Input
\`\`\`ts{1,6-8} +import { defaultTheme, defineUserConfig } from 'vuepress' + +export default defineUserConfig({ + title: 'Hello, VuePress', + + theme: defaultTheme({ + logo: 'https://vuejs.org/images/logo.png', + }), +}) +\`\`\` +
Output
import { defaultTheme, defineUserConfig } from 'vuepress' + +export default defineUserConfig({ + title: 'Hello, VuePress', + + theme: defaultTheme({ + logo: 'https://vuejs.org/images/logo.png', + }), +}) +
Examples for line ranges mark:
`,10),us={class:"custom-container tip"},Ds=s("p",{class:"custom-container-title"},"TIP",-1),hs={href:"https://github.com/egoist/markdown-it-highlight-lines",target:"_blank",rel:"noopener noreferrer"},ms=i(`
- Line ranges:
{5-8}
- Multiple single lines:
{4,7,9}
- Combined:
{4,7-13,16,23-27,40}
# Line Numbers
You must have noticed that the number of lines is displayed on the left side of code blocks. This is enabled by default and you can disable it in config.
You can add
:line-numbers
/:no-line-numbers
mark in your fenced code blocks to override the value set in config.Input
\`\`\`ts +// line-numbers is enabled by default +const line2 = 'This is line 2' +const line3 = 'This is line 3' +\`\`\` + +\`\`\`ts:no-line-numbers +// line-numbers is disabled +const line2 = 'This is line 2' +const line3 = 'This is line 3' +\`\`\` +
Output
// line-numbers is enabled by default +const line2 = 'This is line 2' +const line3 = 'This is line 3' +
`,8),ys={class:"custom-container tip"},vs=s("p",{class:"custom-container-title"},"TIP",-1),bs=s("p",null,"This line numbers extension is supported by our built-in plugin.",-1),gs=s("h4",{id:"wrap-with-v-pre",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#wrap-with-v-pre","aria-hidden":"true"},"#"),n(" Wrap with v-pre")],-1),fs=s("p",null,[n("As "),s("a",{href:"#template-syntax"},"template syntax is allowed in Markdown"),n(", it would also work in code blocks, too.")],-1),ks={href:"https://vuejs.org/api/built-in-directives.html#v-pre",target:"_blank",rel:"noopener noreferrer"},_s=i(`// line-numbers is disabled +const line2 = 'This is line 2' +const line3 = 'This is line 3' +
You can add
:v-pre
/:no-v-pre
mark in your fenced code blocks to override the value set in config.WARNING
The template syntax characters, for example, the "Mustache" syntax (double curly braces) might be parsed by the syntax highlighter. Thus, as the following example,
:no-v-pre
might not work well in some languages.If you want to make Vue syntax work in those languages anyway, try to disable the default syntax highlighting and implement your own syntax highlighting in client side.
Input
\`\`\`md +<!-- This will be kept as is by default --> + +1 + 2 + 3 = {{ 1 + 2 + 3 }} +\`\`\` + +\`\`\`md:no-v-pre +<!-- This will be compiled by Vue --> + +1 + 2 + 3 = {{ 1 + 2 + 3 }} +\`\`\` + +\`\`\`js:no-v-pre +// This won't be compiled correctly because of js syntax highlighting +const onePlusTwoPlusThree = {{ 1 + 2 + 3 }} +\`\`\` +
Output
<!-- This will be kept as is --> + +1 + 2 + 3 = {{ 1 + 2 + 3 }} +
<!-- This will be compiled by Vue --> + +1 + 2 + 3 = 6 +
`,8),Cs={class:"custom-container tip"},Es=s("p",{class:"custom-container-title"},"TIP",-1),ws=s("p",null,"This v-pre extension is supported by our built-in plugin.",-1),xs=i(`// This won't be compiled correctly because of js syntax highlighting +const onePlusTwoPlusThree = {{ 1 + 2 + 3 }} +
# Import Code Blocks
You can import code blocks from files with following syntax:
<!-- minimal syntax --> + +@[code](../foo.js) +
If you want to partially import the file:
<!-- partial import, from line 1 to line 10 --> + +@[code{1-10}](../foo.js) +
The code language is inferred from the file extension, while it is recommended to specify it explicitly:
<!-- specify the code language --> + +@[code js](../foo.js) +
In fact, the second part inside the
[]
will be treated as the mark of the code fence, so it supports all the syntax mentioned in the above Code Blocks section:<!-- line highlighting --> + +@[code js{2,4-5}](../foo.js) +
Here is a complex example:
- import line 3 to line 10 of the
'../foo.js'
file- specify the language as
'js'
- highlight line 3 of the imported code, i.e. line 5 of the
'../foo.js'
file- disable line numbers
@[code{3-10} js{3}:no-line-numbers](../foo.js) +
Notice that path aliases are not available in import code syntax. You can use following config to handle path alias yourself:
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + markdown: { + importCode: { + handleImportPath: (str) => + str.replace(/^@src/, path.resolve(__dirname, 'path/to/src')), + }, + }, +} +
`,15),Fs={class:"custom-container tip"},Ts=s("p",{class:"custom-container-title"},"TIP",-1),As=s("p",null,"This import code extension is supported by our built-in plugin.",-1),Ms=s("h2",{id:"using-vue-in-markdown",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#using-vue-in-markdown","aria-hidden":"true"},"#"),n(" Using Vue in Markdown")],-1),js=s("p",null,"This section will introduce some basic usage of Vue in Markdown.",-1),Ls=s("h3",{id:"template-syntax",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#template-syntax","aria-hidden":"true"},"#"),n(" Template Syntax")],-1),Is=s("p",null,"As we know:",-1),Rs=s("ul",null,[s("li",null,"HTML is allowed in Markdown."),s("li",null,"Vue template syntax is compatible with HTML.")],-1),Vs={href:"https://vuejs.org/guide/essentials/template-syntax.html",target:"_blank",rel:"noopener noreferrer"},Ps=i(`<!-- it will be resolved to 'path/to/src/foo.js' --> + +@[code](@src/foo.js) +
Input
One plus one equals: {{ 1 + 1 }} + +<span v-for="i in 3"> span: {{ i }} </span> +
Output
One plus one equals: 2
`,4),qs=i('# Components
You can use Vue components directly in Markdown.
Input
This is default theme built-in `<Badge />` component <Badge text="demo" />\n
Output
',5),Bs=s("code",null,"",-1),Hs={class:"custom-container tip"},Os=s("p",{class:"custom-container-title"},"TIP",-1),Ss=s("h2",{id:"cautions",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#cautions","aria-hidden":"true"},"#"),n(" Cautions")],-1),Ns=s("h3",{id:"non-standard-html-tags",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#non-standard-html-tags","aria-hidden":"true"},"#"),n(" Non-Standard HTML Tags")],-1),Gs=s("p",null,"Non-standard HTML tags would not be recognized as native HTML tags by Vue template compiler. Instead, Vue will try to resolve those tags as Vue components, and obviously these components usually don't exist. For example:",-1),Us={href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center",target:"_blank",rel:"noopener noreferrer"},Ys={href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font",target:"_blank",rel:"noopener noreferrer"},Ws={href:"https://developer.mozilla.org/en-US/docs/Web/MathML",target:"_blank",rel:"noopener noreferrer"},zs=s("p",null,"If you want to use those tags anyway, try either of the following workarounds:",-1),Js={href:"https://vuejs.org/api/built-in-directives.html#v-pre",target:"_blank",rel:"noopener noreferrer"},Xs={href:"https://vuejs.org/api/application.html#app-config-compileroptions",target:"_blank",rel:"noopener noreferrer"},Ks=s("code",null,"@bundler-webpack",-1),Qs=s("code",null,"@bundler-vite",-1);function Zs($s,sn){const o=p("ExternalLinkIcon"),l=p("RouterLink"),t=p("router-link"),d=p("Badge");return r(),c("div",null,[b,s("p",null,[n("Make sure you already know Markdown well before reading this section. If not, please learn some "),s("a",g,[n("Markdown tutorials"),e(o)]),n(" first.")]),f,s("p",null,[n("The Markdown content in VuePress will be parsed by "),s("a",k,[n("markdown-it"),e(o)]),n(", which supports "),s("a",_,[n("syntax extensions"),e(o)]),n(" via markdown-it plugins.")]),C,s("p",null,[n("You can also configure those built-in extensions, load more markdown-it plugins and implement your own extensions via "),e(l,{to:"/reference/config.html#markdown"},{default:a(()=>[n("markdown")]),_:1}),n(" option and "),e(l,{to:"/reference/plugin-api.html#extendsmarkdown"},{default:a(()=>[n("extendsMarkdown")]),_:1}),n(" option.")]),E,w,s("ul",null,[s("li",null,[s("a",x,[n("Tables"),e(o)]),n(" (GFM)")]),s("li",null,[s("a",F,[n("Strikethrough"),e(o)]),n(" (GFM)")])]),T,A,s("div",M,[j,s("p",null,[n("This header anchors extension is supported by "),s("a",L,[n("markdown-it-anchor"),e(o)]),n(".")]),s("p",null,[n("Config reference: "),e(l,{to:"/reference/config.html#markdown-anchor"},{default:a(()=>[n("markdown.anchor")]),_:1})])]),I,s("p",null,[n("When using Markdown "),s("a",R,[n("link syntax"),e(o)]),n(", VuePress will implement some conversions for you.")]),V,s("p",null,[e(l,{to:"/"},{default:a(()=>[n("Home")]),_:1}),P,e(l,{to:"/reference/config.html"},{default:a(()=>[n("Config Reference")]),_:1}),q,e(l,{to:"/guide/getting-started.html"},{default:a(()=>[n("Getting Started")]),_:1}),B,e(l,{to:"/guide/"},{default:a(()=>[n("Guide")]),_:1}),H,e(l,{to:"/reference/config.html#links"},{default:a(()=>[n("Config Reference > markdown.links")]),_:1}),O,s("a",S,[n("GitHub"),e(o)])]),N,s("ul",null,[G,s("li",null,[n("Internal links to "),U,n(" files will be converted to the "),e(l,{to:"/guide/page.html#routing"},{default:a(()=>[n("page route path")]),_:1}),n(", and both absolute path and relative path are supported.")]),Y]),W,z,J,s("div",X,[K,Q,s("p",null,[n("Config reference: "),e(l,{to:"/reference/config.html#markdown-links"},{default:a(()=>[n("markdown.links")]),_:1})])]),Z,$,s("p",null,[n("For a full list of available emoji and codes, check out "),s("a",ss,[n("emoji-cheat-sheet"),e(o)]),n(".")]),ns,s("div",es,[as,s("p",null,[n("This emoji extension is supported by "),s("a",ls,[n("markdown-it-emoji"),e(o)]),n(".")]),s("p",null,[n("Config reference: "),e(l,{to:"/reference/config.html#markdown-emoji"},{default:a(()=>[n("markdown.emoji")]),_:1})])]),os,s("nav",ts,[s("ul",null,[s("li",null,[e(t,{to:"#syntax-extensions"},{default:a(()=>[n("Syntax Extensions")]),_:1}),s("ul",null,[s("li",null,[e(t,{to:"#embedded"},{default:a(()=>[n("Embedded")]),_:1})]),s("li",null,[e(t,{to:"#header-anchors"},{default:a(()=>[n("Header Anchors")]),_:1})]),s("li",null,[e(t,{to:"#links"},{default:a(()=>[n("Links")]),_:1})]),s("li",null,[e(t,{to:"#emoji"},{default:a(()=>[n("Emoji 🎉")]),_:1})]),s("li",null,[e(t,{to:"#table-of-contents"},{default:a(()=>[n("Table of Contents")]),_:1})]),s("li",null,[e(t,{to:"#code-blocks"},{default:a(()=>[n("Code Blocks")]),_:1})]),s("li",null,[e(t,{to:"#import-code-blocks"},{default:a(()=>[n("Import Code Blocks")]),_:1})])])]),s("li",null,[e(t,{to:"#using-vue-in-markdown"},{default:a(()=>[n("Using Vue in Markdown")]),_:1}),s("ul",null,[s("li",null,[e(t,{to:"#template-syntax"},{default:a(()=>[n("Template Syntax")]),_:1})]),s("li",null,[e(t,{to:"#components"},{default:a(()=>[n("Components")]),_:1})])])]),s("li",null,[e(t,{to:"#cautions"},{default:a(()=>[n("Cautions")]),_:1}),s("ul",null,[s("li",null,[e(t,{to:"#non-standard-html-tags"},{default:a(()=>[n("Non-Standard HTML Tags")]),_:1})])])])])]),is,s("div",ps,[rs,s("p",null,[n("This toc extension is supported by "),s("a",cs,[n("@mdit-vue/plugin-toc"),e(o)]),n(".")]),s("p",null,[n("Config reference: "),e(l,{to:"/reference/config.html#markdown-toc"},{default:a(()=>[n("markdown.toc")]),_:1})])]),ds,s("div",us,[Ds,s("p",null,[n("This line highlighting extension is supported by our built-in plugin, which is forked and modified from "),s("a",hs,[n("markdown-it-highlight-lines"),e(o)]),n(".")]),s("p",null,[n("Config reference: "),e(l,{to:"/reference/config.html#markdown-code-highlightlines"},{default:a(()=>[n("markdown.code.highlightLines")]),_:1})])]),ms,s("div",ys,[vs,bs,s("p",null,[n("Config reference: "),e(l,{to:"/reference/config.html#markdown-code-linenumbers"},{default:a(()=>[n("markdown.code.lineNumbers")]),_:1})])]),gs,fs,s("p",null,[n("To avoid your code blocks being compiled by Vue, VuePress will add "),s("a",ks,[n("v-pre"),e(o)]),n(" directive to your code blocks by default, which can be disabled in config.")]),_s,s("div",Cs,[Es,ws,s("p",null,[n("Config reference: "),e(l,{to:"/reference/config.html#markdown-code-vpre-block"},{default:a(()=>[n("markdown.code.vPre.block")]),_:1})])]),xs,s("div",Fs,[Ts,As,s("p",null,[n("Config reference: "),e(l,{to:"/reference/config.html#markdown-importcode"},{default:a(()=>[n("markdown.importCode")]),_:1})])]),Ms,js,s("p",null,[n("Check out "),e(l,{to:"/advanced/cookbook/markdown-and-vue-sfc.html"},{default:a(()=>[n("Cookbook > Markdown and Vue SFC")]),_:1}),n(" for more details.")]),Ls,Is,Rs,s("p",null,[n("That means, "),s("a",Vs,[n("Vue template syntax"),e(o)]),n(" is allowed in Markdown.")]),Ps,s("p",null,[(r(),c(h,null,m(3,u=>s("span",null," span: "+y(u),1)),64))]),qs,s("p",null,[n("This is default theme built-in "),Bs,n(" component "),e(d,{text:"demo"})]),s("div",Hs,[Os,s("p",null,[n("Check out the "),e(l,{to:"/reference/components.html"},{default:a(()=>[n("Built-in Components")]),_:1}),n(" for a full list of built-in components.")]),s("p",null,[n("Check out the "),e(l,{to:"/reference/default-theme/components.html"},{default:a(()=>[n("Default Theme > Built-in Components")]),_:1}),n(" for a full list of default theme built-in components.")])]),Ss,Ns,Gs,s("ul",null,[s("li",null,[n("Deprecated HTML tags such as "),s("a",Us,[n(" "),e(o)]),n(" and "),s("a",Ys,[n(""),e(o)]),n(".")]),s("li",null,[s("a",Ws,[n("MathML tags"),e(o)]),n(", which might be used by some markdown-it LaTeX plugin.")])]),zs,s("ul",null,[s("li",null,[n("Adding a "),s("a",Js,[n("v-pre"),e(o)]),n(" directive to skip the compilation of the element and its children. Notice that the template syntax would also be invalid.")]),s("li",null,[n("Using "),s("a",Xs,[n("compilerOptions.isCustomElement"),e(o)]),n(" to tell Vue template compiler not try to resolve them as components. "),s("ul",null,[s("li",null,[n("For "),Ks,n(", set "),e(l,{to:"/reference/bundler/webpack.html#vue"},{default:a(()=>[n("vue.compilerOptions")]),_:1})]),s("li",null,[n("For "),Qs,n(", set "),e(l,{to:"/reference/bundler/vite.html#vuepluginoptions"},{default:a(()=>[n("vuePluginOptions.template.compilerOptions")]),_:1})])])])])])}const en=D(v,[["render",Zs],["__file","markdown.html.vue"]]);export{en as default}; diff --git a/assets/markdown.html-XKozsizF.js b/assets/markdown.html-XKozsizF.js new file mode 100644 index 000000000..fea29888f --- /dev/null +++ b/assets/markdown.html-XKozsizF.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-6a0a3d62","path":"/zh/guide/markdown.html","title":"Markdown","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"语法扩展","slug":"语法扩展","link":"#语法扩展","children":[{"level":3,"title":"内置","slug":"内置","link":"#内置","children":[]},{"level":3,"title":"标题锚点","slug":"标题锚点","link":"#标题锚点","children":[]},{"level":3,"title":"链接","slug":"链接","link":"#链接","children":[]},{"level":3,"title":"Emoji 🎉","slug":"emoji","link":"#emoji","children":[]},{"level":3,"title":"目录","slug":"目录","link":"#目录","children":[]},{"level":3,"title":"代码块","slug":"代码块","link":"#代码块","children":[]},{"level":3,"title":"导入代码块","slug":"导入代码块","link":"#导入代码块","children":[]}]},{"level":2,"title":"在 Markdown 中使用 Vue","slug":"在-markdown-中使用-vue","link":"#在-markdown-中使用-vue","children":[{"level":3,"title":"模板语法","slug":"模板语法","link":"#模板语法","children":[]},{"level":3,"title":"组件","slug":"组件","link":"#组件","children":[]}]},{"level":2,"title":"注意事项","slug":"注意事项","link":"#注意事项","children":[{"level":3,"title":"非标准的 HTML 标签","slug":"非标准的-html-标签","link":"#非标准的-html-标签","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/guide/markdown.md"}');export{l as data}; diff --git a/assets/markdown.html-f0CKPNMw.js b/assets/markdown.html-f0CKPNMw.js new file mode 100644 index 000000000..6986ac1e5 --- /dev/null +++ b/assets/markdown.html-f0CKPNMw.js @@ -0,0 +1,50 @@ +import{_ as r,r as e,o as t,c as u,d as l,a as s,w as a,b as n,e as p}from"./app-eU2v8o1B.js";const D={},v=s("h1",{id:"markdown",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#markdown","aria-hidden":"true"},"#"),n(" Markdown")],-1),m=s("h2",{id:"自定义容器",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#自定义容器","aria-hidden":"true"},"#"),n(" 自定义容器")],-1),b=p(` 使用:
::: <type> [title] +[content] +::: +
type
是必需的,title
和content
是可选的。支持的
`,4),y=s("li",null,[s("code",null,"tip")],-1),g=s("li",null,[s("code",null,"warning")],-1),_=s("li",null,[s("code",null,"danger")],-1),h=s("li",null,[s("code",null,"details")],-1),k=s("ul",null,[s("li",null,[s("code",null,"code-group")]),s("li",null,[s("code",null,"code-group-item")])],-1),C=s("li",null,[s("p",null,"示例 1 (默认标题):")],-1),E=p(`type
有:输入
::: tip +这是一个提示 +::: + +::: warning +这是一个警告 +::: + +::: danger +这是一个危险警告 +::: + +::: details +这是一个 details 标签 +::: +
输出
提示
这是一个提示
注意
这是一个警告
警告
这是一个危险警告
这是一个 details 标签
- 示例 2 (自定义标题):
输入
::: danger STOP +危险区域,禁止通行 +::: + +::: details 点击查看代码 + +\`\`\`ts +console.log('你好,VuePress!') +\`\`\` + +::: +
输出
STOP
危险区域,禁止通行
点击查看代码
console.log('你好,VuePress!') +
- 示例 3 (Code Group 别名):
输入
:::: code-group +::: code-group-item FOO + +\`\`\`ts +const foo = 'foo' +\`\`\` + +::: + +::: code-group-item BAR + +\`\`\`ts +const bar = 'bar' +\`\`\` + +::: +:::: +
输出
`,17),f=s("div",{class:"language-typescript line-numbers-mode","data-ext":"ts"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#569CD6"}},"const"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#4FC1FF"}},"foo"),s("span",{style:{color:"#D4D4D4"}}," = "),s("span",{style:{color:"#CE9178"}},"'foo'")]),n(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1),x=s("div",{class:"language-typescript line-numbers-mode","data-ext":"ts"},[s("pre",{class:"shiki dark-plus",style:{"background-color":"#1E1E1E"},tabindex:"0"},[s("code",null,[s("span",{class:"line"},[s("span",{style:{color:"#569CD6"}},"const"),s("span",{style:{color:"#D4D4D4"}}," "),s("span",{style:{color:"#4FC1FF"}},"bar"),s("span",{style:{color:"#D4D4D4"}}," = "),s("span",{style:{color:"#CE9178"}},"'bar'")]),n(` +`),s("span",{class:"line"})])]),s("div",{class:"line-numbers","aria-hidden":"true"},[s("div",{class:"line-number"})])],-1);function F(w,B){const c=e("NpmBadge"),i=e("RouterLink"),o=e("CodeGroupItem"),d=e("CodeGroup");return t(),u("div",null,[v,l(c,{package:"@vuepress/theme-default"}),m,s("ul",null,[s("li",null,[b,s("ul",null,[y,g,_,h,s("li",null,[l(i,{to:"/zh/reference/default-theme/components.html#codegroup"},{default:a(()=>[n("CodeGroup")]),_:1}),n(" 和 "),l(i,{to:"/zh/reference/default-theme/components.html#codegroupitem"},{default:a(()=>[n("CodeGroupItem")]),_:1}),n(" 的别名: "),k])])]),C]),E,l(d,null,{default:a(()=>[l(o,{title:"FOO"},{default:a(()=>[f]),_:1}),l(o,{title:"BAR"},{default:a(()=>[x]),_:1})]),_:1})])}const A=r(D,[["render",F],["__file","markdown.html.vue"]]);export{A as default}; diff --git a/assets/markdown.html-ii1dNmCW.js b/assets/markdown.html-ii1dNmCW.js new file mode 100644 index 000000000..95f11c310 --- /dev/null +++ b/assets/markdown.html-ii1dNmCW.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-0978b044","path":"/guide/markdown.html","title":"Markdown","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Syntax Extensions","slug":"syntax-extensions","link":"#syntax-extensions","children":[{"level":3,"title":"Embedded","slug":"embedded","link":"#embedded","children":[]},{"level":3,"title":"Header Anchors","slug":"header-anchors","link":"#header-anchors","children":[]},{"level":3,"title":"Links","slug":"links","link":"#links","children":[]},{"level":3,"title":"Emoji 🎉","slug":"emoji","link":"#emoji","children":[]},{"level":3,"title":"Table of Contents","slug":"table-of-contents","link":"#table-of-contents","children":[]},{"level":3,"title":"Code Blocks","slug":"code-blocks","link":"#code-blocks","children":[]},{"level":3,"title":"Import Code Blocks","slug":"import-code-blocks","link":"#import-code-blocks","children":[]}]},{"level":2,"title":"Using Vue in Markdown","slug":"using-vue-in-markdown","link":"#using-vue-in-markdown","children":[{"level":3,"title":"Template Syntax","slug":"template-syntax","link":"#template-syntax","children":[]},{"level":3,"title":"Components","slug":"components","link":"#components","children":[]}]},{"level":2,"title":"Cautions","slug":"cautions","link":"#cautions","children":[{"level":3,"title":"Non-Standard HTML Tags","slug":"non-standard-html-tags","link":"#non-standard-html-tags","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":2},{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1}]},"filePathRelative":"guide/markdown.md"}');export{e as data}; diff --git a/assets/markdown.html-v53gNZxx.js b/assets/markdown.html-v53gNZxx.js new file mode 100644 index 000000000..690405b58 --- /dev/null +++ b/assets/markdown.html-v53gNZxx.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-c78c5de8","path":"/zh/reference/default-theme/markdown.html","title":"Markdown","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"自定义容器","slug":"自定义容器","link":"#自定义容器","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/default-theme/markdown.md"}');export{e as data}; diff --git a/assets/medium-zoom.html-EoVYZum_.js b/assets/medium-zoom.html-EoVYZum_.js new file mode 100644 index 000000000..10cf9ba64 --- /dev/null +++ b/assets/medium-zoom.html-EoVYZum_.js @@ -0,0 +1,31 @@ +import{_ as i,r as o,o as c,c as r,d as a,a as s,b as n,e as l}from"./app-eU2v8o1B.js";const t={},d=s("h1",{id:"medium-zoom",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#medium-zoom","aria-hidden":"true"},"#"),n(" medium-zoom")],-1),D={href:"https://github.com/francoischalifour/medium-zoom#readme",target:"_blank",rel:"noopener noreferrer"},m=l(`该插件已经集成到默认主题中。
# 使用方法
npm i -D @vuepress/plugin-medium-zoom@next +
import { mediumZoomPlugin } from '@vuepress/plugin-medium-zoom' + +export default { + plugins: [ + mediumZoomPlugin({ + // 配置项 + }), + ], +} +
# 配置项
# selector
类型:
string
默认值:
':not(a) > img'
详情:
可缩放的图片的选择器。
默认情况下,该插件会使
<a>
标签以外的所有图片都支持缩放。# delay
类型:
number
默认值:
500
详情:
以毫秒为单位的延迟。
在切换路由进入一个新页面时,该插件会在一定延迟后才使页面内的图片支持缩放。
# zoomOptions
`,10),u=s("li",null,[s("p",null,[n("类型: "),s("code",null,"Object")])],-1),h=s("li",null,[s("p",null,"详情:"),s("p",null,"medium-zoom 的配置项。")],-1),y=s("p",null,"参考:",-1),v={href:"https://github.com/francoischalifour/medium-zoom#options",target:"_blank",rel:"noopener noreferrer"},b=l(`# 样式
你可以通过 zoomOptions 对大部分的缩放样式进行自定义,不过作为补充,该插件同样提供了一些 CSS 变量:
:root { + --medium-zoom-z-index: 100; + --medium-zoom-bg-color: #ffffff; + --medium-zoom-opacity: 1; +} +
# Composition API
# useMediumZoom
`,5),C=s("p",null,"详情:",-1),_=s("code",null,"Zoom",-1),f={href:"https://github.com/francoischalifour/medium-zoom#methods",target:"_blank",rel:"noopener noreferrer"},g=s("p",null,"该插件会在切换路由进入当前页面时使图片支持缩放。但如果你要动态添加新图片,那么你可能就需要这个方法来让这些新图片也支持缩放。",-1),E=s("p",null,[n("该插件在 "),s("code",null,"Zoom"),n(" 实例上额外添加了一个 "),s("code",null,"refresh"),n(" 方法,它将使用 "),s("a",{href:"#selector"},"selector"),n(" 作为默认参数,先调用 "),s("code",null,"zoom.detach()"),n(" 再调用 "),s("code",null,"zoom.attach()"),n(" ,便于你快速刷新当前页面图片的缩放状态。")],-1),x=s("li",null,[s("p",null,"示例:")],-1),z=l(``,1);function k(A,F){const p=o("NpmBadge"),e=o("ExternalLinkIcon");return c(),r("div",null,[d,a(p,{package:"@vuepress/plugin-medium-zoom"}),s("p",null,[n("将 "),s("a",D,[n("medium-zoom"),a(e)]),n(" 集成到 VuePress 中,为图片提供可缩放的功能。")]),m,s("ul",null,[u,h,s("li",null,[y,s("ul",null,[s("li",null,[s("a",v,[n("medium-zoom > Options"),a(e)])])])])]),b,s("ul",null,[s("li",null,[C,s("p",null,[n("返回该插件使用的 "),_,n(" 实例,便于你直接使用实例上的 "),s("a",f,[n("methods"),a(e)]),n(" 。")]),g,E]),x]),z])}const Z=i(t,[["render",k],["__file","medium-zoom.html.vue"]]);export{Z as default}; diff --git a/assets/medium-zoom.html-dLpz25ZR.js b/assets/medium-zoom.html-dLpz25ZR.js new file mode 100644 index 000000000..c3d484711 --- /dev/null +++ b/assets/medium-zoom.html-dLpz25ZR.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2ad6454d","path":"/reference/plugin/medium-zoom.html","title":"medium-zoom","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"selector","slug":"selector","link":"#selector","children":[]},{"level":3,"title":"delay","slug":"delay","link":"#delay","children":[]},{"level":3,"title":"zoomOptions","slug":"zoomoptions","link":"#zoomoptions","children":[]}]},{"level":2,"title":"Styles","slug":"styles","link":"#styles","children":[]},{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","children":[{"level":3,"title":"useMediumZoom","slug":"usemediumzoom","link":"#usemediumzoom","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/medium-zoom.md"}');export{e as data}; diff --git a/assets/medium-zoom.html-lG08Ag1t.js b/assets/medium-zoom.html-lG08Ag1t.js new file mode 100644 index 000000000..5dc139e11 --- /dev/null +++ b/assets/medium-zoom.html-lG08Ag1t.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-32cfa4fe","path":"/zh/reference/plugin/medium-zoom.html","title":"medium-zoom","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"selector","slug":"selector","link":"#selector","children":[]},{"level":3,"title":"delay","slug":"delay","link":"#delay","children":[]},{"level":3,"title":"zoomOptions","slug":"zoomoptions","link":"#zoomoptions","children":[]}]},{"level":2,"title":"样式","slug":"样式","link":"#样式","children":[]},{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","children":[{"level":3,"title":"useMediumZoom","slug":"usemediumzoom","link":"#usemediumzoom","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/medium-zoom.md"}');export{e as data}; diff --git a/assets/medium-zoom.html-qakUfSNj.js b/assets/medium-zoom.html-qakUfSNj.js new file mode 100644 index 000000000..5e8d14002 --- /dev/null +++ b/assets/medium-zoom.html-qakUfSNj.js @@ -0,0 +1,31 @@ +import{_ as p,r as o,o as t,c as r,d as e,a as s,b as n,e as l}from"./app-eU2v8o1B.js";const c={},d=s("h1",{id:"medium-zoom",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#medium-zoom","aria-hidden":"true"},"#"),n(" medium-zoom")],-1),m={href:"https://github.com/francoischalifour/medium-zoom#readme",target:"_blank",rel:"noopener noreferrer"},D=l(`import { nextTick } from 'vue' +import { useMediumZoom } from '@vuepress/plugin-medium-zoom/client' + +export default { + setup() { + const zoom = useMediumZoom() + + // ... 进行了一些操作,在当前页面添加了新的图片 + + // 此时你可能需要手动调用 \`refresh\` 来让这些新图片支持缩放 + nextTick(() => { + zoom.refresh() + }) + }, +} +
This plugin has been integrated into the default theme.
# Usage
npm i -D @vuepress/plugin-medium-zoom@next +
import { mediumZoomPlugin } from '@vuepress/plugin-medium-zoom' + +export default { + plugins: [ + mediumZoomPlugin({ + // options + }), + ], +} +
# Options
# selector
Type:
string
Default:
':not(a) > img'
Details:
Selector of zoomable images.
By default this plugin will make all images zoomable except those inside
<a>
tags.# delay
Type:
number
Default:
500
Details:
Delay in milliseconds.
After navigating to a new page, this plugin will make images zoomable with a delay.
# zoomOptions
`,10),u=s("li",null,[s("p",null,[n("Type: "),s("code",null,"Object")])],-1),h=s("li",null,[s("p",null,"Details:"),s("p",null,"Options for medium-zoom.")],-1),y=s("p",null,"Also see:",-1),v={href:"https://github.com/francoischalifour/medium-zoom#options",target:"_blank",rel:"noopener noreferrer"},b=l(`# Styles
You can customize most of the zoom styles via zoomOptions, while this plugin also provides some CSS variables for additional customization:
:root { + --medium-zoom-z-index: 100; + --medium-zoom-bg-color: #ffffff; + --medium-zoom-opacity: 1; +} +
# Composition API
# useMediumZoom
`,5),g=s("p",null,"Details:",-1),C=s("code",null,"Zoom",-1),f={href:"https://github.com/francoischalifour/medium-zoom#methods",target:"_blank",rel:"noopener noreferrer"},_=s("p",null,"This plugin will make images zoomable after navigating to current page. But if you are going to add new images dynamically, you may need this method to make those new images zoomable, too.",-1),z=s("p",null,[n("This plugin adds an extra "),s("code",null,"refresh"),n(" method on the "),s("code",null,"Zoom"),n(" instance, which will call "),s("code",null,"zoom.detach()"),n(" then "),s("code",null,"zoom.attach()"),n(" with the "),s("a",{href:"#selector"},"selector"),n(" as the default parameter. It will help you to refresh the zoomable images for current page.")],-1),x=s("li",null,[s("p",null,"Example:")],-1),E=l(``,1);function k(A,w){const i=o("NpmBadge"),a=o("ExternalLinkIcon");return t(),r("div",null,[d,e(i,{package:"@vuepress/plugin-medium-zoom"}),s("p",null,[n("Integrate "),s("a",m,[n("medium-zoom"),e(a)]),n(" into VuePress, which can provide the ability to zoom images.")]),D,s("ul",null,[u,h,s("li",null,[y,s("ul",null,[s("li",null,[s("a",v,[n("medium-zoom > Options"),e(a)])])])])]),b,s("ul",null,[s("li",null,[g,s("p",null,[n("Returns the "),C,n(" instance that used by this plugin, so that you can use the instance "),s("a",f,[n("methods"),e(a)]),n(" directly.")]),_,z]),x]),E])}const B=p(c,[["render",k],["__file","medium-zoom.html.vue"]]);export{B as default}; diff --git a/assets/migration.html-j6eU3LYG.js b/assets/migration.html-j6eU3LYG.js new file mode 100644 index 000000000..b741dfd8c --- /dev/null +++ b/assets/migration.html-j6eU3LYG.js @@ -0,0 +1,97 @@ +import{_ as o,r as d,o as c,c as r,a as s,b as e,d as a,w as l,e as i}from"./app-eU2v8o1B.js";const t={},p=i(`import { nextTick } from 'vue' +import { useMediumZoom } from '@vuepress/plugin-medium-zoom/client' + +export default { + setup() { + const zoom = useMediumZoom() + + // ... do something to add new images in current page + + // then you may need to call \`refresh\` manually to make those new images zoomable + nextTick(() => { + zoom.refresh() + }) + }, +} +
# 从 v1 迁移
注意
VuePress v1 的插件和主题与 VuePress v2 不兼容。你需要将它们升级到与 v2 对应的版本。
VuePress v2 的一些主要改动和优化:
- VuePress v2 现在使用 Vue 3 ,因此你要保证你的组件和其他客户端文件是适用于 Vue 3 的。
- VuePress v2 是使用 TypeScript 开发的,因此它现在提供了更好的类型支持。我们强烈推荐你使用 TypeScript 来开发插件和主题。 VuePress 配置文件也同样支持 TypeScript ,你可以直接使用
.vuepress/config.ts
。- VuePress v2 支持使用 Webpack 和 Vite 作为打包工具。现在默认的打包工具是 Vite ,但你仍然可以选择使用 Webpack 。你甚至可以在开发模式使用 Vite 来获取更好的开发体验,而在构建模式使用 Webpack 来获取更好的浏览器兼容性。
- VuePress v2 现在是纯 ESM 包, CommonJS 格式的配置文件不再被支持。
VuePress v2 的核心思想和流程是和 v1 一致的,但 v2 API 经过了重新设计,更加标准化。因此在将现有的 v1 项目迁移至 v2 时,你很可能会遇到一些 Breaking Changes 。本指南将帮助你将 v1 的站点 / 插件 / 主题迁移至 v2 。
# 给用户
# 用户配置变更
配置文件应该使用 ESM 格式, CommonJS 格式的配置文件已不再支持。
// .vuepress/config.js + +- module.exports = { +- // 用户配置 +- } + ++ export default { ++ // 用户配置 ++ } +
# theme
不再支持通过字符串使用主题。需要直接引入主题。
- module.exports = { +- theme: '@vuepress/theme-default', +- themeConfig: { +- // 默认主题配置 +- }, +- } + ++ import { defaultTheme } from 'vuepress' ++ export default { ++ theme: defaultTheme({ ++ // 默认主题配置 ++ }) ++ } +
# themeConfig
移除。直接向主题传入配置。
# plugins
不再支持通过字符串使用插件。需要直接引入插件。
- module.exports = { +- plugins: [ +- [ +- '@vuepress/plugin-google-analytics', +- { +- id: 'G-XXXXXXXXXX', +- }, +- ], +- ], +- } + ++ import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics' ++ export default { ++ plugins: [ ++ googleAnalyticsPlugin({ ++ id: 'G-XXXXXXXXXX', ++ }), ++ ], ++ } +
# shouldPrefetch
默认值从
() => true
更改为true
。# extraWatchFiles
移除。
`,22),u=s("h4",{id:"patterns",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#patterns","aria-hidden":"true"},"#"),e(" patterns")],-1),h=s("p",null,[e("重命名为 "),s("code",null,"pagePatterns"),e(" 。")],-1),m=s("h4",{id:"markdown-linenumbers",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#markdown-linenumbers","aria-hidden":"true"},"#"),e(" markdown.lineNumbers")],-1),v=s("p",null,[e("默认值从 "),s("code",null,"false"),e(" 更改为 "),s("code",null,"true"),e(" 。")],-1),b=s("h4",{id:"markdown-pagesuffix",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#markdown-pagesuffix","aria-hidden":"true"},"#"),e(" markdown.pageSuffix")],-1),f=s("p",null,"移除。",-1),y=s("h4",{id:"markdown-externallinks",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#markdown-externallinks","aria-hidden":"true"},"#"),e(" markdown.externalLinks")],-1),_=s("h4",{id:"markdown-toc",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#markdown-toc","aria-hidden":"true"},"#"),e(" markdown.toc")],-1),g=s("p",null,"有改动。",-1),C=s("h4",{id:"markdown-plugins",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#markdown-plugins","aria-hidden":"true"},"#"),e(" markdown.plugins")],-1),E=s("p",null,"移除。",-1),k=s("h4",{id:"markdown-extendmarkdown",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#markdown-extendmarkdown","aria-hidden":"true"},"#"),e(" markdown.extendMarkdown")],-1),D=s("p",null,"移除。",-1),x=s("h4",{id:"markdown-extractheaders",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#markdown-extractheaders","aria-hidden":"true"},"#"),e(" markdown.extractHeaders")],-1),B=i(`# Webpack 相关配置
所有 Webpack 相关的配置都移动至
@vuepress/bundler-webpack
的配置项中,包括:
postcss
stylus
scss
sass
less
chainWebpack
configureWebpack
evergreen
:默认值从false
更改为true
`,4),w=s("h3",{id:"frontmatter-变更",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#frontmatter-变更","aria-hidden":"true"},"#"),e(" Frontmatter 变更")],-1),A=s("h4",{id:"meta",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#meta","aria-hidden":"true"},"#"),e(" meta")],-1),z=s("p",null,"移除。",-1),P=i(`- module.exports = { +- sass: { /* ... */ }, +- } + ++ import { webpackBundler } from '@vuepress/bundler-webpack' ++ export default { ++ bundler: webpackBundler({ ++ sass: { /* ... */ }, ++ }), ++ } +
head: + - - meta + - name: foo + content: bar + - - link + - rel: canonical + href: foobar + - - script + - {} + - console.log('hello from frontmatter'); +
和以下结构相同:
// .vuepress/config.ts +export default { + // ... + head: [ + ['meta', { name: 'foo', content: 'bar' }], + ['link', { rel: 'canonical', href: 'foobar' }], + ['script', {}, \`console.log('hello from frontmatter');\`], + ], + // ... +} +
# 永久链接 Patterns 变更
`,5),S=s("h3",{id:"调色板系统变更",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#调色板系统变更","aria-hidden":"true"},"#"),e(" 调色板系统变更")],-1),V=s("p",null,[e("VuePress v1 的 Stylus 调色板系统 (即 "),s("code",null,"styles/palette.styl"),e(" 和 "),s("code",null,"styles/index.styl"),e(") 不再由 VuePress Core 默认提供支持。")],-1),F=s("p",null,"主题作者可以使用自己的方式来为用户提供自定义样式的能力,而不必被限制在 Stylus 当中。",-1),X=s("h3",{id:"约定文件变更",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#约定文件变更","aria-hidden":"true"},"#"),e(" 约定文件变更")],-1),W=s("h4",{id:"vuepress-enhanceapp-js",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#vuepress-enhanceapp-js","aria-hidden":"true"},"#"),e(" .vuepress/enhanceApp.js")],-1),M=s("p",null,[e("重命名为 "),s("code",null,".vuepress/client.{js,ts}"),e(" ,使用方法也有改动。")],-1),H=s("h4",{id:"vuepress-components",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#vuepress-components","aria-hidden":"true"},"#"),e(" .vuepress/components/")],-1),j=s("p",null,"在该目录下的文件不会被自动注册为 Vue 组件。",-1),I=s("code",null,".vuepress/client.{js,ts}",-1),T=s("h4",{id:"vuepress-theme",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#vuepress-theme","aria-hidden":"true"},"#"),e(" .vuepress/theme/")],-1),q=s("p",null,"即使该目录存在,也不会被隐式默认当作本地主题目录。",-1),G=i(`
:i_month
:移除:i_day
:移除:minutes
:移除(v1 文档中未列出):seconds
:移除(v1 文档中未列出):regular
:重命名为:raw
# Markdown 变更
- Markdown 插槽不再被支持。
- Markdown 图片语法不再支持 Webpack 别名。不以
./
开头的链接也会被识别为相对路径,这与原生 Markdown 图片语法的行为一致。如果你想要使用 Webpack 别名,或者使用来自外部包的图片,你应该使用<img>
标签。- ![](@alias/foo.png) +- ![](package-name/bar.png) + ++ <img src="@alias/foo.png"> ++ <img src="package-name/bar.png"> +
# CLI 变更
# eject 命令
移除。
# cache 选项
-c, --cache [cache]
:修改为--cache <cache>
,意味着-c
不再是cache
选项的缩写,并且cache
选项的值不再是可选的。--no-cache
:重命名为--clean-cache
。# 默认主题变更
# 内置组件
<CodeGroup />
和<CodeBlock />
重命名为<CodeGroup />
和<CodeGroupItem />
<Badge />
$badgeErrorColor
调色板变量重命名为$badgeDangerColor
type
Prop 现在只接受tip
、warning
和danger
# 调色板系统
默认主题的调色板系统迁移为 SASS 和 CSS 变量。
`,13),N=s("h4",{id:"主题配置",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#主题配置","aria-hidden":"true"},"#"),e(" 主题配置")],-1),L=s("p",null,"默认主题的配置有大量变更,建议你阅读 v2 的默认主题配置参考文档来进行迁移。",-1),$=i(`这里仅列出部分要注意的变更:
# 侧边栏配置
- sidebar: { +- title: 'Foo Bar', +- path: '/foo/bar.html', +- collapsable: true, +- children: [ +- ['/baz', 'Baz'], +- ], +- } + ++ sidebar: { ++ text: 'Foo Bar', ++ link: '/foo/bar.html', ++ collapsible: true, ++ children: [ ++ { ++ text: 'Baz', ++ link: '/baz', ++ } ++ ], ++ } +
# 官方插件变更
查看 v2 版本的官方插件文档。
# 社区主题和插件
v1 的主题和插件和 v2 并不兼容。
请确保你在使用的主题和插件已经支持 v2 ,并前往它们各自的文档查看迁移指南。
# 给插件作者
一些主要的 Breaking Changes :
`,10),J=s("li",null,"你不能再在你的插件中使用其他插件了,这避免了很多由于插件嵌套引发的问题。如果你的插件依赖于别的插件,你可以在文档中列出他们,并让用户手动引入。或者,你也可以向用户提供一个插件数组以方便使用。",-1),R=s("li",null,[e("大部分 v1 Hook 都在 v2 中存在等效的 Hook 或实现方式。唯一的例外是 "),s("code",null,"extendsCli"),e(" ,它被移除了。")],-1),O=i('# 插件 API 变更
',2),U=s("h2",{id:"给主题作者",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#给主题作者","aria-hidden":"true"},"#"),e(" 给主题作者")],-1),K=s("p",null,[e("请先浏览 "),s("a",{href:"#%E6%8F%92%E4%BB%B6-api-%E5%8F%98%E6%9B%B4"},"插件 API 变更"),e(" 和 "),s("a",{href:"#%E4%B8%BB%E9%A2%98-api-%E5%8F%98%E6%9B%B4"},"主题 API 变更"),e("。")],-1),Q=s("p",null,"虽然我们不允许在插件中使用其他插件了,但是你仍然可以在你的主题中使用插件。",-1),Y=s("p",null,"一些主要的 Breaking Changes :",-1),Z=s("strong",null,"主题目录结构约定",-1),ee=s("li",null,[s("code",null,"theme/enhanceApp.js"),e(" 文件不会被隐式作为 Client App Enhance 文件。你需要在 "),s("code",null,"clientConfigFile"),e(" Hook 中显式指定它。")],-1),se=s("code",null,"theme/global-components/",-1),ne=s("code",null,"clientConfigFile",-1),ae=i("
plugins
:移除ready
:重命名为onPrepared
updated
:重命名为onWatched
generated
:重命名为onGenerated
additionalPages
:移除,改为在onInitialized
Hook 中使用app.pages.push(createPage())
clientDynamicModules
:移除,改为在onPrepared
Hook 中使用app.writeTemp()
enhanceAppFiles
:移除,使用clientConfigFile
HookglobalUIComponents
:移除,使用clientConfigFile
HookclientRootMixin
:移除,使用clientConfigFile
HookextendMarkdown
:重命名为extendsMarkdown
chainMarkdown
:移除extendPageData
:重命名为extendsPage
extendsCli
:移除configureWebpack
:移除chainWebpack
:移除beforeDevServer
:移除afterDevServer
:移除theme/layouts/
目录下的文件不会被自动注册为布局组件。你需要在clientConfigFile
中通过layouts
来显式指定。theme/templates/
目录下的文件不会被自动用作 dev / ssr 的模板。你需要通过templateBuild
和templateDev
配置项来显式指定。你始终需要提供一个合法的 JS 入口文件,不要再使用 ",3),le=s("code",null,"themeConfig",-1),ie=s("code",null,"this.$site.themeConfig",-1),oe=s("code",null,"themeConfig",-1),de=s("code",null,"useThemeData",-1),ce=s("li",null,[e("考虑到可扩展性, "),s("code",null,"this.$site.pages"),e(" 不再可用。")],-1),re=s("h3",{id:"主题-api-变更",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#主题-api-变更","aria-hidden":"true"},"#"),e(" 主题 API 变更")],-1),te=s("h4",{id:"layouts",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#layouts","aria-hidden":"true"},"#"),e(" layouts")],-1),pe=s("p",null,"移除。",-1),ue=s("p",null,"现在你需要在客户端配置文件中设置布局组件。",-1),he=s("h4",{id:"extend",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#extend","aria-hidden":"true"},"#"),e(" extend")],-1),me=s("p",null,[e("重命名为 "),s("code",null,"extends"),e(" 。")],-1),ve=s("p",null,[e("你仍然可以通过 "),s("code",null,"extends: parentTheme()"),e(" 来继承一个父主题,这将会继承其插件和布局等。")],-1),be=s("code",null,"@theme",-1),fe=s("code",null,"@parent-theme",-1);function ye(_e,ge){const n=d("RouterLink");return c(),r("div",null,[p,s("p",null,[e("你可以手动在 "),a(n,{to:"/zh/reference/plugin-api.html#onwatched"},{default:l(()=>[e("onWatched")]),_:1}),e(" Hook 中监听文件变化。")]),u,h,m,s("p",null,[e("移动至 "),a(n,{to:"/zh/reference/config.html#markdown-code-linenumbers"},{default:l(()=>[e("markdown.code.lineNumbers")]),_:1}),e(" 。")]),v,b,f,y,s("p",null,[e("移动至 "),a(n,{to:"/zh/reference/config.html#markdown-links"},{default:l(()=>[e("markdown.links.externalAttrs")]),_:1}),e(" 。")]),_,g,s("p",null,[e("参考 "),a(n,{to:"/zh/reference/config.html#markdown-toc"},{default:l(()=>[e("配置 > markdown.toc")]),_:1})]),C,E,s("p",null,[e("在 "),a(n,{to:"/zh/reference/plugin-api.html#extendsmarkdown"},{default:l(()=>[e("extendsMarkdown")]),_:1}),e(" Hook 中使用 markdown-it 插件。")]),k,D,s("p",null,[e("使用 "),a(n,{to:"/zh/reference/plugin-api.html#extendsmarkdown"},{default:l(()=>[e("extendsMarkdown")]),_:1}),e(" Hook 。")]),x,s("p",null,[e("移动至 "),a(n,{to:"/zh/reference/config.html#markdown-headers"},{default:l(()=>[e("markdown.headers")]),_:1}),e(" 。")]),B,s("p",null,[e("请参考 "),a(n,{to:"/zh/guide/bundler.html"},{default:l(()=>[e("指南 > Bundler")]),_:1}),e(" 。")]),w,A,z,s("p",null,[e("改为使用 "),a(n,{to:"/zh/reference/frontmatter.html#head"},{default:l(()=>[e("head")]),_:1}),e(" 。例如:")]),P,s("p",null,[e("参考 "),a(n,{to:"/zh/reference/frontmatter.html#permalinkpattern"},{default:l(()=>[e("Frontmatter > permalinkPattern")]),_:1}),e(" 。")]),S,V,s("p",null,[e("调色板系统提取到了 "),a(n,{to:"/zh/reference/plugin/palette.html"},{default:l(()=>[e("@vuepress/plugin-palette")]),_:1}),e(" 当中。")]),F,s("p",null,[e("如果你使用的是默认主题,那么调色板系统仍然存在,但改为使用 SASS ,并且大部分变量都迁移为 CSS 变量。参考 "),a(n,{to:"/zh/reference/default-theme/styles.html"},{default:l(()=>[e("默认主题 > 样式")]),_:1}),e(" 。")]),X,W,M,s("p",null,[e("参考 "),a(n,{to:"/zh/advanced/cookbook/usage-of-client-config.html"},{default:l(()=>[e("深入 > Cookbook > 客户端配置的使用方法")]),_:1}),e(" 。")]),H,j,s("p",null,[e("你需要使用 "),a(n,{to:"/zh/reference/plugin/register-components.html"},{default:l(()=>[e("@vuepress/plugin-register-components")]),_:1}),e(" ,或者在 "),I,e(" 中手动注册你的组件。")]),T,q,s("p",null,[e("你需要在 "),a(n,{to:"/zh/reference/config.html#theme"},{default:l(()=>[e("theme")]),_:1}),e(" 配置项中显式引入并使用本地主题。")]),G,s("p",null,[e("参考 "),a(n,{to:"/zh/reference/default-theme/styles.html"},{default:l(()=>[e("默认主题 > 样式")]),_:1}),e(" 。")]),N,L,s("p",null,[e("参考 "),a(n,{to:"/zh/reference/default-theme/config.html"},{default:l(()=>[e("默认主题 > 配置")]),_:1}),e(" 。")]),$,s("ul",null,[J,R,s("li",null,[e("Webpack 相关的 Hook 都被移除了,因为 VuePress Core 已经和 Webpack 解耦了。你可以尝试使用 "),a(n,{to:"/zh/reference/plugin-api.html#extendsbundleroptions"},{default:l(()=>[e("extendsBundlerOptions")]),_:1}),e(" Hook 来进行相似的操作,但要注意应适配所有不同的打包工具。")])]),s("p",null,[e("你可以参考 "),a(n,{to:"/zh/advanced/plugin.html"},{default:l(()=>[e("深入 > 开发插件")]),_:1}),e(" 来了解如何开发一个 v2 插件。")]),O,s("p",null,[e("参考 "),a(n,{to:"/zh/reference/plugin-api.html"},{default:l(()=>[e("插件 API")]),_:1}),e(" 。")]),U,K,Q,Y,s("ul",null,[s("li",null,[e("所谓的 "),Z,e(" 不再存在。 "),s("ul",null,[ee,s("li",null,[se,e(" 目录下的文件不会被自动注册为 Vue 组件。你需要使用 "),a(n,{to:"/zh/reference/plugin/register-components.html"},{default:l(()=>[e("@vuepress/plugin-register-components")]),_:1}),e(" ,或者在 "),ne,e(" 中手动注册组件。")]),ae])]),s("li",null,[le,e(" 已经从用户配置和站点数据中移除。如果你想要像 v1 一样通过 "),ie,e(" 来访问 "),oe,e(" ,我们现在建议使用 "),a(n,{to:"/zh/reference/plugin/theme-data.html"},{default:l(()=>[e("@vuepress/plugin-theme-data")]),_:1}),e(" 插件和它提供的 Composition API "),de,e(" 。")]),s("li",null,[e("Stylus 不再是默认的 CSS 预处理器,并且 Stylus 调色板系统不再被默认支持。如果你仍然想要使用和 v1 类似的调色板系统,可以使用 "),a(n,{to:"/zh/reference/plugin/palette.html"},{default:l(()=>[e("@vuepress/plugin-palette")]),_:1}),e(" 。")]),s("li",null,[e("由 Prism.js 提供的 Markdown 代码块的语法高亮不再被默认支持。你可以选择使用 "),a(n,{to:"/zh/reference/plugin/prismjs.html"},{default:l(()=>[e("@vuepress/plugin-prismjs")]),_:1}),e(" 或 "),a(n,{to:"/zh/reference/plugin/shiki.html"},{default:l(()=>[e("@vuepress/plugin-shiki")]),_:1}),e(" ,或者用你自己的方式实现语法高亮。")]),ce]),s("p",null,[e("你可以参考 "),a(n,{to:"/zh/advanced/theme.html"},{default:l(()=>[e("深入 > 开发主题")]),_:1}),e(" 来了解如何开发一个 v2 主题。")]),re,te,pe,ue,s("p",null,[e("参考 "),a(n,{to:"/zh/advanced/theme.html"},{default:l(()=>[e("深入 > 开发主题")]),_:1}),e(" 。")]),he,me,ve,s("p",null,[e("你可以参考 "),a(n,{to:"/zh/reference/default-theme/extending.html"},{default:l(()=>[e("默认主题 > 继承")]),_:1}),e(" 来了解如何继承默认主题。")]),s("p",null,[be,e(" 和 "),fe,e(" 别名默认被移除了,但你仍然可以使用类似的方式来开发一个可继承的主题,参考 "),a(n,{to:"/zh/advanced/cookbook/making-a-theme-extendable.html"},{default:l(()=>[e("深入 > Cookbook > 开发一个可继承的主题")]),_:1}),e(" 。")])])}const Ee=o(t,[["render",ye],["__file","migration.html.vue"]]);export{Ee as default}; diff --git a/assets/migration.html-jhc4o0sF.js b/assets/migration.html-jhc4o0sF.js new file mode 100644 index 000000000..baf4498a7 --- /dev/null +++ b/assets/migration.html-jhc4o0sF.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-d0112c92","path":"/guide/migration.html","title":"Migrating from v1","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"For Users","slug":"for-users","link":"#for-users","children":[{"level":3,"title":"User Config Change","slug":"user-config-change","link":"#user-config-change","children":[]},{"level":3,"title":"Frontmatter Change","slug":"frontmatter-change","link":"#frontmatter-change","children":[]},{"level":3,"title":"Permalink Patterns Change","slug":"permalink-patterns-change","link":"#permalink-patterns-change","children":[]},{"level":3,"title":"Palette System Change","slug":"palette-system-change","link":"#palette-system-change","children":[]},{"level":3,"title":"Conventional Files Change","slug":"conventional-files-change","link":"#conventional-files-change","children":[]},{"level":3,"title":"Markdown Change","slug":"markdown-change","link":"#markdown-change","children":[]},{"level":3,"title":"CLI Change","slug":"cli-change","link":"#cli-change","children":[]},{"level":3,"title":"Default Theme Change","slug":"default-theme-change","link":"#default-theme-change","children":[]},{"level":3,"title":"Official Plugins Change","slug":"official-plugins-change","link":"#official-plugins-change","children":[]},{"level":3,"title":"Community Themes and Plugins","slug":"community-themes-and-plugins","link":"#community-themes-and-plugins","children":[]}]},{"level":2,"title":"For Plugin Authors","slug":"for-plugin-authors","link":"#for-plugin-authors","children":[{"level":3,"title":"Plugin API Change","slug":"plugin-api-change","link":"#plugin-api-change","children":[]}]},{"level":2,"title":"For Theme Authors","slug":"for-theme-authors","link":"#for-theme-authors","children":[{"level":3,"title":"Theme API Change","slug":"theme-api-change","link":"#theme-api-change","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"guide/migration.md"}');export{e as data}; diff --git a/assets/migration.html-vHHGQ42_.js b/assets/migration.html-vHHGQ42_.js new file mode 100644 index 000000000..90fc81608 --- /dev/null +++ b/assets/migration.html-vHHGQ42_.js @@ -0,0 +1,97 @@ +import{_ as i,r as t,o as d,c as r,a as n,b as e,d as a,w as l,e as o}from"./app-eU2v8o1B.js";const c={},p=o(`"main": "layouts/Layout.vue"
作为主题入口。# Migrating from v1
WARNING
Plugins and themes of VuePress v1 are not compatible with VuePress v2. You need to update them to corresponding v2 version.
Some major changes and enhancements of VuePress v2:
- VuePress v2 is now using Vue 3, so make sure your components and other client files are compatible with Vue 3.
- VuePress v2 is developed with TypeScript, so it provides better TS support now. It's highly recommended to use TypeScript to develop plugins and themes. VuePress config file also supports TypeScript, and you can use
.vuepress/config.ts
directly.- VuePress v2 supports both Webpack and Vite as bundler. Now Vite is the default bundler, while you can still choose to use Webpack. You can even use Vite in dev mode to get better development experience, and use Webpack in build mode to get better browser compatibility.
- VuePress v2 is now released as pure ESM packages, and CommonJS config files are no longer supported.
Core ideas and processes of VuePress v2 are the same with v1, while v2 API has been re-designed and becomes more normalized. So you might encounter breaking changes when migrating an existing v1 project to v2. This guide is here to help you migrating v1 sites / plugins / themes to v2.
- If you are a common user, you need to read the guide for users.
- If you are a plugin author, you need to read the guide for plugin authors.
- If you are a theme author, you need to read the guide for theme authors.
# For Users
# User Config Change
Config file should be in ESM format, and CommonJS format config file is no longer supported.
// .vuepress/config.js + +- module.exports = { +- // user config +- } + ++ export default { ++ // user config ++ } +
# theme
Using a theme via string is not supported. Import the theme directly.
- module.exports = { +- theme: '@vuepress/theme-default', +- themeConfig: { +- // default theme config +- }, +- } + ++ import { defaultTheme } from 'vuepress' ++ export default { ++ theme: defaultTheme({ ++ // default theme config ++ }) ++ } +
# themeConfig
Removed. Set config to the theme directly.
# plugins
Using a plugin via string is not supported. Import the plugin directly.
- module.exports = { +- plugins: [ +- [ +- '@vuepress/plugin-google-analytics', +- { +- id: 'G-XXXXXXXXXX', +- }, +- ], +- ], +- } + ++ import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics' ++ export default { ++ plugins: [ ++ googleAnalyticsPlugin({ ++ id: 'G-XXXXXXXXXX', ++ }), ++ ], ++ } +
# shouldPrefetch
Default value is changed from
() => true
totrue
.# extraWatchFiles
Removed.
`,22),u=n("h4",{id:"patterns",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#patterns","aria-hidden":"true"},"#"),e(" patterns")],-1),h=n("p",null,[e("Renamed to "),n("code",null,"pagePatterns")],-1),m=n("h4",{id:"markdown-linenumbers",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-linenumbers","aria-hidden":"true"},"#"),e(" markdown.lineNumbers")],-1),v=n("p",null,[e("Default value is changed from "),n("code",null,"false"),e(" to "),n("code",null,"true"),e(".")],-1),f=n("h4",{id:"markdown-pagesuffix",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-pagesuffix","aria-hidden":"true"},"#"),e(" markdown.pageSuffix")],-1),g=n("p",null,"Removed.",-1),y=n("h4",{id:"markdown-externallinks",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-externallinks","aria-hidden":"true"},"#"),e(" markdown.externalLinks")],-1),b=n("h4",{id:"markdown-toc",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-toc","aria-hidden":"true"},"#"),e(" markdown.toc")],-1),_=n("p",null,"Changed.",-1),C=n("h4",{id:"markdown-plugins",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-plugins","aria-hidden":"true"},"#"),e(" markdown.plugins")],-1),k=n("p",null,"Removed.",-1),D=n("h4",{id:"markdown-extendmarkdown",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-extendmarkdown","aria-hidden":"true"},"#"),e(" markdown.extendMarkdown")],-1),x=n("p",null,"Removed.",-1),w=n("h4",{id:"markdown-extractheaders",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#markdown-extractheaders","aria-hidden":"true"},"#"),e(" markdown.extractHeaders")],-1),E=o(`# Webpack Related Configs
All webpack related configs are moved to options of
@vuepress/bundler-webpack
, including:
postcss
stylus
scss
sass
less
chainWebpack
configureWebpack
evergreen
: default value is changed fromfalse
totrue
`,4),A=n("h3",{id:"frontmatter-change",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#frontmatter-change","aria-hidden":"true"},"#"),e(" Frontmatter Change")],-1),B=n("h4",{id:"meta",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#meta","aria-hidden":"true"},"#"),e(" meta")],-1),S=n("p",null,"Removed.",-1),P=o(`- module.exports = { +- sass: { /* ... */ }, +- } + ++ import { webpackBundler } from '@vuepress/bundler-webpack' ++ export default { ++ bundler: webpackBundler({ ++ sass: { /* ... */ }, ++ }), ++ } +
head: + - - meta + - name: foo + content: bar + - - link + - rel: canonical + href: foobar + - - script + - {} + - console.log('hello from frontmatter'); +
Has the same structure with:
// .vuepress/config.ts +export default { + // ... + head: [ + ['meta', { name: 'foo', content: 'bar' }], + ['link', { rel: 'canonical', href: 'foobar' }], + ['script', {}, \`console.log('hello from frontmatter');\`], + ], + // ... +} +
# Permalink Patterns Change
`,5),T=n("h3",{id:"palette-system-change",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#palette-system-change","aria-hidden":"true"},"#"),e(" Palette System Change")],-1),F=n("p",null,[e("The stylus palette system of VuePress v1 (i.e. "),n("code",null,"styles/palette.styl"),e(" and "),n("code",null,"styles/index.styl"),e(") is no longer provided by VuePress Core.")],-1),V=n("p",null,"Theme authors can use their own way to allow users to customize styles, and not be limited with stylus.",-1),I=n("h3",{id:"conventional-files-change",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#conventional-files-change","aria-hidden":"true"},"#"),e(" Conventional Files Change")],-1),M=n("h4",{id:"vuepress-enhanceapp-js",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#vuepress-enhanceapp-js","aria-hidden":"true"},"#"),e(" .vuepress/enhanceApp.js")],-1),X=n("p",null,[e("Renamed to "),n("code",null,".vuepress/client.{js,ts}"),e(", and the usage has been changed, too.")],-1),j=n("h4",{id:"vuepress-components",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#vuepress-components","aria-hidden":"true"},"#"),e(" .vuepress/components/")],-1),R=n("p",null,"Files in this directory will not be registered as Vue components automatically.",-1),W=n("code",null,".vuepress/client.{js,ts}",-1),Y=n("h4",{id:"vuepress-theme",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#vuepress-theme","aria-hidden":"true"},"#"),e(" .vuepress/theme/")],-1),N=n("p",null,"This directory will not be used as local theme implicitly if it is existed.",-1),q=o(`
:i_month
: removed:i_day
: removed:minutes
: removed (undocumented in v1):seconds
: removed (undocumented in v1):regular
: renamed to:raw
# Markdown Change
- Markdown slot is no longer supported.
- Markdown image syntax does not support webpack aliases anymore. Links without
./
prefix are also treated as relative links, which is aligned with the behavior of the native markdown image syntax. If you want to use aliases in image paths, or use images from external packages, you should use<img>
tag instead.- ![](@alias/foo.png) +- ![](package-name/bar.png) + ++ <img src="@alias/foo.png"> ++ <img src="package-name/bar.png"> +
# CLI Change
# eject command
Removed.
# cache options
-c, --cache [cache]
: changed to--cache <cache>
, which means that the shorthand-c
is not forcache
option, and the value ofcache
option is not optional.--no-cache
: renamed to--clean-cache
.# Default Theme Change
# Built-in Components
<CodeGroup />
and<CodeBlock />
renamed to<CodeGroup />
and<CodeGroupItem />
<Badge />
$badgeErrorColor
palette variable renamed to$badgeDangerColor
type
prop only acceptstip
,warning
anddanger
now# Palette System
The palette system of default theme has migrated to SASS and CSS variables.
`,13),U=n("h4",{id:"theme-config",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#theme-config","aria-hidden":"true"},"#"),e(" Theme Config")],-1),G=n("p",null,"Default theme config has been changed a lot. You'd better check the config reference of v2 default theme to migrate it properly.",-1),z=o(`Here we list some notable changes:
# Sidebar Config
- sidebar: { +- title: 'Foo Bar', +- path: '/foo/bar.html', +- collapsable: true, +- children: [ +- ['/baz', 'Baz'], +- ], +- } + ++ sidebar: { ++ text: 'Foo Bar', ++ link: '/foo/bar.html', ++ collapsible: true, ++ children: [ ++ { ++ text: 'Baz', ++ link: '/baz', ++ } ++ ], ++ } +
# Official Plugins Change
Check the v2 docs of official plugins.
# Community Themes and Plugins
Themes and plugins of v1 are not compatible with v2.
Please make sure that those themes and plugins you are using have supported v2, and refer to their own documentation for migration guide.
# For Plugin Authors
Some major breaking changes:
`,10),L=n("li",null,"You cannot use other plugins in your plugin anymore, which avoids lots of potential issues caused by plugin nesting. If your plugin depends on other plugins, you could list them in the docs to ask users import them manually. Alternatively, you can provide users with an array of plugins for convenience.",-1),$=n("li",null,[e("Most of the v1 hooks have equivalents in v2. The only exception is "),n("code",null,"extendsCli"),e(", which has been removed.")],-1),H=o('# Plugin API Change
',2),J=n("h2",{id:"for-theme-authors",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#for-theme-authors","aria-hidden":"true"},"#"),e(" For Theme Authors")],-1),O=n("p",null,"Although we do not allow using other plugins in a plugin anymore, you can still use plugins in your theme.",-1),K=n("p",null,"Some major breaking changes:",-1),Q=n("strong",null,"conventional theme directory structure",-1),Z=n("li",null,[e("The file "),n("code",null,"theme/enhanceApp.js"),e(" will not be used as client app enhance file implicitly. You need to specify it explicitly in "),n("code",null,"clientConfigFile"),e(" hook.")],-1),ee=n("code",null,"theme/global-components/",-1),ne=n("code",null,"clientConfigFile",-1),se=o("
plugins
: removedready
: renamed toonPrepared
updated
: renamed toonWatched
generated
: renamed toonGenerated
additionalPages
: removed, useapp.pages.push(createPage())
inonInitialized
hookclientDynamicModules
: removed, useapp.writeTemp()
inonPrepared
hookenhanceAppFiles
: removed, useclientConfigFile
hookglobalUIComponents
: removed, useclientConfigFile
hookclientRootMixin
: removed, useclientConfigFile
hookextendMarkdown
: renamed toextendsMarkdown
chainMarkdown
: removedextendPageData
: renamed toextendsPage
extendsCli
: removedconfigureWebpack
: removedchainWebpack
: removedbeforeDevServer
: removedafterDevServer
: removedFiles in theme/layouts/
directory will not be registered as layout components automatically. You need to specify it explicitly inlayouts
option inclientConfigFile
.Files in theme/templates/
directory will not be used as dev / ssr template automatically. You need to specify theme explicitly intemplateBuild
andtemplateDev
option.Always provide a valid js entry file, and do not use ",3),ae=n("code",null,"themeConfig",-1),le=n("code",null,"themeConfig",-1),oe=n("code",null,"this.$site.themeConfig",-1),ie=n("code",null,"useThemeData",-1),te=n("li",null,[e("For scalability concerns, "),n("code",null,"this.$site.pages"),e(" is not available any more.")],-1),de=n("h3",{id:"theme-api-change",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#theme-api-change","aria-hidden":"true"},"#"),e(" Theme API Change")],-1),re=n("h4",{id:"layouts",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#layouts","aria-hidden":"true"},"#"),e(" layouts")],-1),ce=n("p",null,"Removed.",-1),pe=n("p",null,"Now you need to specify layout component in the client config file of your theme.",-1),ue=n("h4",{id:"extend",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#extend","aria-hidden":"true"},"#"),e(" extend")],-1),he=n("p",null,[e("Renamed to "),n("code",null,"extends"),e(".")],-1),me=n("p",null,[e("You can still inherit a parent theme with "),n("code",null,"extends: parentTheme()"),e(", which will extends the plugins, layouts, etc.")],-1),ve=n("code",null,"@theme",-1),fe=n("code",null,"@parent-theme",-1);function ge(ye,be){const s=t("RouterLink");return d(),r("div",null,[p,n("p",null,[e("You can watch files manually in "),a(s,{to:"/reference/plugin-api.html#onwatched"},{default:l(()=>[e("onWatched")]),_:1}),e(" hook.")]),u,h,m,n("p",null,[e("Moved to "),a(s,{to:"/reference/config.html#markdown-code-linenumbers"},{default:l(()=>[e("markdown.code.lineNumbers")]),_:1}),e(".")]),v,f,g,y,n("p",null,[e("Moved to "),a(s,{to:"/reference/config.html#markdown-links"},{default:l(()=>[e("markdown.links.externalAttrs")]),_:1}),e(".")]),b,_,n("p",null,[e("See "),a(s,{to:"/reference/config.html#markdown-toc"},{default:l(()=>[e("Config > markdown.toc")]),_:1})]),C,k,n("p",null,[e("Use markdown-it plugins in "),a(s,{to:"/reference/plugin-api.html#extendsmarkdown"},{default:l(()=>[e("extendsMarkdown")]),_:1}),e(" hook.")]),D,x,n("p",null,[e("Use "),a(s,{to:"/reference/plugin-api.html#extendsmarkdown"},{default:l(()=>[e("extendsMarkdown")]),_:1}),e(" hook.")]),w,n("p",null,[e("Moved to "),a(s,{to:"/reference/config.html#markdown-headers"},{default:l(()=>[e("markdown.headers")]),_:1}),e(".")]),E,n("p",null,[e("Please refer to "),a(s,{to:"/guide/bundler.html"},{default:l(()=>[e("Guide > Bundler")]),_:1}),e(".")]),A,B,S,n("p",null,[e("Use "),a(s,{to:"/reference/frontmatter.html#head"},{default:l(()=>[e("head")]),_:1}),e(" instead. For example:")]),P,n("p",null,[e("See "),a(s,{to:"/reference/frontmatter.html#permalinkpattern"},{default:l(()=>[e("Frontmatter > permalinkPattern")]),_:1}),e(".")]),T,F,n("p",null,[e("The palette system is extracted to "),a(s,{to:"/reference/plugin/palette.html"},{default:l(()=>[e("@vuepress/plugin-palette")]),_:1}),e(".")]),V,n("p",null,[e("If you are using default theme, the palette system is still available but migrated to SASS, while most variables have been migrated to CSS variables. See "),a(s,{to:"/reference/default-theme/styles.html"},{default:l(()=>[e("Default Theme > Styles")]),_:1}),e(".")]),I,M,X,n("p",null,[e("See "),a(s,{to:"/advanced/cookbook/usage-of-client-config.html"},{default:l(()=>[e("Advanced > Cookbook > Usage of Client Config")]),_:1}),e(".")]),j,R,n("p",null,[e("You need to use "),a(s,{to:"/reference/plugin/register-components.html"},{default:l(()=>[e("@vuepress/plugin-register-components")]),_:1}),e(", or register your components manually in "),W,e(".")]),Y,N,n("p",null,[e("You need to import and set your local theme via "),a(s,{to:"/reference/config.html#theme"},{default:l(()=>[e("theme")]),_:1}),e(" option.")]),q,n("p",null,[e("See "),a(s,{to:"/reference/default-theme/styles.html"},{default:l(()=>[e("Default Theme > Styles")]),_:1}),e(".")]),U,G,n("p",null,[e("See "),a(s,{to:"/reference/default-theme/config.html"},{default:l(()=>[e("Default Theme > Config")]),_:1}),e(".")]),z,n("ul",null,[L,$,n("li",null,[e("Webpack related hooks are removed, because VuePress Core has decoupled with webpack. You can try to use "),a(s,{to:"/reference/plugin-api.html#extendsbundleroptions"},{default:l(()=>[e("extendsBundlerOptions")]),_:1}),e(" hook for similar purpose, and make sure to work with all bundlers.")])]),n("p",null,[e("For more detailed guide about how to write a plugin in v2, see "),a(s,{to:"/advanced/plugin.html"},{default:l(()=>[e("Advanced > Writing a Plugin")]),_:1}),e(".")]),H,n("p",null,[e("See "),a(s,{to:"/reference/plugin-api.html"},{default:l(()=>[e("Plugin API")]),_:1}),e(".")]),J,O,K,n("ul",null,[n("li",null,[e("There is no "),Q,e(" anymore. "),n("ul",null,[Z,n("li",null,[e("Files in "),ee,e(" directory will not be registered as Vue components automatically. You need to use "),a(s,{to:"/reference/plugin/register-components.html"},{default:l(()=>[e("@vuepress/plugin-register-components")]),_:1}),e(", or register components manually in "),ne,e(".")]),se])]),n("li",null,[ae,e(" is removed from user config and site data. To access the "),le,e(" as you would via "),oe,e(" in v1, we now recommend using the "),a(s,{to:"/reference/plugin/theme-data.html"},{default:l(()=>[e("@vuepress/plugin-theme-data")]),_:1}),e(" plugin and its "),ie,e(" composition API.")]),n("li",null,[e("Stylus is no longer the default CSS pre-processor, and the stylus palette system is not embedded. If you still want to use similar palette system as v1, "),a(s,{to:"/reference/plugin/palette.html"},{default:l(()=>[e("@vuepress/plugin-palette")]),_:1}),e(" may help.")]),n("li",null,[e("Markdown code blocks syntax highlighting by Prism.js is not embedded by default. You can use either "),a(s,{to:"/reference/plugin/prismjs.html"},{default:l(()=>[e("@vuepress/plugin-prismjs")]),_:1}),e(" or "),a(s,{to:"/reference/plugin/shiki.html"},{default:l(()=>[e("@vuepress/plugin-shiki")]),_:1}),e(", or implement syntax highlighting in your own way.")]),te]),n("p",null,[e("For more detailed guide about how to write a theme in v2, see "),a(s,{to:"/advanced/theme.html"},{default:l(()=>[e("Advanced > Writing a Theme")]),_:1}),e(".")]),de,re,ce,pe,n("p",null,[e("See "),a(s,{to:"/advanced/theme.html"},{default:l(()=>[e("Advanced > Writing a theme")]),_:1}),e(".")]),ue,he,me,n("p",null,[e("You can refer to "),a(s,{to:"/reference/default-theme/extending.html"},{default:l(()=>[e("Default Theme > Extending")]),_:1}),e(" for how to extend default theme.")]),n("p",null,[e("The "),ve,e(" and "),fe,e(" aliases are removed by default, but you can still make a extendable theme with similar approach, see "),a(s,{to:"/advanced/cookbook/making-a-theme-extendable.html"},{default:l(()=>[e("Advanced > Cookbook > Making a Theme Extendable")]),_:1}),e(".")])])}const Ce=i(c,[["render",ge],["__file","migration.html.vue"]]);export{Ce as default}; diff --git a/assets/migration.html-yL51i5Wa.js b/assets/migration.html-yL51i5Wa.js new file mode 100644 index 000000000..333da8146 --- /dev/null +++ b/assets/migration.html-yL51i5Wa.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-81b14334","path":"/zh/guide/migration.html","title":"从 v1 迁移","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"给用户","slug":"给用户","link":"#给用户","children":[{"level":3,"title":"用户配置变更","slug":"用户配置变更","link":"#用户配置变更","children":[]},{"level":3,"title":"Frontmatter 变更","slug":"frontmatter-变更","link":"#frontmatter-变更","children":[]},{"level":3,"title":"永久链接 Patterns 变更","slug":"永久链接-patterns-变更","link":"#永久链接-patterns-变更","children":[]},{"level":3,"title":"调色板系统变更","slug":"调色板系统变更","link":"#调色板系统变更","children":[]},{"level":3,"title":"约定文件变更","slug":"约定文件变更","link":"#约定文件变更","children":[]},{"level":3,"title":"Markdown 变更","slug":"markdown-变更","link":"#markdown-变更","children":[]},{"level":3,"title":"CLI 变更","slug":"cli-变更","link":"#cli-变更","children":[]},{"level":3,"title":"默认主题变更","slug":"默认主题变更","link":"#默认主题变更","children":[]},{"level":3,"title":"官方插件变更","slug":"官方插件变更","link":"#官方插件变更","children":[]},{"level":3,"title":"社区主题和插件","slug":"社区主题和插件","link":"#社区主题和插件","children":[]}]},{"level":2,"title":"给插件作者","slug":"给插件作者","link":"#给插件作者","children":[{"level":3,"title":"插件 API 变更","slug":"插件-api-变更","link":"#插件-api-变更","children":[]}]},{"level":2,"title":"给主题作者","slug":"给主题作者","link":"#给主题作者","children":[{"level":3,"title":"主题 API 变更","slug":"主题-api-变更","link":"#主题-api-变更","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/guide/migration.md"}');export{l as data}; diff --git a/assets/node-api.html-RzTrTTfo.js b/assets/node-api.html-RzTrTTfo.js new file mode 100644 index 000000000..aa20b39d0 --- /dev/null +++ b/assets/node-api.html-RzTrTTfo.js @@ -0,0 +1,104 @@ +import{_ as r,r as t,o as c,c as d,d as n,a as s,b as l,w as e,e as p}from"./app-eU2v8o1B.js";const D={},u=s("h1",{id:"node-api",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#node-api","aria-hidden":"true"},"#"),l(" Node API")],-1),h={href:"https://www.npmjs.com/package/@vuepress/core",target:"_blank",rel:"noopener noreferrer"},y={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},v=p(`"main": "layouts/Layout.vue"
as the theme entry anymore.npm i -D @vuepress/core@next +
# App
`,2),C=p(`
BuildApp
和DevApp
除了 build 和 dev 方法外,拥有一样的属性和方法。# createBuildApp
- 函数签名:
const createBuildApp: (config: AppConfig) => BuildApp +
- 参数:
参数 类型 描述 config AppConfig
创建 VuePress App 的选项。
详情:
创建一个 Build 模式的 App 实例,用于构建静态文件。
示例:
const build = async () => { + const app = createBuildApp({ + // ...配置项 + }) + + // 初始化和准备 + await app.init() + await app.prepare() + + // 构建 + await app.build() + + // 处理 onGenerated hook + await app.pluginApi.hooks.onGenerated.process(app) +} +
# createDevApp
- 函数签名:
const createDevApp: (config: AppConfig) => DevApp +
- 参数:
参数 类型 描述 config AppConfig
创建 VuePress App 的选项。
详情:
创建一个 Dev 模式的 App 实例,用于启动开发服务器。
示例:
const dev = async () => { + const app = createDevApp({ + // ...配置项 + }) + + // 初始化和准备 + await app.init() + await app.prepare() + + // 启动开发服务器 + const closeDevServer = await app.dev() + + // 准备文件监听器 + const watchers = [] + + // 重启开发服务器 + const restart = async () => { + await Promise.all([ + // 关闭所有监听器 + ...watchers.map((item) => item.close()), + // 关闭当前的开发服务器 + closeDevServer(), + ]) + await dev() + } + + // 处理 onWatched hook + await app.pluginApi.hooks.onWatched.process(app, watchers, restart) +} +
# App 属性
# options
类型:
AppOptions
详情:
VuePress App 的配置项。
这些配置项来自于 createBuildApp / createDevApp 的
config
参数,但所有可选的字段都填充上了默认值。# siteData
`,21),m=s("li",null,[s("p",null,[l("类型: "),s("code",null,"SiteData")])],-1),b=s("p",null,"详情:",-1),g=p('# version
类型:
string
详情:
VuePress App 的版本,即
@vuepress/core
包的版本。# env.isBuild
类型:
boolean
详情:
用于判断 App 是否运行在 Build 模式的环境标记,即当前 App 是否是 BuildApp 实例。
# env.isDev
类型:
boolean
详情:
用于判断 App 是否运行在 Dev 模式的环境标记,即当前 App 是否是 DevApp 实例。
# env.isDebug
类型:
boolean
详情:
用于判断 App 是否开启 Debug 模式的环境标记。
# markdown
',9),_=s("li",null,[s("p",null,[l("类型: "),s("code",null,"MarkdownIt")])],-1),E=s("p",null,"详情:",-1),f={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},A=s("h3",{id:"pages",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#pages","aria-hidden":"true"},"#"),l(" pages")],-1),k=s("li",null,[s("p",null,[l("类型: "),s("code",null,"Page[]")])],-1),x=s("p",null,"详情:",-1),F=s("p",null,[s("a",{href:"#page"},"Page"),l(" 对象数组。")],-1),P=p(`# App 方法
# dir
工具函数:
dir.cache()
: 解析至缓存目录dir.temp()
: 解析至临时文件目录dir.source()
: 解析至源文件目录dir.dest()
: 解析至输出目录dir.client()
: 解析至@vuepress/client
目录dir.public()
: 解析至 Public 文件目录函数签名:
type AppDirFunction = (...args: string[]) => string +
详情:
用于解析对应目录下的文件绝对路径的一些工具函数。
如果你不传入任何参数,就会返回对应目录的绝对路径。
示例:
// 解析 \`\${sourceDir}/README.md\` 文件的绝对路径 +const homeSourceFile = app.dir.source('README.md') +
# writeTemp
- 函数签名:
writeTemp(file: string, content: string): Promise<string> +
- 参数:
参数 类型 描述 file string
要写入的临时文件的路径,相对于临时文件目录。 content string
要写入的临时文件路径的内容。
详情:
用于写入临时文件的方法。
写入的文件可以在客户端文件中通过
@temp
别名来引入。示例:
export default { + // 在 onPrepared hook 中写入临时文件 + async onPrepared() { + await app.writeTemp('foo.js', "export const foo = 'bar'") + }, +} +
// 在客户端文件中引入临时文件 +import { foo } from '@temp/foo' +
# init
- 函数签名:
`,17),B=s("li",null,[s("p",null,"详情:"),s("p",null,"初始化 VuePress App 。")],-1),w=s("p",null,"参考:",-1),z=p(`init(): Promise<void> +
# prepare
- 函数签名:
`,3),M=s("li",null,[s("p",null,"详情:"),s("p",null,"准备客户端临时文件。")],-1),I=s("p",null,"参考:",-1),R=p(`prepare(): Promise<void> +
# build
- 函数签名:
`,3),N=s("li",null,[s("p",null,"详情:"),s("p",null,"生成静态站点文件。"),s("p",null,[l("该方法仅在 "),s("a",{href:"#createbuildapp"},"BuildApp"),l(" 中可用。")])],-1),V=s("p",null,"参考:",-1),H=p(`build(): Promise<void> +
# dev
- 函数签名:
`,3),L=s("li",null,[s("p",null,"详情:"),s("p",null,"启动开发服务器。"),s("p",null,[l("该方法仅在 "),s("a",{href:"#createdevapp"},"DevApp"),l(" 中可用。")])],-1),S=s("p",null,"参考:",-1),j=p(`dev(): Promise<() => Promise<void>> +
# Page
# createPage
- 函数签名:
const createPage: (app: App, options: PageOptions) => Promise<Page> +
- 参数:
参数 类型 描述 app App
VuePress App 实例。 options PageOptions
创建 VuePress Page 的选项。
详情:
创建一个 VuePress Page 对象。
示例:
`,8),T=s("li",null,[s("a",{href:"#pages"},"Node API > App 属性 > pages")],-1),O=s("h2",{id:"page-属性",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#page-属性","aria-hidden":"true"},"#"),l(" Page 属性")],-1),q=s("h3",{id:"key",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#key","aria-hidden":"true"},"#"),l(" key")],-1),G=s("li",null,[s("p",null,[l("类型: "),s("code",null,"string")])],-1),W=s("p",null,"详情:",-1),K=s("p",null,"该 Page 的标识。",-1),U={href:"https://router.vuejs.org/api/#name-2",target:"_blank",rel:"noopener noreferrer"},$=s("p",null,"参考:",-1),J=s("h3",{id:"path",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#path","aria-hidden":"true"},"#"),l(" path")],-1),Q=s("li",null,[s("p",null,[l("类型: "),s("code",null,"string")])],-1),X=s("li",null,[s("p",null,"详情:"),s("p",null,"该 Page 的路由路径。")],-1),Y=s("p",null,"参考:",-1),Z=s("li",null,[s("a",{href:"#pathinferred"},"Node API > Page 属性 > pathInferred")],-1),ss=s("h3",{id:"title",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#title","aria-hidden":"true"},"#"),l(" title")],-1),ls=s("li",null,[s("p",null,[l("类型: "),s("code",null,"string")])],-1),ns=s("li",null,[s("p",null,"详情:"),s("p",null,"该 Page 的标题。")],-1),as=s("p",null,"参考:",-1),es=s("h3",{id:"lang",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#lang","aria-hidden":"true"},"#"),l(" lang")],-1),ps=p("import { createPage } from '@vuepress/core' + +export default { + // 在 onInitialized hook 中创建一个额外页面 + async onInitialized(app) { + app.pages.push( + await createPage(app, { + path: '/foo.html', + frontmatter: { + layout: 'Layout', + }, + content: \`\\ +# 某个 Page + +你好,世界。 +\`, + }), + ) + }, +} +
类型:
string
详情:
该 Page 的语言。
",3),os=s("p",null,"参考:",-1),ts=s("h3",{id:"frontmatter",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),l(" frontmatter")],-1),is=s("li",null,[s("p",null,[l("类型: "),s("code",null,"PageFrontmatter")])],-1),rs=s("li",null,[s("p",null,"详情:"),s("p",null,"该 Page 的 Frontmatter 。")],-1),cs=s("p",null,"参考:",-1),ds=p(` 示例:
'en-US'
'zh-CN'
# headers
- 类型:
PageHeader[]
`,3),Ds=s("li",null,[s("p",null,"详情:"),s("p",null,"该 Page 的小标题。")],-1),us=s("p",null,"参考:",-1),hs=p(`interface PageHeader { + level: number + title: string + slug: string + children: PageHeader[] +} +
# data
- 类型:
PageData
`,3),ys=s("li",null,[s("p",null,"详情:"),s("p",null,"该 Page 的数据。"),s("p",null,"Page 数据可以在客户端代码中使用。")],-1),vs=s("p",null,"参考:",-1),Cs=p('interface PageData { + key: string + path: string + title: string + lang: string + frontmatter: PageFrontmatter + headers: PageHeader[] +} +
# content
类型:
string
详情:
该 Page 的未经渲染的原始内容。
# contentRendered
类型:
string
详情:
该 Page 的渲染后的内容。
# date
',5),ms=p("类型:
string
详情:
该 Page 的日期,遵从 'yyyy-MM-dd' 格式。
",3),bs=s("p",null,"参考:",-1),gs=s("h3",{id:"deps",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#deps","aria-hidden":"true"},"#"),l(" deps")],-1),_s=s("li",null,[s("p",null,[l("类型: "),s("code",null,"string[]")])],-1),Es=s("li",null,[s("p",null,"详情:"),s("p",null,"该 Page 的依赖。"),s("p",null,[l("举例来说,如果在页面中导入了代码片段,那么被导入文件的绝对路径就会被添加到 "),s("code",null,"deps"),l(" 中。")])],-1),fs=s("p",null,"参考:",-1),As=p(` 示例:
'0000-00-00'
'2021-08-16
'# links
- 类型:
MarkdownLink[]
interface MarkdownLink { + raw: string + relative: string + absolute: string +} +
详情:
该 Page 内容中包含的链接。
# markdownEnv
`,5),ks=p("类型:
Record<string, unknown>
",2),xs=s("p",null,"参考:",-1),Fs={href:"https://markdown-it.github.io/markdown-it/#MarkdownIt.parse",target:"_blank",rel:"noopener noreferrer"},Ps=s("h3",{id:"pathinferred",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#pathinferred","aria-hidden":"true"},"#"),l(" pathInferred")],-1),Bs=p(' 详情:
在使用 markdown-it 解析 Markdown 内容时的
env
对象。一些 markdown-it 插件可能会在这个对象中存储一些额外的信息,你可以使用它们来进行高级定制化。
需要注意的是,其他的一些 Page 属性其实也是从
env
对象中获取到的,但是我们已经把这些属性从page.markdownEnv
中移除掉了。类型:
string | null
详情:
该 Page 根据文件路径推断出的路由路径。
默认情况下,路由路径是根据 Markdown 源文件的相对文件路径推断出来的。然而,用户可能会显式指定页面路由,比如通过 permalink 来指定该页面最终使用的路由路径。因此我们在 Page 属性中保留推断出来的路径,以便于你在某些情况下可能会用到它。
如果该 Page 不是来自于 Markdown 源文件,那么该属性会为
null
。',3),ws=s("p",null,"参考:",-1),zs=s("li",null,[s("a",{href:"#path"},"Node API > Page 属性 > path")],-1),Ms=s("h3",{id:"pathlocale",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#pathlocale","aria-hidden":"true"},"#"),l(" pathLocale")],-1),Is=p(" 示例:
'/'
'/foo.html'
类型:
string
详情:
该 Page 路由路径的 Locale 前缀。
它是根据页面的 Markdown 源文件相对路径、以及用户配置的
locales
的键推断得到的。",3),Rs=s("p",null,"参考:",-1),Ns=s("h3",{id:"permalink",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#permalink","aria-hidden":"true"},"#"),l(" permalink")],-1),Vs=s("li",null,[s("p",null,[l("类型: "),s("code",null,"string | null")])],-1),Hs=s("li",null,[s("p",null,"详情:"),s("p",null,"该 Page 的永久链接。")],-1),Ls=s("p",null,"参考:",-1),Ss=s("h3",{id:"routemeta",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#routemeta","aria-hidden":"true"},"#"),l(" routeMeta")],-1),js=s("li",null,[s("p",null,[l("类型: "),s("code",null,"Record 示例:
'/'
'/en/'
'/zh/'
")])],-1),Ts=s("li",null,[s("p",null,"详情:"),s("p",null,"附加到 vue-router 路由记录上的额外数据。")],-1),Os=s("p",null,"参考:",-1),qs={href:"https://router.vuejs.org/zh/api/#meta",target:"_blank",rel:"noopener noreferrer"},Gs=p(' Route Meta 和 Page Data 的区别是什么?
Route Meta 和 Page Data 都可以在客户端代码中使用。然而, Route Meta 是附加在路由记录上的,因此当用户进入你的站点时,所有页面的 Route Meta 都会立即被加载。相比之下, Page Data 是存储在单独的文件中的,只有在用户进入对应页面时才会被加载。
因此,不建议在 Route Meta 中存储大量的信息,否则在站点有很多页面时,将会影响站点的初始加载速度。
# sfcBlocks
',2),Ws=s("li",null,[s("p",null,[l("类型: "),s("code",null,"MarkdownSfcBlocks")])],-1),Ks=s("li",null,[s("p",null,"详情:"),s("p",null,"该 Page 中提取出的 Vue SFC Blocks 。")],-1),Us=s("p",null,"参考:",-1),$s=p('# slug
类型:
string
详情:
该 Page 的 Slug 。
它是根据页面的 Markdown 源文件的文件名推断得到的。
# filePath
类型:
string | null
详情:
该 Page 的 Markdown 源文件的绝对路径。
如果该 Page 不是来自于 Markdown 源文件,那么该属性会为
null
。# filePathRelative
',6);function Js(Qs,Xs){const i=t("NpmBadge"),o=t("ExternalLinkIcon"),a=t("RouterLink");return c(),d("div",null,[u,n(i,{package:"@vuepress/core"}),s("p",null,[l("Node API 是由 "),s("a",h,[l("@vuepress/core"),n(o)]),l(" 包提供的。它是 "),s("a",y,[l("vuepress"),n(o)]),l(" 包的依赖之一,当然你也可以单独安装它:")]),v,s("p",null,[n(a,{to:"/zh/reference/plugin-api.html"},{default:e(()=>[l("插件 API")]),_:1}),l(" 的所有 Hooks 中都可以获取到 App 实例。")]),C,s("ul",null,[m,s("li",null,[b,s("p",null,[l("由用户设置的站点数据,包含所有的 "),n(a,{to:"/zh/reference/config.html#%E7%AB%99%E7%82%B9%E9%85%8D%E7%BD%AE"},{default:e(()=>[l("站点配置")]),_:1}),l(" ,可以在客户端代码中使用。")])])]),g,s("ul",null,[_,s("li",null,[E,s("p",null,[l("用于解析 Markdown 内容的 "),s("a",f,[l("markdown-it"),n(o)]),l(" 实例。")]),s("p",null,[l("它仅在 "),n(a,{to:"/zh/reference/plugin-api.html#oninitialized"},{default:e(()=>[l("onInitialized")]),_:1}),l(" 以及之后的 Hooks 中才可用。")])])]),A,s("ul",null,[k,s("li",null,[x,F,s("p",null,[l("它仅在 "),n(a,{to:"/zh/reference/plugin-api.html#oninitialized"},{default:e(()=>[l("onInitialized")]),_:1}),l(" 以及之后的 Hooks 中才可用。")])])]),P,s("ul",null,[B,s("li",null,[w,s("ul",null,[s("li",null,[n(a,{to:"/zh/advanced/architecture.html#%E6%A0%B8%E5%BF%83%E6%B5%81%E7%A8%8B%E4%B8%8E-hooks"},{default:e(()=>[l("深入 > 架构 > 核心流程与 Hooks")]),_:1})])])])]),z,s("ul",null,[M,s("li",null,[I,s("ul",null,[s("li",null,[n(a,{to:"/zh/advanced/architecture.html#%E6%A0%B8%E5%BF%83%E6%B5%81%E7%A8%8B%E4%B8%8E-hooks"},{default:e(()=>[l("深入 > 架构 > 核心流程与 Hooks")]),_:1})])])])]),R,s("ul",null,[N,s("li",null,[V,s("ul",null,[s("li",null,[n(a,{to:"/zh/advanced/architecture.html#%E6%A0%B8%E5%BF%83%E6%B5%81%E7%A8%8B%E4%B8%8E-hooks"},{default:e(()=>[l("深入 > 架构 > 核心流程与 Hooks")]),_:1})])])])]),H,s("ul",null,[L,s("li",null,[S,s("ul",null,[s("li",null,[n(a,{to:"/zh/advanced/architecture.html#%E6%A0%B8%E5%BF%83%E6%B5%81%E7%A8%8B%E4%B8%8E-hooks"},{default:e(()=>[l("深入 > 架构 > 核心流程与 Hooks")]),_:1})])])])]),j,s("ul",null,[s("li",null,[l("参考: "),s("ul",null,[T,s("li",null,[n(a,{to:"/zh/advanced/cookbook/adding-extra-pages.html"},{default:e(()=>[l("Cookbook > 添加额外页面")]),_:1})])])])]),O,q,s("ul",null,[G,s("li",null,[W,K,s("p",null,[l("Page Key 会被用作页面路由的 "),s("a",U,[l("name"),n(o)]),l("。")])]),s("li",null,[$,s("ul",null,[s("li",null,[n(a,{to:"/zh/reference/components.html#content"},{default:e(()=>[l("Built-in Components > Content")]),_:1})])])])]),J,s("ul",null,[Q,X,s("li",null,[Y,s("ul",null,[s("li",null,[n(a,{to:"/zh/guide/page.html#%E8%B7%AF%E7%94%B1"},{default:e(()=>[l("指南 > 页面 > 路由")]),_:1})]),Z])])]),ss,s("ul",null,[ls,ns,s("li",null,[as,s("ul",null,[s("li",null,[n(a,{to:"/zh/reference/frontmatter.html#title"},{default:e(()=>[l("Frontmatter > title")]),_:1})])])])]),es,s("ul",null,[ps,s("li",null,[os,s("ul",null,[s("li",null,[n(a,{to:"/zh/reference/frontmatter.html#title"},{default:e(()=>[l("Frontmatter > lang")]),_:1})])])])]),ts,s("ul",null,[is,rs,s("li",null,[cs,s("ul",null,[s("li",null,[n(a,{to:"/zh/reference/frontmatter.html"},{default:e(()=>[l("Frontmatter")]),_:1})])])])]),ds,s("ul",null,[Ds,s("li",null,[us,s("ul",null,[s("li",null,[n(a,{to:"/zh/reference/config.html#markdown-headers"},{default:e(()=>[l("配置 > markdown.headers")]),_:1})])])])]),hs,s("ul",null,[ys,s("li",null,[vs,s("ul",null,[s("li",null,[n(a,{to:"/zh/reference/client-api.html#usepagedata"},{default:e(()=>[l("客户端 API > usePageData")]),_:1})]),s("li",null,[n(a,{to:"/zh/reference/plugin-api.html#extendspage"},{default:e(()=>[l("插件 API > extendsPage")]),_:1})])])])]),Cs,s("ul",null,[ms,s("li",null,[bs,s("ul",null,[s("li",null,[n(a,{to:"/zh/reference/frontmatter.html#date"},{default:e(()=>[l("Frontmatter > date")]),_:1})])])])]),gs,s("ul",null,[_s,Es,s("li",null,[fs,s("ul",null,[s("li",null,[n(a,{to:"/zh/reference/config.html#markdown-importcode"},{default:e(()=>[l("配置 > markdown.importCode")]),_:1})])])])]),As,s("ul",null,[ks,s("li",null,[xs,s("ul",null,[s("li",null,[s("a",Fs,[l("markdown-it > API Documentation > MarkdownIt > parse"),n(o)])])])])]),Ps,s("ul",null,[Bs,s("li",null,[ws,s("ul",null,[s("li",null,[n(a,{to:"/zh/guide/page.html#%E8%B7%AF%E7%94%B1"},{default:e(()=>[l("指南 > 页面 > 路由")]),_:1})]),zs])])]),Ms,s("ul",null,[Is,s("li",null,[Rs,s("ul",null,[s("li",null,[n(a,{to:"/zh/reference/config.html#locales"},{default:e(()=>[l("配置 > locales")]),_:1})])])])]),Ns,s("ul",null,[Vs,Hs,s("li",null,[Ls,s("ul",null,[s("li",null,[n(a,{to:"/zh/reference/frontmatter.html#permalink"},{default:e(()=>[l("Frontmatter > permalink")]),_:1})]),s("li",null,[n(a,{to:"/zh/reference/frontmatter.html#permalinkpattern"},{default:e(()=>[l("Frontmatter > permalinkPattern")]),_:1})])])])]),Ss,s("ul",null,[js,Ts,s("li",null,[Os,s("ul",null,[s("li",null,[n(a,{to:"/zh/reference/frontmatter.html#routemeta"},{default:e(()=>[l("Frontmatter > routeMeta")]),_:1})]),s("li",null,[s("a",qs,[l("vue-router > API 参考 > RouteRecordRaw > meta"),n(o)])])])])]),Gs,s("ul",null,[Ws,Ks,s("li",null,[Us,s("ul",null,[s("li",null,[n(a,{to:"/zh/reference/config.html#markdown-sfc"},{default:e(()=>[l("配置 > markdown.sfc")]),_:1})])])])]),$s])}const Zs=r(D,[["render",Js],["__file","node-api.html.vue"]]);export{Zs as default}; diff --git a/assets/node-api.html-ZpV2lRra.js b/assets/node-api.html-ZpV2lRra.js new file mode 100644 index 000000000..fedebda4d --- /dev/null +++ b/assets/node-api.html-ZpV2lRra.js @@ -0,0 +1,104 @@ +import{_ as r,r as t,o as c,c as d,d as l,a as s,b as e,w as n,e as o}from"./app-eU2v8o1B.js";const D={},u=s("h1",{id:"node-api",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#node-api","aria-hidden":"true"},"#"),e(" Node API")],-1),h={href:"https://www.npmjs.com/package/@vuepress/core",target:"_blank",rel:"noopener noreferrer"},y={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},v=o(`
类型:
string | null
详情:
该 Page 的 Markdown 源文件的相对路径。
如果该 Page 不是来自于 Markdown 源文件,那么该属性会为
null
。npm i -D @vuepress/core@next +
# App
`,2),m=o(`The
BuildApp
andDevApp
share almost the same properties and methods, except build and dev method.# createBuildApp
- Signature:
const createBuildApp: (config: AppConfig) => BuildApp +
- Parameters:
Parameter Type Description config AppConfig
Config to create a VuePress app.
Details:
Create a build mode app instance, which is used for building static files.
Example:
const build = async () => { + const app = createBuildApp({ + // ...options + }) + + // initialize and prepare + await app.init() + await app.prepare() + + // build + await app.build() + + // process onGenerated hook + await app.pluginApi.hooks.onGenerated.process(app) +} +
- Also see:
# createDevApp
- Signature:
const createDevApp: (config: AppConfig) => DevApp +
- Parameters:
Parameter Type Description config AppConfig
Config to create a VuePress app.
Details:
Create a dev mode app instance, which is used for starting a dev server.
Example:
const dev = async () => { + const app = createDevApp({ + // ...options + }) + + // initialize and prepare + await app.init() + await app.prepare() + + // start dev server + const closeDevServer = await app.dev() + + // set up file watchers + const watchers = [] + + // restart dev server + const restart = async () => { + await Promise.all([ + // close all watchers + ...watchers.map((item) => item.close()), + // close current dev server + closeDevServer(), + ]) + await dev() + } + + // process onWatched hook + await app.pluginApi.hooks.onWatched.process(app, watchers, restart) +} +
- Also see:
# App Properties
# options
Type:
AppOptions
Details:
Options of VuePress app.
The options come from the
config
argument in createBuildApp / createDevApp, while all optional fields will be filled with a default value.# siteData
`,21),C=s("li",null,[s("p",null,[e("Type: "),s("code",null,"SiteData")])],-1),b=s("p",null,"Details:",-1),f=o('# version
Type:
string
Details:
Version of VuePress app, i.e. version of
@vuepress/core
package.# env.isBuild
Type:
boolean
Details:
Environment flag used to identify whether the app is running in build mode, i.e. whether a BuildApp instance.
# env.isDev
Type:
boolean
Details:
Environment flag used to identify whether the app is running in dev mode, i.e. whether a DevApp instance.
# env.isDebug
Type:
boolean
Details:
Environment flag used to identify whether the debug mode is enabled.
# markdown
',9),g=s("li",null,[s("p",null,[e("Type: "),s("code",null,"MarkdownIt")])],-1),_=s("p",null,"Details:",-1),E={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},A=s("h3",{id:"pages",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#pages","aria-hidden":"true"},"#"),e(" pages")],-1),k=s("li",null,[s("p",null,[e("Type: "),s("code",null,"Page[]")])],-1),x=s("p",null,"Details:",-1),w=s("p",null,[e("The "),s("a",{href:"#page"},"Page"),e(" object array.")],-1),F=o(`# App Methods
# dir
Utils:
dir.cache()
: resolve to cache directorydir.temp()
: resolve to temp directorydir.source()
: resolve to source directorydir.dest()
: resolve to dest directorydir.client()
: resolve to@vuepress/client
directorydir.public()
: resolve to public directorySignature:
type AppDirFunction = (...args: string[]) => string +
Details:
Utils to resolve the absolute file path in corresponding directory.
If you don't provide any arguments, it will return the absolute path of the directory.
Example:
// resolve the absolute file path of the \`\${sourceDir}/README.md\` +const homeSourceFile = app.dir.source('README.md') +
# writeTemp
- Signature:
writeTemp(file: string, content: string): Promise<string> +
- Parameters:
Parameter Type Description file string
Filepath of the temp file that going to be written. Relative to temp directory. content string
Content of the temp file that going to be written.
Details:
A method to write temp file.
The written file could be imported via
@temp
alias in client files.Example:
export default { + // write temp file in onPrepared hook + async onPrepared() { + await app.writeTemp('foo.js', "export const foo = 'bar'") + }, +} +
// import temp file in client code +import { foo } from '@temp/foo' +
# init
- Signature:
`,17),P=s("li",null,[s("p",null,"Details:"),s("p",null,"Initialize VuePress app.")],-1),B=s("p",null,"Also see:",-1),T=o(`init(): Promise<void> +
# prepare
- Signature:
`,3),I=s("li",null,[s("p",null,"Details:"),s("p",null,"Prepare client temp files.")],-1),M=s("p",null,"Also see:",-1),S=o(`prepare(): Promise<void> +
# build
- Signature:
`,3),R=s("li",null,[s("p",null,"Details:"),s("p",null,"Generate static site files."),s("p",null,[e("This method is only available in "),s("code",null,"BuildApp"),e(".")])],-1),N=s("p",null,"Also see:",-1),V=s("li",null,[s("a",{href:"#createbuildapp"},"Node API > App > createBuildApp")],-1),z=o(`build(): Promise<void> +
# dev
- Signature:
`,3),H=s("li",null,[s("p",null,"Details:"),s("p",null,"Start dev server."),s("p",null,[e("This method is only available in "),s("code",null,"DevApp"),e(".")])],-1),L=s("p",null,"Also see:",-1),j=s("li",null,[s("a",{href:"#createdevapp"},"Node API > App > createDevApp")],-1),G=o(`dev(): Promise<() => Promise<void>> +
# Page
# createPage
- Signature:
const createPage: (app: App, options: PageOptions) => Promise<Page> +
- Parameters:
Parameter Type Description app App
The VuePress app instance. options PageOptions
Options to create VuePress page.
Details:
Create a VuePress page object.
Example:
`,8),O=s("li",null,[s("a",{href:"#pages"},"Node API > App Properties > pages")],-1),U=s("h2",{id:"page-properties",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#page-properties","aria-hidden":"true"},"#"),e(" Page Properties")],-1),W=s("h3",{id:"key",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#key","aria-hidden":"true"},"#"),e(" key")],-1),q=s("li",null,[s("p",null,[e("Type: "),s("code",null,"string")])],-1),$=s("p",null,"Details:",-1),J=s("p",null,"Identifier of the page.",-1),K={href:"https://router.vuejs.org/api/#name-2",target:"_blank",rel:"noopener noreferrer"},Q=s("p",null,"Also see:",-1),X=s("h3",{id:"path",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#path","aria-hidden":"true"},"#"),e(" path")],-1),Y=s("li",null,[s("p",null,[e("Type: "),s("code",null,"string")])],-1),Z=s("li",null,[s("p",null,"Details:"),s("p",null,"Route path of the page.")],-1),ss=s("p",null,"Also see:",-1),es=s("li",null,[s("a",{href:"#pathinferred"},"Node API > Page Properties > pathInferred")],-1),ls=s("h3",{id:"title",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#title","aria-hidden":"true"},"#"),e(" title")],-1),as=s("li",null,[s("p",null,[e("Type: "),s("code",null,"string")])],-1),ns=s("li",null,[s("p",null,"Details:"),s("p",null,"Title of the page.")],-1),os=s("p",null,"Also see:",-1),ps=s("h3",{id:"lang",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#lang","aria-hidden":"true"},"#"),e(" lang")],-1),ts=o("import { createPage } from '@vuepress/core' + +export default { + // create an extra page in onInitialized hook + async onInitialized(app) { + app.pages.push( + await createPage(app, { + path: '/foo.html', + frontmatter: { + layout: 'Layout', + }, + content: \`\\ +# Foo Page + +Hello, world. +\`, + }), + ) + }, +} +
Type:
string
Details:
Language of the page.
",3),is=s("p",null,"Also see:",-1),rs=s("h3",{id:"frontmatter",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),e(" frontmatter")],-1),cs=s("li",null,[s("p",null,[e("Type: "),s("code",null,"PageFrontmatter")])],-1),ds=s("li",null,[s("p",null,"Details:"),s("p",null,"Frontmatter of the page.")],-1),Ds=s("p",null,"Also see:",-1),us=o(` Example:
'en-US'
'zh-CN'
# headers
- Type:
PageHeader[]
`,3),hs=s("li",null,[s("p",null,"Details:"),s("p",null,"Headers of the page.")],-1),ys=s("p",null,"Also see:",-1),vs=o(`interface PageHeader { + level: number + title: string + slug: string + children: PageHeader[] +} +
# data
- Type:
PageData
`,3),ms=s("li",null,[s("p",null,"Details:"),s("p",null,"Data of the page."),s("p",null,"Page data would be available in client side.")],-1),Cs=s("p",null,"Also see:",-1),bs=o('interface PageData { + key: string + path: string + title: string + lang: string + frontmatter: PageFrontmatter + headers: PageHeader[] +} +
# content
Type:
string
Details:
Raw content of the page.
# contentRendered
Type:
string
Details:
Rendered content of the page.
# date
',5),fs=o("Type:
string
Details:
Date of the page, in 'yyyy-MM-dd' format.
",3),gs=s("p",null,"Also see:",-1),_s=s("h3",{id:"deps",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#deps","aria-hidden":"true"},"#"),e(" deps")],-1),Es=s("li",null,[s("p",null,[e("Type: "),s("code",null,"string[]")])],-1),As=s("li",null,[s("p",null,"Details:"),s("p",null,"Dependencies of the page."),s("p",null,[e("For example, if users import code snippet in the page, the absolute file path of the imported file would be added to "),s("code",null,"deps"),e(".")])],-1),ks=s("p",null,"Also see:",-1),xs=o(` Example:
'0000-00-00'
'2021-08-16
'# links
- Type:
MarkdownLink[]
interface MarkdownLink { + raw: string + relative: string + absolute: string +} +
Details:
Links included in the page content.
# markdownEnv
`,5),ws=o("Type:
Record<string, unknown>
",2),Fs=s("p",null,"Also see:",-1),Ps={href:"https://markdown-it.github.io/markdown-it/#MarkdownIt.parse",target:"_blank",rel:"noopener noreferrer"},Bs=s("h3",{id:"pathinferred",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#pathinferred","aria-hidden":"true"},"#"),e(" pathInferred")],-1),Ts=o(' Details:
The
env
object when parsing markdown content with markdown-it.Some markdown-it plugins may store extra information inside this object, and you can make use of them for advanced customization.
Notice that some other page properties are also extracted from the original
env
object. Those properties have already been removed frompage.markdownEnv
.Type:
string | null
Details:
Route path of the page that inferred from file path.
By default, the route path is inferred from the relative file path of the Markdown source file. However, users may explicitly set the route path, e.g. permalink, which would be used as the final route path of the page. So we keep the inferred path as a page property in case you may need it.
It would be
null
if the page does not come from a Markdown source file.',3),Is=s("p",null,"Also see:",-1),Ms=s("li",null,[s("a",{href:"#path"},"Node API > Page Properties > path")],-1),Ss=s("h3",{id:"pathlocale",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#pathlocale","aria-hidden":"true"},"#"),e(" pathLocale")],-1),Rs=o(" Example:
'/'
'/foo.html'
Type:
string
Details:
Locale prefix of the page route path.
It is inferred from the relative file path of the Markdown source file and the key of
locales
option in user config.",3),Ns=s("p",null,"Also see:",-1),Vs=s("h3",{id:"permalink",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#permalink","aria-hidden":"true"},"#"),e(" permalink")],-1),zs=s("li",null,[s("p",null,[e("Type: "),s("code",null,"string | null")])],-1),Hs=s("li",null,[s("p",null,"Details:"),s("p",null,"Permalink of the page.")],-1),Ls=s("p",null,"Also see:",-1),js=s("h3",{id:"routemeta",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#routemeta","aria-hidden":"true"},"#"),e(" routeMeta")],-1),Gs=s("li",null,[s("p",null,[e("Type: "),s("code",null,"Record Example:
'/'
'/en/'
'/zh/'
")])],-1),Os=s("li",null,[s("p",null,"Details:"),s("p",null,"Custom data to be attached to the route record of vue-router.")],-1),Us=s("p",null,"Also see:",-1),Ws={href:"https://router.vuejs.org/api/#meta",target:"_blank",rel:"noopener noreferrer"},qs=o(' What's the difference between route meta and page data?
Both route meta and page data is available in client side. However, route meta is attached to the route record, so the route meta of all pages would be loaded at once when users enter your site. In the contrast, page data is saved in separated files, which would be loaded only when users enter the corresponding page.
Therefore, it's not recommended to store large amounts of info into route meta, otherwise the initial loading speed will be affected a lot when your site has a large number of pages.
# sfcBlocks
',2),$s=s("li",null,[s("p",null,[e("Type: "),s("code",null,"MarkdownSfcBlocks")])],-1),Js=s("li",null,[s("p",null,"Details:"),s("p",null,"Extracted vue SFC blocks of the page.")],-1),Ks=s("p",null,"Also see:",-1),Qs=o('# slug
Type:
string
Details:
Slug of the page.
It is inferred from the filename of the Markdown source file.
# filePath
Type:
string | null
Details:
Absolute path of the Markdown source file of the page.
It would be
null
if the page does not come from a Markdown source file.# filePathRelative
',6);function Xs(Ys,Zs){const i=t("NpmBadge"),p=t("ExternalLinkIcon"),a=t("RouterLink");return c(),d("div",null,[u,l(i,{package:"@vuepress/core"}),s("p",null,[e("Node API is provided by "),s("a",h,[e("@vuepress/core"),l(p)]),e(" package. It is a dependency of the "),s("a",y,[e("vuepress"),l(p)]),e(" package, and you can also install it separately:")]),v,s("p",null,[e("The app instance is available in all hooks of "),l(a,{to:"/reference/plugin-api.html"},{default:n(()=>[e("Plugin API")]),_:1}),e(".")]),m,s("ul",null,[C,s("li",null,[b,s("p",null,[e("Site data that set by user, including all the "),l(a,{to:"/reference/config.html#site-config"},{default:n(()=>[e("site config")]),_:1}),e(", which will be used in client side.")])])]),f,s("ul",null,[g,s("li",null,[_,s("p",null,[e("The "),s("a",E,[e("markdown-it"),l(p)]),e(" instance used for parsing markdown content.")]),s("p",null,[e("It is only available in and after "),l(a,{to:"/reference/plugin-api.html#oninitialized"},{default:n(()=>[e("onInitialized")]),_:1}),e(" hook.")])])]),A,s("ul",null,[k,s("li",null,[x,w,s("p",null,[e("It is only available in and after "),l(a,{to:"/reference/plugin-api.html#oninitialized"},{default:n(()=>[e("onInitialized")]),_:1}),e(" hook.")])])]),F,s("ul",null,[P,s("li",null,[B,s("ul",null,[s("li",null,[l(a,{to:"/advanced/architecture.html#core-process-and-hooks"},{default:n(()=>[e("Advanced > Architecture > Core Process and Hooks")]),_:1})])])])]),T,s("ul",null,[I,s("li",null,[M,s("ul",null,[s("li",null,[l(a,{to:"/advanced/architecture.html#core-process-and-hooks"},{default:n(()=>[e("Advanced > Architecture > Core Process and Hooks")]),_:1})])])])]),S,s("ul",null,[R,s("li",null,[N,s("ul",null,[V,s("li",null,[l(a,{to:"/advanced/architecture.html#core-process-and-hooks"},{default:n(()=>[e("Advanced > Architecture > Core Process and Hooks")]),_:1})])])])]),z,s("ul",null,[H,s("li",null,[L,s("ul",null,[j,s("li",null,[l(a,{to:"/advanced/architecture.html#core-process-and-hooks"},{default:n(()=>[e("Advanced > Architecture > Core Process and Hooks")]),_:1})])])])]),G,s("ul",null,[s("li",null,[e("Also see: "),s("ul",null,[O,s("li",null,[l(a,{to:"/advanced/cookbook/adding-extra-pages.html"},{default:n(()=>[e("Cookbook > Adding Extra Pages")]),_:1})])])])]),U,W,s("ul",null,[q,s("li",null,[$,J,s("p",null,[e("The page key would be used as the "),s("a",K,[e("name"),l(p)]),e(" of the page route.")])]),s("li",null,[Q,s("ul",null,[s("li",null,[l(a,{to:"/reference/components.html#content"},{default:n(()=>[e("Built-in Components > Content")]),_:1})])])])]),X,s("ul",null,[Y,Z,s("li",null,[ss,s("ul",null,[s("li",null,[l(a,{to:"/guide/page.html#routing"},{default:n(()=>[e("Guide > Page > Routing")]),_:1})]),es])])]),ls,s("ul",null,[as,ns,s("li",null,[os,s("ul",null,[s("li",null,[l(a,{to:"/reference/frontmatter.html#title"},{default:n(()=>[e("Frontmatter > title")]),_:1})])])])]),ps,s("ul",null,[ts,s("li",null,[is,s("ul",null,[s("li",null,[l(a,{to:"/reference/frontmatter.html#title"},{default:n(()=>[e("Frontmatter > lang")]),_:1})])])])]),rs,s("ul",null,[cs,ds,s("li",null,[Ds,s("ul",null,[s("li",null,[l(a,{to:"/reference/frontmatter.html"},{default:n(()=>[e("Frontmatter")]),_:1})])])])]),us,s("ul",null,[hs,s("li",null,[ys,s("ul",null,[s("li",null,[l(a,{to:"/reference/config.html#markdown-headers"},{default:n(()=>[e("Config > markdown.headers")]),_:1})])])])]),vs,s("ul",null,[ms,s("li",null,[Cs,s("ul",null,[s("li",null,[l(a,{to:"/reference/client-api.html#usepagedata"},{default:n(()=>[e("Client API > usePageData")]),_:1})]),s("li",null,[l(a,{to:"/reference/plugin-api.html#extendspage"},{default:n(()=>[e("Plugin API > extendsPage")]),_:1})])])])]),bs,s("ul",null,[fs,s("li",null,[gs,s("ul",null,[s("li",null,[l(a,{to:"/reference/frontmatter.html#date"},{default:n(()=>[e("Frontmatter > date")]),_:1})])])])]),_s,s("ul",null,[Es,As,s("li",null,[ks,s("ul",null,[s("li",null,[l(a,{to:"/reference/config.html#markdown-importcode"},{default:n(()=>[e("Config > markdown.importCode")]),_:1})])])])]),xs,s("ul",null,[ws,s("li",null,[Fs,s("ul",null,[s("li",null,[s("a",Ps,[e("markdown-it > API Documentation > MarkdownIt > parse"),l(p)])])])])]),Bs,s("ul",null,[Ts,s("li",null,[Is,s("ul",null,[s("li",null,[l(a,{to:"/guide/page.html#routing"},{default:n(()=>[e("Guide > Page > Routing")]),_:1})]),Ms])])]),Ss,s("ul",null,[Rs,s("li",null,[Ns,s("ul",null,[s("li",null,[l(a,{to:"/reference/config.html#locales"},{default:n(()=>[e("Config > locales")]),_:1})])])])]),Vs,s("ul",null,[zs,Hs,s("li",null,[Ls,s("ul",null,[s("li",null,[l(a,{to:"/reference/frontmatter.html#permalink"},{default:n(()=>[e("Frontmatter > permalink")]),_:1})]),s("li",null,[l(a,{to:"/reference/frontmatter.html#permalinkpattern"},{default:n(()=>[e("Frontmatter > permalinkPattern")]),_:1})])])])]),js,s("ul",null,[Gs,Os,s("li",null,[Us,s("ul",null,[s("li",null,[l(a,{to:"/reference/frontmatter.html#routemeta"},{default:n(()=>[e("Frontmatter > routeMeta")]),_:1})]),s("li",null,[s("a",Ws,[e("vue-router > API Reference > RouteRecordRaw > meta"),l(p)])])])])]),qs,s("ul",null,[$s,Js,s("li",null,[Ks,s("ul",null,[s("li",null,[l(a,{to:"/reference/config.html#markdown-sfc"},{default:n(()=>[e("Config > markdown.sfc")]),_:1})])])])]),Qs])}const ee=r(D,[["render",Xs],["__file","node-api.html.vue"]]);export{ee as default}; diff --git a/assets/node-api.html-lHGIfrDJ.js b/assets/node-api.html-lHGIfrDJ.js new file mode 100644 index 000000000..10e8636e1 --- /dev/null +++ b/assets/node-api.html-lHGIfrDJ.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4986678d","path":"/reference/node-api.html","title":"Node API","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"App","slug":"app","link":"#app","children":[{"level":3,"title":"createBuildApp","slug":"createbuildapp","link":"#createbuildapp","children":[]},{"level":3,"title":"createDevApp","slug":"createdevapp","link":"#createdevapp","children":[]}]},{"level":2,"title":"App Properties","slug":"app-properties","link":"#app-properties","children":[{"level":3,"title":"options","slug":"options","link":"#options","children":[]},{"level":3,"title":"siteData","slug":"sitedata","link":"#sitedata","children":[]},{"level":3,"title":"version","slug":"version","link":"#version","children":[]},{"level":3,"title":"env.isBuild","slug":"env-isbuild","link":"#env-isbuild","children":[]},{"level":3,"title":"env.isDev","slug":"env-isdev","link":"#env-isdev","children":[]},{"level":3,"title":"env.isDebug","slug":"env-isdebug","link":"#env-isdebug","children":[]},{"level":3,"title":"markdown","slug":"markdown","link":"#markdown","children":[]},{"level":3,"title":"pages","slug":"pages","link":"#pages","children":[]}]},{"level":2,"title":"App Methods","slug":"app-methods","link":"#app-methods","children":[{"level":3,"title":"dir","slug":"dir","link":"#dir","children":[]},{"level":3,"title":"writeTemp","slug":"writetemp","link":"#writetemp","children":[]},{"level":3,"title":"init","slug":"init","link":"#init","children":[]},{"level":3,"title":"prepare","slug":"prepare","link":"#prepare","children":[]},{"level":3,"title":"build","slug":"build","link":"#build","children":[]},{"level":3,"title":"dev","slug":"dev","link":"#dev","children":[]}]},{"level":2,"title":"Page","slug":"page","link":"#page","children":[{"level":3,"title":"createPage","slug":"createpage","link":"#createpage","children":[]}]},{"level":2,"title":"Page Properties","slug":"page-properties","link":"#page-properties","children":[{"level":3,"title":"key","slug":"key","link":"#key","children":[]},{"level":3,"title":"path","slug":"path","link":"#path","children":[]},{"level":3,"title":"title","slug":"title","link":"#title","children":[]},{"level":3,"title":"lang","slug":"lang","link":"#lang","children":[]},{"level":3,"title":"frontmatter","slug":"frontmatter","link":"#frontmatter","children":[]},{"level":3,"title":"headers","slug":"headers","link":"#headers","children":[]},{"level":3,"title":"data","slug":"data","link":"#data","children":[]},{"level":3,"title":"content","slug":"content","link":"#content","children":[]},{"level":3,"title":"contentRendered","slug":"contentrendered","link":"#contentrendered","children":[]},{"level":3,"title":"date","slug":"date","link":"#date","children":[]},{"level":3,"title":"deps","slug":"deps","link":"#deps","children":[]},{"level":3,"title":"links","slug":"links","link":"#links","children":[]},{"level":3,"title":"markdownEnv","slug":"markdownenv","link":"#markdownenv","children":[]},{"level":3,"title":"pathInferred","slug":"pathinferred","link":"#pathinferred","children":[]},{"level":3,"title":"pathLocale","slug":"pathlocale","link":"#pathlocale","children":[]},{"level":3,"title":"permalink","slug":"permalink","link":"#permalink","children":[]},{"level":3,"title":"routeMeta","slug":"routemeta","link":"#routemeta","children":[]},{"level":3,"title":"sfcBlocks","slug":"sfcblocks","link":"#sfcblocks","children":[]},{"level":3,"title":"slug","slug":"slug","link":"#slug","children":[]},{"level":3,"title":"filePath","slug":"filepath","link":"#filepath","children":[]},{"level":3,"title":"filePathRelative","slug":"filepathrelative","link":"#filepathrelative","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/node-api.md"}');export{e as data}; diff --git a/assets/node-api.html-tuX36iXe.js b/assets/node-api.html-tuX36iXe.js new file mode 100644 index 000000000..86fd512ca --- /dev/null +++ b/assets/node-api.html-tuX36iXe.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-e19cff04","path":"/zh/reference/node-api.html","title":"Node API","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"App","slug":"app","link":"#app","children":[{"level":3,"title":"createBuildApp","slug":"createbuildapp","link":"#createbuildapp","children":[]},{"level":3,"title":"createDevApp","slug":"createdevapp","link":"#createdevapp","children":[]}]},{"level":2,"title":"App 属性","slug":"app-属性","link":"#app-属性","children":[{"level":3,"title":"options","slug":"options","link":"#options","children":[]},{"level":3,"title":"siteData","slug":"sitedata","link":"#sitedata","children":[]},{"level":3,"title":"version","slug":"version","link":"#version","children":[]},{"level":3,"title":"env.isBuild","slug":"env-isbuild","link":"#env-isbuild","children":[]},{"level":3,"title":"env.isDev","slug":"env-isdev","link":"#env-isdev","children":[]},{"level":3,"title":"env.isDebug","slug":"env-isdebug","link":"#env-isdebug","children":[]},{"level":3,"title":"markdown","slug":"markdown","link":"#markdown","children":[]},{"level":3,"title":"pages","slug":"pages","link":"#pages","children":[]}]},{"level":2,"title":"App 方法","slug":"app-方法","link":"#app-方法","children":[{"level":3,"title":"dir","slug":"dir","link":"#dir","children":[]},{"level":3,"title":"writeTemp","slug":"writetemp","link":"#writetemp","children":[]},{"level":3,"title":"init","slug":"init","link":"#init","children":[]},{"level":3,"title":"prepare","slug":"prepare","link":"#prepare","children":[]},{"level":3,"title":"build","slug":"build","link":"#build","children":[]},{"level":3,"title":"dev","slug":"dev","link":"#dev","children":[]}]},{"level":2,"title":"Page","slug":"page","link":"#page","children":[{"level":3,"title":"createPage","slug":"createpage","link":"#createpage","children":[]}]},{"level":2,"title":"Page 属性","slug":"page-属性","link":"#page-属性","children":[{"level":3,"title":"key","slug":"key","link":"#key","children":[]},{"level":3,"title":"path","slug":"path","link":"#path","children":[]},{"level":3,"title":"title","slug":"title","link":"#title","children":[]},{"level":3,"title":"lang","slug":"lang","link":"#lang","children":[]},{"level":3,"title":"frontmatter","slug":"frontmatter","link":"#frontmatter","children":[]},{"level":3,"title":"headers","slug":"headers","link":"#headers","children":[]},{"level":3,"title":"data","slug":"data","link":"#data","children":[]},{"level":3,"title":"content","slug":"content","link":"#content","children":[]},{"level":3,"title":"contentRendered","slug":"contentrendered","link":"#contentrendered","children":[]},{"level":3,"title":"date","slug":"date","link":"#date","children":[]},{"level":3,"title":"deps","slug":"deps","link":"#deps","children":[]},{"level":3,"title":"links","slug":"links","link":"#links","children":[]},{"level":3,"title":"markdownEnv","slug":"markdownenv","link":"#markdownenv","children":[]},{"level":3,"title":"pathInferred","slug":"pathinferred","link":"#pathinferred","children":[]},{"level":3,"title":"pathLocale","slug":"pathlocale","link":"#pathlocale","children":[]},{"level":3,"title":"permalink","slug":"permalink","link":"#permalink","children":[]},{"level":3,"title":"routeMeta","slug":"routemeta","link":"#routemeta","children":[]},{"level":3,"title":"sfcBlocks","slug":"sfcblocks","link":"#sfcblocks","children":[]},{"level":3,"title":"slug","slug":"slug","link":"#slug","children":[]},{"level":3,"title":"filePath","slug":"filepath","link":"#filepath","children":[]},{"level":3,"title":"filePathRelative","slug":"filepathrelative","link":"#filepathrelative","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/node-api.md"}');export{e as data}; diff --git a/assets/nprogress.html-NpXpKxIh.js b/assets/nprogress.html-NpXpKxIh.js new file mode 100644 index 000000000..06ad2ffcd --- /dev/null +++ b/assets/nprogress.html-NpXpKxIh.js @@ -0,0 +1,11 @@ +import{_ as o,r as e,o as p,c,d as a,a as n,b as s,e as i}from"./app-eU2v8o1B.js";const t={},d=n("h1",{id:"nprogress-plugin",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#nprogress-plugin","aria-hidden":"true"},"#"),s(" nprogress Plugin")],-1),D={href:"https://github.com/rstacruz/nprogress",target:"_blank",rel:"noopener noreferrer"},u=i(`
Type:
string | null
Details:
Relative path of the Markdown source file of the page.
It would be
null
if the page does not come from a Markdown source file.This plugin has been integrated into the default theme.
# Usage
npm i -D @vuepress/plugin-nprogress@next +
import { nprogressPlugin } from '@vuepress/plugin-nprogress' + +export default { + plugins: [nprogressPlugin()], +} +
# Styles
You can customize the style of the progress bar via CSS variables:
`,7);function g(y,h){const l=e("NpmBadge"),r=e("ExternalLinkIcon");return p(),c("div",null,[d,a(l,{package:"@vuepress/plugin-nprogress"}),n("p",null,[s("Integrate "),n("a",D,[s("nprogress"),a(r)]),s(" into VuePress, which can provide a progress bar when navigating to another page.")]),u])}const m=o(t,[["render",g],["__file","nprogress.html.vue"]]);export{m as default}; diff --git a/assets/nprogress.html-RNgL0QGZ.js b/assets/nprogress.html-RNgL0QGZ.js new file mode 100644 index 000000000..f076246bc --- /dev/null +++ b/assets/nprogress.html-RNgL0QGZ.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-46d4f19d","path":"/reference/plugin/nprogress.html","title":"nprogress","lang":"en-US","frontmatter":{"title":"nprogress"},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Styles","slug":"styles","link":"#styles","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/nprogress.md"}');export{e as data}; diff --git a/assets/nprogress.html-X5umHJyu.js b/assets/nprogress.html-X5umHJyu.js new file mode 100644 index 000000000..43c2f8a3b --- /dev/null +++ b/assets/nprogress.html-X5umHJyu.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-9f56ece4","path":"/zh/reference/plugin/nprogress.html","title":"nprogress","lang":"zh-CN","frontmatter":{"title":"nprogress"},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"样式","slug":"样式","link":"#样式","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/nprogress.md"}');export{e as data}; diff --git a/assets/nprogress.html-gqI71Nvz.js b/assets/nprogress.html-gqI71Nvz.js new file mode 100644 index 000000000..93929e4a9 --- /dev/null +++ b/assets/nprogress.html-gqI71Nvz.js @@ -0,0 +1,11 @@ +import{_ as o,r as a,o as p,c,d as e,a as n,b as s,e as i}from"./app-eU2v8o1B.js";const t={},d=n("h1",{id:"nprogress-插件",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#nprogress-插件","aria-hidden":"true"},"#"),s(" nprogress 插件")],-1),D={href:"https://github.com/rstacruz/nprogress",target:"_blank",rel:"noopener noreferrer"},u=i(`:root { + --nprogress-color: #29d; + --nprogress-z-index: 1031; +} +
该插件已经集成到默认主题中。
# 使用方法
npm i -D @vuepress/plugin-nprogress@next +
import { nprogressPlugin } from '@vuepress/plugin-nprogress' + +export default { + plugins: [nprogressPlugin()], +} +
# 样式
你可以通过 CSS 变量来自定义进度条的样式:
`,7);function y(v,g){const l=a("NpmBadge"),r=a("ExternalLinkIcon");return p(),c("div",null,[d,e(l,{package:"@vuepress/plugin-nprogress"}),n("p",null,[s("将 "),n("a",D,[s("nprogress"),e(r)]),s(" 集成到 VuePress 中,在切换到另一个页面时会展示进度条。")]),u])}const m=o(t,[["render",y],["__file","nprogress.html.vue"]]);export{m as default}; diff --git a/assets/page.html-3BGhEu12.js b/assets/page.html-3BGhEu12.js new file mode 100644 index 000000000..dbddc39fc --- /dev/null +++ b/assets/page.html-3BGhEu12.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-7a8fca2f","path":"/zh/guide/page.html","title":"页面","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"路由","slug":"路由","link":"#路由","children":[]},{"level":2,"title":"Frontmatter","slug":"frontmatter","link":"#frontmatter","children":[]},{"level":2,"title":"内容","slug":"内容","link":"#内容","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/guide/page.md"}');export{e as data}; diff --git a/assets/page.html-_zftyobR.js b/assets/page.html-_zftyobR.js new file mode 100644 index 000000000..1b249af94 --- /dev/null +++ b/assets/page.html-_zftyobR.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4eaf9f84","path":"/guide/page.html","title":"Page","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Routing","slug":"routing","link":"#routing","children":[]},{"level":2,"title":"Frontmatter","slug":"frontmatter","link":"#frontmatter","children":[]},{"level":2,"title":"Content","slug":"content","link":"#content","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"guide/page.md"}');export{e as data}; diff --git a/assets/page.html-jiu4BY9r.js b/assets/page.html-jiu4BY9r.js new file mode 100644 index 000000000..3190aff8b --- /dev/null +++ b/assets/page.html-jiu4BY9r.js @@ -0,0 +1,12 @@ +import{_ as l,r as d,o as i,c,a as t,b as e,d as n,w as s,e as r}from"./app-eU2v8o1B.js";const u={},p=r(`:root { + --nprogress-color: #29d; + --nprogress-z-index: 1031; +} +
# Page
VuePress is markdown-centered. Each markdown file inside your project is a standalone page.
# Routing
By default, the route path of a page is determined by the relative path of your markdown file.
Assuming this is the directory structure of your markdown files:
`,6),h=t("code",null,"docs",-1),m=t("code",null,"vuepress dev docs",-1),f=r("└─ docs + ├─ guide + │ ├─ getting-started.md + │ └─ README.md + ├─ contributing.md + └─ README.md +
",1),_={class:"custom-container tip"},g=t("p",{class:"custom-container-title"},"TIP",-1),v=t("p",null,[e("By default, both "),t("code",null,"README.md"),e(" and "),t("code",null,"index.md"),e(" would be converted to "),t("code",null,"index.html"),e(" and generate a slash-ending route path. However, it might cause conflicts if you want to keep both of the two files.")],-1),b=t("code",null,"['**/*.md', '!**/README.md', '!.vuepress', '!node_modules']",-1),D=t("code",null,"README.md",-1),y=t("code",null,":",-1),k=t("code",null,"+",-1),w={href:"https://router.vuejs.org/guide/essentials/route-matching-syntax.html",target:"_blank",rel:"noopener noreferrer"},x=t("h2",{id:"frontmatter",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),e(" Frontmatter")],-1),E={href:"https://yaml.org/",target:"_blank",rel:"noopener noreferrer"},M=r(`
Relative Path Route Path /README.md
/
/index.md
/
/contributing.md
/contributing.html
/guide/README.md
/guide/
/guide/getting-started.md
/guide/getting-started.html
`,1),C=t("code",null,"lang",-1),R=t("code",null,"title",-1),A=t("code",null,"description",-1),P=t("p",null,"Also, VuePress has built-in support for some frontmatter fields, and your theme may have its own special frontmatter, too.",-1),V={class:"custom-container tip"},T=t("p",{class:"custom-container-title"},"TIP",-1),L=t("h2",{id:"content",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#content","aria-hidden":"true"},"#"),e(" Content")],-1),B=t("p",null,[e("The main content of your page is written in Markdown. VuePress will firstly transform your Markdown to HTML code, then treat the HTML code as "),t("code",null,""),e(" of Vue SFC.")],-1),F={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"};function I(N,S){const o=d("RouterLink"),a=d("ExternalLinkIcon");return i(),c("div",null,[p,t("p",null,[e("Take the "),h,e(" directory as your "),n(o,{to:"/reference/cli.html"},{default:s(()=>[e("sourceDir")]),_:1}),e(", e.g. you are running "),m,e(" command. Then the route paths of your markdown files would be:")]),f,t("div",_,[g,v,t("p",null,[e("In such case, you can set the "),n(o,{to:"/reference/config.html#pagepatterns"},{default:s(()=>[e("pagePatterns")]),_:1}),e(" to avoid one of them being processed by VuePress, e.g. use "),b,e(" to exclude all "),D,e(" files.")]),t("p",null,[e("Also, some symbols like "),y,e(" and "),k,e(" may have special meanings for vue-router, so you should avoid using them, see "),t("a",w,[e("vue-router docs"),n(a)]),e(" for more details.")])]),x,t("p",null,[e("A markdown file could contain a "),t("a",E,[e("YAML"),n(a)]),e(" frontmatter. The frontmatter must be at the top of the Markdown file and must be wrapped with a couple of triple-dashed lines. Here is a basic example:")]),M,t("p",null,[e("You must have noticed that those fields are similar with the "),n(o,{to:"/guide/configuration.html#site-config"},{default:s(()=>[e("Site Config")]),_:1}),e(" in the "),n(o,{to:"/guide/configuration.html#config-file"},{default:s(()=>[e("Config File")]),_:1}),e(". You can override "),C,e(", "),R,e(", "),A,e(", etc., of current page via frontmatter. So you can take frontmatter as page scope config.")]),P,t("div",V,[T,t("p",null,[e("Check out the "),n(o,{to:"/reference/frontmatter.html"},{default:s(()=>[e("Frontmatter Reference")]),_:1}),e(" for a full list of VuePress built-in frontmatter.")]),t("p",null,[e("Check out the "),n(o,{to:"/reference/default-theme/frontmatter.html"},{default:s(()=>[e("Default Theme > Frontmatter Reference")]),_:1}),e(" for the frontmatter of default theme.")])]),L,B,t("p",null,[e("With the power of "),t("a",F,[e("markdown-it"),n(a)]),e(" and Vue template syntax, the basic Markdown can be extended a lot. Next, check out the "),n(o,{to:"/guide/markdown.html"},{default:s(()=>[e("Markdown")]),_:1}),e(" guide for all the extensions of Markdown in VuePress.")])])}const Y=l(u,[["render",I],["__file","page.html.vue"]]);export{Y as default}; diff --git a/assets/page.html-qK-n-fJU.js b/assets/page.html-qK-n-fJU.js new file mode 100644 index 000000000..ef0c69f6f --- /dev/null +++ b/assets/page.html-qK-n-fJU.js @@ -0,0 +1,12 @@ +import{_ as l,r,o as c,c as i,a as t,b as e,d as n,w as o,e as d}from"./app-eU2v8o1B.js";const p={},u=d(`--- +lang: en-US +title: Title of this page +description: Description of this page +--- +
# 页面
VuePress 是以 Markdown 为中心的。你项目中的每一个 Markdown 文件都是一个单独的页面。
# 路由
默认情况下,页面的路由路径是根据你的 Markdown 文件的相对路径决定的。
假设这是你的 Markdown 文件所处的目录结构:
`,6),h=t("code",null,"docs",-1),m=t("code",null,"vuepress dev docs",-1),_=d("└─ docs + ├─ guide + │ ├─ getting-started.md + │ └─ README.md + ├─ contributing.md + └─ README.md +
",1),D={class:"custom-container tip"},g=t("p",{class:"custom-container-title"},"提示",-1),v=t("p",null,[e("默认配置下, "),t("code",null,"README.md"),e(" 和 "),t("code",null,"index.md"),e(" 都会被转换成 "),t("code",null,"index.html"),e(" ,并且其对应的路由路径都是由斜杠结尾的。然而,如果你想同时保留这两个文件,就可能会造成冲突。")],-1),f=t("code",null,"['**/*.md', '!**/README.md', '!.vuepress', '!node_modules']",-1),b=t("code",null,"README.md",-1),k=t("code",null,":",-1),E=t("code",null,"+",-1),y={href:"https://router.vuejs.org/zh/guide/essentials/route-matching-syntax.html",target:"_blank",rel:"noopener noreferrer"},M=t("h2",{id:"frontmatter",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#frontmatter","aria-hidden":"true"},"#"),e(" Frontmatter")],-1),x={href:"https://yaml.org/",target:"_blank",rel:"noopener noreferrer"},w=d(`
相对路径 路由路径 /README.md
/
/index.md
/
/contributing.md
/contributing.html
/guide/README.md
/guide/
/guide/getting-started.md
/guide/getting-started.html
`,1),F=t("code",null,"lang",-1),V=t("code",null,"title",-1),A=t("code",null,"description",-1),z=t("p",null,"同样的,VuePress 有一些内置支持的 Frontmatter 字段,而你使用的主题也可能有它自己的特殊 Frontmatter 。",-1),C={class:"custom-container tip"},R=t("p",{class:"custom-container-title"},"提示",-1),L=t("h2",{id:"内容",tabindex:"-1"},[t("a",{class:"header-anchor",href:"#内容","aria-hidden":"true"},"#"),e(" 内容")],-1),P=t("p",null,[e("页面的主要内容是使用 Markdown 书写的。VuePress 首先会将 Markdown 转换为 HTML ,然后将 HTML 作为 Vue 单文件组件的 "),t("code",null,""),e(" 。")],-1),B={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"};function N(T,H){const s=r("RouterLink"),a=r("ExternalLinkIcon");return c(),i("div",null,[u,t("p",null,[e("将 "),h,e(" 目录作为你的 "),n(s,{to:"/zh/reference/cli.html"},{default:o(()=>[e("sourceDir")]),_:1}),e(" ,例如你在运行 "),m,e(" 命令。此时,你的 Markdown 文件对应的路由路径为:")]),_,t("div",D,[g,v,t("p",null,[e("在这种情况下,你可以设置 "),n(s,{to:"/zh/reference/config.html#pagepatterns"},{default:o(()=>[e("pagePatterns")]),_:1}),e(" 来避免某个文件被 VuePress 处理,例如使用 "),f,e(" 来排除所有的 "),b,e(" 文件。")]),t("p",null,[e("此外,一些符号如 "),k,e(" 和 "),E,e(" 可能对 vue-router 有特殊含义,因此你应该避免使用它们,请参阅 "),t("a",y,[e("vue-router 文档"),n(a)]),e(" 了解更多详情。")])]),M,t("p",null,[e("Markdown 文件可以包含一个 "),t("a",x,[e("YAML"),n(a)]),e(" Frontmatter 。Frontmatter 必须在 Markdown 文件的顶部,并且被包裹在一对三短划线中间。下面是一个基本的示例:")]),w,t("p",null,[e("你肯定注意到 Frontmatter 中的字段和"),n(s,{to:"/zh/guide/configuration.html#config-file"},{default:o(()=>[e("配置文件")]),_:1}),e("中的"),n(s,{to:"/zh/guide/configuration.html#%E7%AB%99%E7%82%B9%E9%85%8D%E7%BD%AE"},{default:o(()=>[e("站点配置")]),_:1}),e("十分类似。你可以通过 Frontmatter 来覆盖当前页面的 "),F,e(", "),V,e(", "),A,e(" 等属性。因此,你可以把 Frontmatter 当作页面级作用域的配置。")]),z,t("div",C,[R,t("p",null,[e("前往 "),n(s,{to:"/zh/reference/frontmatter.html"},{default:o(()=>[e("Frontmatter 参考")]),_:1}),e(" 查看 VuePress 支持的 Frontmatter 配置。")]),t("p",null,[e("前往 "),n(s,{to:"/zh/reference/default-theme/frontmatter.html"},{default:o(()=>[e("默认主题 > Frontmatter 参考")]),_:1}),e(" 查看默认主题的 Frontmatter 配置。")])]),L,P,t("p",null,[e("借助 "),t("a",B,[e("markdown-it"),n(a)]),e(" 和 Vue 模板语法的能力,基础的 Markdown 可以得到很多的扩展功能。接下来,前往 "),n(s,{to:"/zh/guide/markdown.html"},{default:o(()=>[e("Markdown")]),_:1}),e(" 章节来了解 VuePress 中 Markdown 的扩展功能。")])])}const j=l(p,[["render",N],["__file","page.html.vue"]]);export{j as default}; diff --git a/assets/palette.html-Vi2lcYGC.js b/assets/palette.html-Vi2lcYGC.js new file mode 100644 index 000000000..f97e75204 --- /dev/null +++ b/assets/palette.html-Vi2lcYGC.js @@ -0,0 +1,39 @@ +import{_ as t,r as n,o,c as r,d as l,a as e,b as s,e as p}from"./app-eU2v8o1B.js";const c={},d=e("h1",{id:"palette",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#palette","aria-hidden":"true"},"#"),s(" palette")],-1),u=p(`--- +lang: zh-CN +title: 页面的标题 +description: 页面的描述 +--- +
为你的主题提供调色板功能。
该插件主要用于开发主题,并且已经集成到默认主题中。大部分情况下你不需要直接使用它。
对于主题作者,该插件可以帮助你提供用户自定义样式的能力。
# 使用方法
npm i -D @vuepress/plugin-palette@next +
import { palettePlugin } from '@vuepress/plugin-palette' + +export default { + plugins: [ + palettePlugin({ + // 配置项 + }), + ], +} +
# 调色板和样式
该插件会提供一个
`,8),D={href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties",target:"_blank",rel:"noopener noreferrer"},y={href:"https://sass-lang.com/documentation/variables",target:"_blank",rel:"noopener noreferrer"},h={href:"http://lesscss.org/features/#variables-feature",target:"_blank",rel:"noopener noreferrer"},v={href:"https://stylus-lang.com/docs/variables.html",target:"_blank",rel:"noopener noreferrer"},m=p(`@vuepress/plugin-palette/palette
(调色板文件)和一个@vuepress/plugin-palette/style
(样式文件),用于在你的主题样式中引入。样式文件用于覆盖默认样式或添加额外样式,因此它一般会在你主题样式的末尾引入。
# 使用
在你的主题中使用该插件,假设你使用 SASS 作为 CSS 预处理器:
export default { + // ... + plugins: [palettePlugin({ preset: 'sass' })], +} +
# 使用调色板
在你主题需要使用对应变量的地方引入该插件的调色板文件,比如在
Layout.vue
中:<template> + <h1 class="palette-title">你好,调色板!</h1> +</template> + +<style lang="scss"> +/* 从该插件的调色板中引入变量 */ +@import '@vuepress/plugin-palette/palette'; + +/* 设置变量的默认值 */ +$color: red !default; + +/* 在你的样式中使用变量 */ +.palette-title { + color: $color; +} +</style> +
然后,用户就可以在
.vuepress/styles/palette.scss
中自定义变量:$color: green; +
# 使用样式
在你主题的样式之后引入该插件的样式文件,比如在
clientConfigFile
中:// 引入你主题本身的样式文件 +import 'path/to/your/theme/style' +// 引入该插件的样式文件 +import '@vuepress/plugin-palette/style' +
然后,用户就可以在
.vuepress/styles/index.scss
中添加额外样式,并可以覆盖你主题本身的样式:h1 { + font-size: 2.5rem; +} +
# 配置项
# preset
类型:
'css' | 'sass' | 'less' | 'stylus'
默认值:
'css'
详情:
设置其他选项的预设。
如果你没有对该插件进行进阶定制化的需要,建议只设置该配置项并忽略其他选项。
# userPaletteFile
类型:
string
默认值:
- css:
'.vuepress/styles/palette.css'
- sass:
'.vuepress/styles/palette.scss'
- less:
'.vuepress/styles/palette.less'
- stylus:
'.vuepress/styles/palette.styl'
详情:
用户调色板文件的路径,是针对源文件目录的相对路径。
默认值依赖于 preset 配置项。
该文件用于用户定义样式变量,建议保持默认值作为约定的文件路径。
# tempPaletteFile
类型:
string
默认值:
- css:
'styles/palette.css'
- sass:
'styles/palette.scss'
- less:
'styles/palette.less'
- stylus:
'styles/palette.styl'
详情:
生成的调色板临时文件的路径,是针对临时文件文件目录的相对路径。
默认值依赖于 preset 配置项。
你应该使用
'@vuepress/plugin-palette/palette'
别名来引入调色板文件,因此在绝大多数情况下你不需要修改该配置项。# userStyleFile
类型:
string
默认值:
- css:
'.vuepress/styles/index.css'
- sass:
'.vuepress/styles/index.scss'
- less:
'.vuepress/styles/index.less'
- stylus:
'.vuepress/styles/index.styl'
详情:
用户样式文件的路径,是针对源文件目录的相对路径。
默认值依赖于 preset 配置项。
该文件用于用户覆盖默认样式和添加额外样式,建议保持默认值作为约定的文件路径。
# tempStyleFile
类型:
string
默认值:
- css:
'styles/index.css'
- sass:
'styles/index.scss'
- less:
'styles/index.less'
- stylus:
'styles/index.styl'
详情:
生成的样式临时文件的路径,是针对临时文件文件目录的相对路径。
默认值依赖于 preset 配置项。
你应该使用
'@vuepress/plugin-palette/style'
别名来引入样式文件,因此在绝大多数情况下你不需要修改该配置项。# importCode
`,27);function b(C,g){const i=n("NpmBadge"),a=n("ExternalLinkIcon");return o(),r("div",null,[d,l(i,{package:"@vuepress/plugin-palette"}),u,e("p",null,[s("调色板文件用于定义样式变量,因此它一般会在你主题样式的开头引入。举例来说,用户可以在调色板中定义 "),e("a",D,[s("CSS 变量"),l(a)]),s(" 、 "),e("a",y,[s("SASS 变量"),l(a)]),s(" 、 "),e("a",h,[s("LESS 变量"),l(a)]),s(" 或 "),e("a",v,[s("Stylus 变量"),l(a)]),s(" ,然后你可以在你的主题样式中使用这些变量。")]),m])}const E=t(c,[["render",b],["__file","palette.html.vue"]]);export{E as default}; diff --git a/assets/palette.html-b242Udjo.js b/assets/palette.html-b242Udjo.js new file mode 100644 index 000000000..08d305e71 --- /dev/null +++ b/assets/palette.html-b242Udjo.js @@ -0,0 +1,39 @@ +import{_ as i,r as n,o,c as r,d as l,a as s,b as e,e as t}from"./app-eU2v8o1B.js";const c={},d=s("h1",{id:"palette",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#palette","aria-hidden":"true"},"#"),e(" palette")],-1),u=t(`
类型:
(filePath: string) => string
默认值:
- css:
(filePath) => \`@import '\${filePath}';\\n\`
- sass:
(filePath) => \`@forward 'file:///\${filePath}';\\n\`
- less:
(filePath) => \`@import '\${filePath}';\\n\`
- stylus:
(filePath) => \`@require '\${filePath}';\\n\`
详情:
用于生成引入代码的函数。
默认值依赖于 preset 配置项。
该配置项用于生成 tempPaletteFile 和 tempStyleFile ,在绝大多数情况下你不需要修改该配置项。
Provide palette support for your theme.
This plugin is mainly used to develop themes, and has been integrated into the default theme. You won't need to use it directly in most cases.
For theme authors, this plugin will help you to provide styles customization for users.
# Usage
npm i -D @vuepress/plugin-palette@next +
import { palettePlugin } from '@vuepress/plugin-palette' + +export default { + plugins: [ + palettePlugin({ + // options + }), + ], +} +
# Palette and Style
This plugin will provide a
`,8),y={href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties",target:"_blank",rel:"noopener noreferrer"},h={href:"https://sass-lang.com/documentation/variables",target:"_blank",rel:"noopener noreferrer"},D={href:"http://lesscss.org/features/#variables-feature",target:"_blank",rel:"noopener noreferrer"},v={href:"https://stylus-lang.com/docs/variables.html",target:"_blank",rel:"noopener noreferrer"},m=t(`@vuepress/plugin-palette/palette
(palette file) and a@vuepress/plugin-palette/style
(style file) to be imported in your theme styles.The style file is used for overriding the default styles or adding extra styles, so it's likely to be imported at the end of your theme styles.
# Usage
Use this plugin in your theme, assuming you are using SASS:
export default { + // ... + plugins: [palettePlugin({ preset: 'sass' })], +} +
# Usage of Palette
Import the plugin's palette file where your theme needs to use the corresponding variables, such as in the
Layout.vue
file:<template> + <h1 class="palette-title">Hello, Palette!</h1> +</template> + +<style lang="scss"> +/* import variables from the plugin's palette file */ +@import '@vuepress/plugin-palette/palette'; + +/* set default value for variables */ +$color: red !default; + +/* use variables in your styles */ +.palette-title { + color: $color; +} +</style> +
Then users can customize variables in
.vuepress/styles/palette.scss
:$color: green; +
# Usage of Style
Import the plugin's style file after your theme's styles, for example, in the
clientConfigFile
:// import your theme's style file +import 'path/to/your/theme/style' +// import the plugin's style file +import '@vuepress/plugin-palette/style' +
Then users can add extra styles in
.vuepress/styles/index.scss
and override the default styles of your theme:h1 { + font-size: 2.5rem; +} +
# Options
# preset
Type:
'css' | 'sass' | 'less' | 'stylus'
Default:
'css'
Details:
Set preset for other options.
If you don't need advanced customization of the plugin, it's recommended to only set this option and omit other options.
# userPaletteFile
Type:
string
Default:
- css:
'.vuepress/styles/palette.css'
- sass:
'.vuepress/styles/palette.scss'
- less:
'.vuepress/styles/palette.less'
- stylus:
'.vuepress/styles/palette.styl'
Details:
File path of the user palette file, relative to source directory.
The default value depends on the preset option.
The file is where users define style variables, and it's recommended to keep the default file path as a convention.
# tempPaletteFile
Type:
string
Default:
- css:
'styles/palette.css'
- sass:
'styles/palette.scss'
- less:
'styles/palette.less'
- stylus:
'styles/palette.styl'
Details:
File path of the generated palette temp file, relative to temp directory.
The default value depends on the preset option.
You should import the palette file via
'@vuepress/plugin-palette/palette'
alias, so you don't need to change this option in most cases.# userStyleFile
Type:
string
Default:
- css:
'.vuepress/styles/index.css'
- sass:
'.vuepress/styles/index.scss'
- less:
'.vuepress/styles/index.less'
- stylus:
'.vuepress/styles/index.styl'
Details:
File path of the user style file, relative to source directory.
The default value depends on the preset option.
The file is where users override default styles or add extra styles, and it's recommended to keep the default file path as a convention.
# tempStyleFile
Type:
string
Default:
- css:
'styles/index.css'
- sass:
'styles/index.scss'
- less:
'styles/index.less'
- stylus:
'styles/index.styl'
Details:
File path of the generated style temp file, relative to temp directory.
The default value depends on the preset option.
You should import the style file via
'@vuepress/plugin-palette/style'
alias, so you don't need to change this option in most cases.# importCode
`,27);function f(b,g){const p=n("NpmBadge"),a=n("ExternalLinkIcon");return o(),r("div",null,[d,l(p,{package:"@vuepress/plugin-palette"}),u,s("p",null,[e("The palette file is used for defining style variables, so it's likely to be imported at the beginning of your theme styles. For example, users can define "),s("a",y,[e("CSS variables"),l(a)]),e(", "),s("a",h,[e("SASS variables"),l(a)]),e(", "),s("a",D,[e("LESS variables"),l(a)]),e(" or "),s("a",v,[e("Stylus variables"),l(a)]),e(" in the palette, and then you can use those variables in your theme styles.")]),m])}const x=i(c,[["render",f],["__file","palette.html.vue"]]);export{x as default}; diff --git a/assets/palette.html-mci2X1xJ.js b/assets/palette.html-mci2X1xJ.js new file mode 100644 index 000000000..5d8f1755b --- /dev/null +++ b/assets/palette.html-mci2X1xJ.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5fd3efae","path":"/zh/reference/plugin/palette.html","title":"palette","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"调色板和样式","slug":"调色板和样式","link":"#调色板和样式","children":[]},{"level":2,"title":"使用","slug":"使用","link":"#使用","children":[{"level":3,"title":"使用调色板","slug":"使用调色板","link":"#使用调色板","children":[]},{"level":3,"title":"使用样式","slug":"使用样式","link":"#使用样式","children":[]}]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"preset","slug":"preset","link":"#preset","children":[]},{"level":3,"title":"userPaletteFile","slug":"userpalettefile","link":"#userpalettefile","children":[]},{"level":3,"title":"tempPaletteFile","slug":"temppalettefile","link":"#temppalettefile","children":[]},{"level":3,"title":"userStyleFile","slug":"userstylefile","link":"#userstylefile","children":[]},{"level":3,"title":"tempStyleFile","slug":"tempstylefile","link":"#tempstylefile","children":[]},{"level":3,"title":"importCode","slug":"importcode","link":"#importcode","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/palette.md"}');export{e as data}; diff --git a/assets/palette.html-svIiBuAj.js b/assets/palette.html-svIiBuAj.js new file mode 100644 index 000000000..d03c5c4b9 --- /dev/null +++ b/assets/palette.html-svIiBuAj.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-37c5e106","path":"/reference/plugin/palette.html","title":"palette","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Palette and Style","slug":"palette-and-style","link":"#palette-and-style","children":[]},{"level":2,"title":"Usage","slug":"usage-1","link":"#usage-1","children":[{"level":3,"title":"Usage of Palette","slug":"usage-of-palette","link":"#usage-of-palette","children":[]},{"level":3,"title":"Usage of Style","slug":"usage-of-style","link":"#usage-of-style","children":[]}]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"preset","slug":"preset","link":"#preset","children":[]},{"level":3,"title":"userPaletteFile","slug":"userpalettefile","link":"#userpalettefile","children":[]},{"level":3,"title":"tempPaletteFile","slug":"temppalettefile","link":"#temppalettefile","children":[]},{"level":3,"title":"userStyleFile","slug":"userstylefile","link":"#userstylefile","children":[]},{"level":3,"title":"tempStyleFile","slug":"tempstylefile","link":"#tempstylefile","children":[]},{"level":3,"title":"importCode","slug":"importcode","link":"#importcode","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/palette.md"}');export{e as data}; diff --git a/assets/passing-data-to-client-code.html-66UgnX14.js b/assets/passing-data-to-client-code.html-66UgnX14.js new file mode 100644 index 000000000..dfc4b6bf7 --- /dev/null +++ b/assets/passing-data-to-client-code.html-66UgnX14.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-10b13bae","path":"/zh/advanced/cookbook/passing-data-to-client-code.html","title":"向客户端代码传递数据","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用 define Hook","slug":"使用-define-hook","link":"#使用-define-hook","children":[]},{"level":2,"title":"写入并加载临时文件","slug":"写入并加载临时文件","link":"#写入并加载临时文件","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/advanced/cookbook/passing-data-to-client-code.md"}');export{e as data}; diff --git a/assets/passing-data-to-client-code.html-7z7BFnaN.js b/assets/passing-data-to-client-code.html-7z7BFnaN.js new file mode 100644 index 000000000..d45641514 --- /dev/null +++ b/assets/passing-data-to-client-code.html-7z7BFnaN.js @@ -0,0 +1,26 @@ +import{_ as p,r as t,o as c,c as r,a as n,b as s,d as e,w as l,e as o}from"./app-eU2v8o1B.js";const i={},D=n("h1",{id:"passing-data-to-client-code",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#passing-data-to-client-code","aria-hidden":"true"},"#"),s(" Passing Data to Client Code")],-1),d=n("p",null,"As we know, VuePress plugin entries and theme entries are processed in Node side, but sometimes you might need to pass data to client side. For example, you want to generate different data when users use different options.",-1),y=n("h2",{id:"use-define-hook",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#use-define-hook","aria-hidden":"true"},"#"),s(" Use "),n("code",null,"define"),s(" Hook")],-1),u=o(`
Type:
(filePath: string) => string
Default:
- css:
(filePath) => \`@import '\${filePath}';\\n\`
- sass:
(filePath) => \`@forward 'file:///\${filePath}';\\n\`
- less:
(filePath) => \`@import '\${filePath}';\\n\`
- stylus:
(filePath) => \`@require '\${filePath}';\\n\`
Details:
Function to generate import code.
The default value depends on the preset option.
This option is used for generating tempPaletteFile and tempStyleFile, and you don't need to change this option in most cases.
First, define some constants in
define
hook:export default (options) => ({ + define: { + __FOO__: options.foo || 'str', + __OBJ__: { + bar: options.bar || 123, + }, + }, +}) +
Then use them in client code directly:
const foo = __FOO__ +const obj = __OBJ__ +
If you are using TypeScript in client code, you may need to declare the types of the global constants manually:
declare const __FOO__: string +declare const __OBJ__: { bar: number } +
# Write and Load Temp Files
If you need to achieve some more complex features, you can write temp files and load them dynamically in client code.
`,8),C=n("code",null,"foo.js",-1),m=o(`export default (options) => ({ + async onPrepared(app) { + // write temp file + await app.writeTemp( + 'foo.js', + \`export const foo = \${JSON.stringify(options.foo)}\`, + ) + }, +}) +
Then, load the temp file via
@temp
alias in client code:import { foo } from '@temp/foo' +
If you are using TypeScript in client code, you may need to declare the type of the temp module manually:
`,5);function v(b,h){const a=t("RouterLink");return c(),r("div",null,[D,d,y,n("p",null,[s("Plugin API provides a "),e(a,{to:"/reference/plugin-api.html#define"},{default:l(()=>[s("define")]),_:1}),s(" hook to define global constants for client code. You can make use of it to pass data to client.")]),u,n("p",null,[s("First, write a temp file "),C,s(", which will be generated in the "),e(a,{to:"/reference/config.html#temp"},{default:l(()=>[s("temp")]),_:1}),s(" directory:")]),m])}const _=p(i,[["render",v],["__file","passing-data-to-client-code.html.vue"]]);export{_ as default}; diff --git a/assets/passing-data-to-client-code.html-N0mtoojl.js b/assets/passing-data-to-client-code.html-N0mtoojl.js new file mode 100644 index 000000000..5b2192f8c --- /dev/null +++ b/assets/passing-data-to-client-code.html-N0mtoojl.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3bc3633f","path":"/advanced/cookbook/passing-data-to-client-code.html","title":"Passing Data to Client Code","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Use define Hook","slug":"use-define-hook","link":"#use-define-hook","children":[]},{"level":2,"title":"Write and Load Temp Files","slug":"write-and-load-temp-files","link":"#write-and-load-temp-files","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"advanced/cookbook/passing-data-to-client-code.md"}');export{e as data}; diff --git a/assets/passing-data-to-client-code.html-f-CVV22Z.js b/assets/passing-data-to-client-code.html-f-CVV22Z.js new file mode 100644 index 000000000..8d00ef8dc --- /dev/null +++ b/assets/passing-data-to-client-code.html-f-CVV22Z.js @@ -0,0 +1,26 @@ +import{_ as p,r as c,o as r,c as t,a as n,b as s,d as l,w as e,e as o}from"./app-eU2v8o1B.js";const D={},i=n("h1",{id:"向客户端代码传递数据",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#向客户端代码传递数据","aria-hidden":"true"},"#"),s(" 向客户端代码传递数据")],-1),d=n("p",null,"我们知道,VuePress 插件入口和主题入口是在 Node 端处理的,但有时候你可能需要向客户端动态传递数据。例如,你希望在用户传入不同的选项时生成不同的数据。",-1),y=n("h2",{id:"使用-define-hook",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#使用-define-hook","aria-hidden":"true"},"#"),s(" 使用 "),n("code",null,"define"),s(" Hook")],-1),C=o(`declare module '@temp/foo' { + export const foo: string +} +
首先,通过
define
Hook 定义一些常量:export default (options) => ({ + define: { + __FOO__: options.foo || 'str', + __OBJ__: { + bar: options.bar || 123, + }, + }, +}) +
然后,在客户端代码中直接使用它们:
const foo = __FOO__ +const obj = __OBJ__ +
如果你在客户端代码中使用 TypeScript ,你可能需要手动声明这些全局常量的类型:
declare const __FOO__: string +declare const __OBJ__: { bar: number } +
# 写入并加载临时文件
如果你需要实现一些更复杂的功能,你可以写入临时文件,并在客户端代码中动态加载它们。
`,8),u=n("code",null,"foo.js",-1),v=o(`export default (options) => ({ + async onPrepared(app) { + // 写入临时文件 + await app.writeTemp( + 'foo.js', + \`export const foo = \${JSON.stringify(options.foo)}\`, + ) + }, +}) +
然后,在客户端代码中通过
@temp
别名来加载临时文件:import { foo } from '@temp/foo' +
如果你在客户端代码中使用 TypeScript ,你可能需要手动声明这些临时模块的类型:
`,5);function m(b,_){const a=c("RouterLink");return r(),t("div",null,[i,d,y,n("p",null,[s("插件 API 提供了一个 "),l(a,{to:"/zh/reference/plugin-api.html#define"},{default:e(()=>[s("define")]),_:1}),s(" Hook 来定义客户端代码中的全局常量。你可以利用它来向客户端传递数据。")]),C,n("p",null,[s("首先,写入一个名为 "),u,s(" 的临时文件,它将会生成在 "),l(a,{to:"/zh/reference/config.html#temp"},{default:e(()=>[s("temp")]),_:1}),s(" 目录中:")]),v])}const h=p(D,[["render",m],["__file","passing-data-to-client-code.html.vue"]]);export{h as default}; diff --git a/assets/plugin-api.html-XOYlxJHp.js b/assets/plugin-api.html-XOYlxJHp.js new file mode 100644 index 000000000..8ea4516b8 --- /dev/null +++ b/assets/plugin-api.html-XOYlxJHp.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-51569e88","path":"/reference/plugin-api.html","title":"Plugin API","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Overview","slug":"overview","link":"#overview","children":[]},{"level":2,"title":"Basic Options","slug":"basic-options","link":"#basic-options","children":[{"level":3,"title":"name","slug":"name","link":"#name","children":[]},{"level":3,"title":"multiple","slug":"multiple","link":"#multiple","children":[]}]},{"level":2,"title":"Development Hooks","slug":"development-hooks","link":"#development-hooks","children":[{"level":3,"title":"alias","slug":"alias","link":"#alias","children":[]},{"level":3,"title":"clientConfigFile","slug":"clientconfigfile","link":"#clientconfigfile","children":[]},{"level":3,"title":"define","slug":"define","link":"#define","children":[]},{"level":3,"title":"extendsBundlerOptions","slug":"extendsbundleroptions","link":"#extendsbundleroptions","children":[]},{"level":3,"title":"extendsMarkdownOptions","slug":"extendsmarkdownoptions","link":"#extendsmarkdownoptions","children":[]},{"level":3,"title":"extendsMarkdown","slug":"extendsmarkdown","link":"#extendsmarkdown","children":[]},{"level":3,"title":"extendsPageOptions","slug":"extendspageoptions","link":"#extendspageoptions","children":[]},{"level":3,"title":"extendsPage","slug":"extendspage","link":"#extendspage","children":[]}]},{"level":2,"title":"Lifecycle Hooks","slug":"lifecycle-hooks","link":"#lifecycle-hooks","children":[{"level":3,"title":"onInitialized","slug":"oninitialized","link":"#oninitialized","children":[]},{"level":3,"title":"onPrepared","slug":"onprepared","link":"#onprepared","children":[]},{"level":3,"title":"onWatched","slug":"onwatched","link":"#onwatched","children":[]},{"level":3,"title":"onGenerated","slug":"ongenerated","link":"#ongenerated","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin-api.md"}');export{e as data}; diff --git a/assets/plugin-api.html-c9sfNuSA.js b/assets/plugin-api.html-c9sfNuSA.js new file mode 100644 index 000000000..7fc92b440 --- /dev/null +++ b/assets/plugin-api.html-c9sfNuSA.js @@ -0,0 +1,88 @@ +import{_ as r,r as t,o as c,c as D,d as a,a as s,b as n,w as e,e as p}from"./app-eU2v8o1B.js";const d={},y=s("h1",{id:"plugin-api",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#plugin-api","aria-hidden":"true"},"#"),n(" Plugin API")],-1),u={href:"https://www.npmjs.com/package/@vuepress/core",target:"_blank",rel:"noopener noreferrer"},C=p('declare module '@temp/foo' { + export const foo: string +} +
# Overview
Plugins should be used before initialization. The basic options will be handled once the plugin is used:
The following hooks will be processed when initializing app:
The following hooks will be processed when preparing files:
The following hooks will be processed in dev / build:
',9),h=p(`# Basic Options
# name
Type:
string
Details:
Name of the plugin.
It will be used for identifying plugins to avoid using a same plugin multiple times, so make sure to use a unique plugin name.
It should follow the naming convention:
- Non-scoped:
vuepress-plugin-foo
- Scoped:
@org/vuepress-plugin-foo
Also see:
# multiple
Type:
boolean
Default:
false
Details:
Declare whether the plugin can be used multiple times.
If set to
false
, when using plugins with the same name, the one used previously will be replaced by the one used later.If set to
true
, plugins with the same name could be used multiple times and won't be replaced.Also see:
# Development Hooks
# alias
Type:
Record<string, any> | ((app: App, isServer: boolean) => Record<string, any>)
Details:
Path aliases definition.
This hook accepts an object or a function that returns an object.
Example:
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + alias: { + '@alias': path.resolve(__dirname, './path/to/alias'), + }, +} +
# clientConfigFile
Type:
string | ((app: App) => string | Promise<string>)
Details:
Path of client config file.
This hook accepts an absolute file path, or a function that returns the path.
Example:
`,12),m=p(`import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + clientConfigFile: path.resolve(__dirname, './path/to/clientConfig.js'), +} +
# define
Type:
Record<string, any> | ((app: App, isServer: boolean) => Record<string, any>)
Details:
Define global constants replacements.
This hook accepts an object or a function that returns an object.
This can be useful for passing variables to client files. Note that the values will be automatically processed by
JSON.stringify()
.Example:
export default { + define: { + __GLOBAL_BOOLEAN__: true, + __GLOBAL_STRING__: 'foobar', + __GLOBAL_OBJECT__: { foo: 'bar' }, + }, +} +
# extendsBundlerOptions
`,5),v={href:"https://vuejs.org/api/application.html#app-config-compileroptions",target:"_blank",rel:"noopener noreferrer"},b=p(`
Type:
(options: BundlerOptions, app: App) => void | Promise<void>
Details:
Bundler options extension.
This hook accepts a function that will receive the bundler options.
This hook can be used for modifying bundler options.
You could determine which bundler the user is using by
app.options.bundler.name
.Example:
`,1),g=p(`export default { + extendsBundlerOptions: (bundlerOptions, app) => { + // extends options of @vuepress/bundler-vite + if (app.options.bundler.name === '@vuepress/bundler-vite') { + bundlerOptions.vuePluginOptions ??= {} + bundlerOptions.vuePluginOptions.template ??= {} + bundlerOptions.vuePluginOptions.template.compilerOptions ??= {} + const isCustomElement = + bundlerOptions.vuePluginOptions.template.compilerOptions.isCustomElement + bundlerOptions.vuePluginOptions.template.compilerOptions.isCustomElement = + (tag) => { + if (isCustomElement?.(tag)) return true + if (tag === 'my-custom-element') return true + } + } + + // extends options of @vuepress/bundler-webpack + if (app.options.bundler.name === '@vuepress/bundler-webpack') { + bundlerOptions.vue ??= {} + bundlerOptions.vue.compilerOptions ??= {} + const isCustomElement = bundlerOptions.vue.compilerOptions.isCustomElement + bundlerOptions.vue.compilerOptions.isCustomElement = (tag) => { + if (isCustomElement?.(tag)) return true + if (tag === 'my-custom-element') return true + } + } + }, +} +
# extendsMarkdownOptions
Type:
(options: MarkdownOptions, app: App) => void | Promise<void>
Details:
Markdown options extension.
This hook accepts a function that will receive the markdown options.
This hook can be used for modifying markdown options.
Example:
Modifying the default header levels that going to be extracted:
`,4),f=s("h3",{id:"extendsmarkdown",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#extendsmarkdown","aria-hidden":"true"},"#"),n(" extendsMarkdown")],-1),E=s("li",null,[s("p",null,[n("Type: "),s("code",null,"(md: Markdown, app: App) => void | Promiseexport default { + extendsMarkdownOptions: (markdownOptions, app) => { + if (markdownOptions.headers === false) return + markdownOptions.headers ??= {} + if (markdownOptions.headers.level) return + markdownOptions.headers.level = [2, 3, 4, 5, 6] + }, +} +
")])],-1),F=s("p",null,"Details:",-1),k=s("p",null,"Markdown enhancement.",-1),x=s("code",null,"Markdown",-1),_={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},w=s("p",null,"This hook can be used for using extra markdown-it plugins and implementing customizations.",-1),A=s("li",null,[s("p",null,"Example:")],-1),P=p(` export default { + extendsMarkdown: (md) => { + md.use(plugin1) + md.linkify.set({ fuzzyEmail: false }) + }, +} +
# extendsPageOptions
Type:
(options: PageOptions, app: App) => void | Promise<void>
Details:
Page options extension.
This hook accepts a function that will receive the options of
createPage
.This hook can be used for modifying page options
Example:
Set permalink pattern for pages in
_posts
directory:`,5),O=p(`export default { + extendsPageOptions: (pageOptions, app) => { + if (pageOptions.filePath?.startsWith(app.dir.source('_posts/'))) { + pageOptions.frontmatter = pageOptions.frontmatter ?? {} + pageOptions.frontmatter.permalinkPattern = '/:year/:month/:day/:slug.html' + } + }, +} +
# extendsPage
Type:
(page: Page, app: App) => void | Promise<void>
Details:
Page extension.
This hook accepts a function that will receive a
Page
instance.This hook can be used for adding extra properties or modifying current properties on
Page
object.Notice that changes to
page.data
andpage.routeMeta
can be used in client side code.Example:
export default { + extendsPage: (page) => { + page.foo = 'foo' + page.data.bar = 'bar' + }, +} +
In client component:
`,5),T=p('import { usePageData } from '@vuepress/client' + +export default { + setup() { + const page = usePageData() + console.log(page.value.bar) // bar + }, +} +
# Lifecycle Hooks
# onInitialized
Type:
(app: App) => void | Promise<void>
Details:
This hook will be invoked once VuePress app has been initialized.
# onPrepared
Type:
(app: App) => void | Promise<void>
Details:
This hook will be invoked once VuePress app has finished preparation.
# onWatched
Type:
(app: App, watchers: Closable[], restart: () => Promise<void>) => void | Promise<void>
Details:
This hook will be invoked once VuePress app has started dev-server and watched files change.
The
watchers
is an array of file watchers. When changing config file, the dev command will be restarted and those watchers will be closed. If you are adding new watchers in this hook, you should push your watchers to thewatchers
array, so that they can be closed correctly when restarting.The
restart
is a method to restart the dev command. When calling this method, thewatchers
array will be closed automatically.# onGenerated
',9);function B(I,N){const i=t("NpmBadge"),o=t("ExternalLinkIcon"),l=t("RouterLink");return c(),D("div",null,[y,a(i,{package:"@vuepress/core"}),s("p",null,[n("Plugin API is supported by "),s("a",u,[n("@vuepress/core"),a(o)]),n(" package. You could check out "),a(l,{to:"/reference/node-api.html"},{default:e(()=>[n("Node API")]),_:1}),n(" for how to use the VuePress app instance in plugin hooks.")]),C,s("blockquote",null,[s("p",null,[n("Check out "),a(l,{to:"/advanced/architecture.html#core-process-and-hooks"},{default:e(()=>[n("Advanced > Architecture > Core Process and Hooks")]),_:1}),n(" to understand the process better.")])]),h,s("ul",null,[s("li",null,[n("Also see: "),s("ul",null,[s("li",null,[a(l,{to:"/reference/client-api.html#defineclientconfig"},{default:e(()=>[n("Client API > defineClientConfig")]),_:1})]),s("li",null,[a(l,{to:"/advanced/cookbook/usage-of-client-config.html"},{default:e(()=>[n("Advanced > Cookbook > Usage of Client Config")]),_:1})])])])]),m,s("p",null,[n("Adding default "),s("a",v,[n("app.compilerOptions.isCustomElement"),a(o)]),n(" option:")]),b,s("ul",null,[s("li",null,[n("Also see: "),s("ul",null,[s("li",null,[a(l,{to:"/reference/bundler/vite.html"},{default:e(()=>[n("Bundlers > Vite")]),_:1})]),s("li",null,[a(l,{to:"/reference/bundler/webpack.html"},{default:e(()=>[n("Bundlers > Webpack")]),_:1})])])])]),g,s("ul",null,[s("li",null,[n("Also see: "),s("ul",null,[s("li",null,[a(l,{to:"/reference/config.html#markdown"},{default:e(()=>[n("Config > markdown")]),_:1})])])])]),f,s("ul",null,[E,s("li",null,[F,k,s("p",null,[n("This hook accepts a function that will receive an instance of "),x,n(" powered by "),s("a",_,[n("markdown-it"),a(o)]),n(" in its arguments.")]),w]),A]),P,s("ul",null,[s("li",null,[n("Also see: "),s("ul",null,[s("li",null,[a(l,{to:"/reference/node-api.html#createpage"},{default:e(()=>[n("Node API > Page > createPage")]),_:1})])])])]),O,s("ul",null,[s("li",null,[n("Also see: "),s("ul",null,[s("li",null,[a(l,{to:"/reference/client-api.html#usepagedata"},{default:e(()=>[n("Client API > usePageData")]),_:1})]),s("li",null,[a(l,{to:"/reference/node-api.html#data"},{default:e(()=>[n("Node API > Page Properties > data")]),_:1})]),s("li",null,[a(l,{to:"/reference/node-api.html#routemeta"},{default:e(()=>[n("Node API > Page Properties > routeMeta")]),_:1})])])])]),T])}const L=r(d,[["render",B],["__file","plugin-api.html.vue"]]);export{L as default}; diff --git a/assets/plugin-api.html-mxjJqHwg.js b/assets/plugin-api.html-mxjJqHwg.js new file mode 100644 index 000000000..3fc6bd0bc --- /dev/null +++ b/assets/plugin-api.html-mxjJqHwg.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5e9d516d","path":"/zh/reference/plugin-api.html","title":"插件 API","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"概览","slug":"概览","link":"#概览","children":[]},{"level":2,"title":"基础配置项","slug":"基础配置项","link":"#基础配置项","children":[{"level":3,"title":"name","slug":"name","link":"#name","children":[]},{"level":3,"title":"multiple","slug":"multiple","link":"#multiple","children":[]}]},{"level":2,"title":"开发 Hooks","slug":"开发-hooks","link":"#开发-hooks","children":[{"level":3,"title":"alias","slug":"alias","link":"#alias","children":[]},{"level":3,"title":"clientConfigFile","slug":"clientconfigfile","link":"#clientconfigfile","children":[]},{"level":3,"title":"define","slug":"define","link":"#define","children":[]},{"level":3,"title":"extendsBundlerOptions","slug":"extendsbundleroptions","link":"#extendsbundleroptions","children":[]},{"level":3,"title":"extendsMarkdownOptions","slug":"extendsmarkdownoptions","link":"#extendsmarkdownoptions","children":[]},{"level":3,"title":"extendsMarkdown","slug":"extendsmarkdown","link":"#extendsmarkdown","children":[]},{"level":3,"title":"extendsPageOptions","slug":"extendspageoptions","link":"#extendspageoptions","children":[]},{"level":3,"title":"extendsPage","slug":"extendspage","link":"#extendspage","children":[]}]},{"level":2,"title":"生命周期 Hooks","slug":"生命周期-hooks","link":"#生命周期-hooks","children":[{"level":3,"title":"onInitialized","slug":"oninitialized","link":"#oninitialized","children":[]},{"level":3,"title":"onPrepared","slug":"onprepared","link":"#onprepared","children":[]},{"level":3,"title":"onWatched","slug":"onwatched","link":"#onwatched","children":[]},{"level":3,"title":"onGenerated","slug":"ongenerated","link":"#ongenerated","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin-api.md"}');export{e as data}; diff --git a/assets/plugin-api.html-nvZZ9-9s.js b/assets/plugin-api.html-nvZZ9-9s.js new file mode 100644 index 000000000..315de6cd9 --- /dev/null +++ b/assets/plugin-api.html-nvZZ9-9s.js @@ -0,0 +1,88 @@ +import{_ as D,r,o as c,c as i,d as a,a as s,b as n,w as e,e as p}from"./app-eU2v8o1B.js";const d={},y=s("h1",{id:"插件-api",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#插件-api","aria-hidden":"true"},"#"),n(" 插件 API")],-1),C={href:"https://www.npmjs.com/package/@vuepress/core",target:"_blank",rel:"noopener noreferrer"},u=p('
Type:
(app: App) => void | Promise<void>
Details:
This hook will be invoked once VuePress app has generated static files.
# 概览
插件需要在初始化之前使用。基础配置项会在使用插件时立即被处理:
下列 Hooks 会在初始化 App 时处理:
下列 Hooks 会在准备文件时处理:
下列 Hooks 会在 dev / build 时处理:
',9),v=p(`# 基础配置项
# name
类型:
string
详情:
插件的名称。
它会被用来识别插件,以避免多次使用同一个插件,因此应确保你的插件名称是独一无二的。
它应遵从如下命名约定:
- 非 Scoped:
vuepress-plugin-foo
- Scoped:
@org/vuepress-plugin-foo
参考:
# multiple
类型:
boolean
默认值:
false
详情:
插件是否能够被多次使用。
如果设置为
false
,当有相同名称的插件被使用时,先使用的会被后使用的替换掉。如果设置为
true
,相同名称的插件可以被多次使用且不会被替换。参考:
# 开发 Hooks
# alias
类型:
Record<string, any> | ((app: App, isServer: boolean) => Record<string, any>)
详情:
定义路径别名。
该 Hook 接收一个对象,或者一个返回对象的函数。
示例:
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + alias: { + '@alias': path.resolve(__dirname, './path/to/alias'), + }, +} +
# clientConfigFile
类型:
string | ((app: App) => string | Promise<string>)
详情:
客户端配置文件路径。
该 Hook 接收文件绝对路径,或者一个返回路径的函数。
示例:
`,12),m=p(`import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + clientConfigFile: path.resolve(__dirname, './path/to/clientConfig.js'), +} +
# define
类型:
Record<string, any> | ((app: App, isServer: boolean) => Record<string, any>)
详情:
定义全局常量。
该 Hook 接收一个对象,或者一个返回对象的函数。
它可以被用于向客户端文件传递变量。注意这里的值都会自动被
JSON.stringify()
处理。示例:
export default { + define: { + __GLOBAL_BOOLEAN__: true, + __GLOBAL_STRING__: 'foobar', + __GLOBAL_OBJECT__: { foo: 'bar' }, + }, +} +
# extendsBundlerOptions
`,5),h={href:"https://vuejs.org/api/application.html#app-config-compileroptions",target:"_blank",rel:"noopener noreferrer"},b=p(`
类型:
(options: BundlerOptions, app: App) => void | Promise<void>
详情:
Bundler 配置项扩展。
该 Hook 接收一个函数,在参数中会收到 Bundler 配置项。
该 Hook 可以用于修改 Bundler 配置项。
你可以通过
app.options.bundler.name
判断用户当前使用的 Bundler。示例:
`,1),E=p(`export default { + extendsBundlerOptions: (bundlerOptions, app) => { + // 修改 @vuepress/bundler-vite 的配置项 + if (app.options.bundler.name === '@vuepress/bundler-vite') { + bundlerOptions.vuePluginOptions ??= {} + bundlerOptions.vuePluginOptions.template ??= {} + bundlerOptions.vuePluginOptions.template.compilerOptions ??= {} + const isCustomElement = + bundlerOptions.vuePluginOptions.template.compilerOptions.isCustomElement + bundlerOptions.vuePluginOptions.template.compilerOptions.isCustomElement = + (tag) => { + if (isCustomElement?.(tag)) return true + if (tag === 'my-custom-element') return true + } + } + + // 修改 @vuepress/bundler-webpack 的配置项 + if (app.options.bundler.name === '@vuepress/bundler-webpack') { + bundlerOptions.vue ??= {} + bundlerOptions.vue.compilerOptions ??= {} + const isCustomElement = bundlerOptions.vue.compilerOptions.isCustomElement + bundlerOptions.vue.compilerOptions.isCustomElement = (tag) => { + if (isCustomElement?.(tag)) return true + if (tag === 'my-custom-element') return true + } + } + }, +} +
# extendsMarkdownOptions
类型:
(options: MarkdownOptions, app: App) => void | Promise<void>
详情:
Markdown 配置项扩展。
该 Hook 接收一个函数,在参数中会收到 Markdown 配置项。
该 Hook 可以用于修改 Markdown 配置项。
示例:
修改默认提取的子标题层级:
`,4),g=s("h3",{id:"extendsmarkdown",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#extendsmarkdown","aria-hidden":"true"},"#"),n(" extendsMarkdown")],-1),F=s("li",null,[s("p",null,[n("类型: "),s("code",null,"(md: Markdown, app: App) => void | Promiseexport default { + extendsMarkdownOptions: (markdownOptions, app) => { + if (markdownOptions.headers === false) return + markdownOptions.headers ??= {} + if (markdownOptions.headers.level) return + markdownOptions.headers.level = [2, 3, 4, 5, 6] + }, +} +
")])],-1),f=s("p",null,"详情:",-1),k=s("p",null,"Markdown 增强。",-1),_={href:"https://github.com/markdown-it/markdown-it",target:"_blank",rel:"noopener noreferrer"},x=s("code",null,"Markdown",-1),A=s("p",null,"该 Hook 可以用来添加额外的 markdown-it 插件、应用额外的自定义功能。",-1),P=s("li",null,[s("p",null,"示例:")],-1),O=p(` export default { + extendsMarkdown: (md) => { + md.use(plugin1) + md.linkify.set({ fuzzyEmail: false }) + }, +} +
# extendsPageOptions
类型:
(options: PageOptions, app: App) => void | Promise<void>
详情:
页面配置项扩展。
该 Hook 接收一个函数,在参数中会收到
createPage
传入的配置项。该 Hook 可以用于修改页面配置项。
示例:
为
_posts
目录下的页面设置永久链接 Pattern :`,5),w=p(`export default { + extendsPageOptions: (pageOptions, app) => { + if (pageOptions.filePath?.startsWith(app.dir.source('_posts/'))) { + pageOptions.frontmatter = pageOptions.frontmatter ?? {} + pageOptions.frontmatter.permalinkPattern = '/:year/:month/:day/:slug.html' + } + }, +} +
# extendsPage
类型:
(page: Page, app: App) => void | Promise<void>
详情:
页面扩展。
该 Hook 接收一个函数,在参数中会收到一个
Page
实例。该 Hook 可以用来在 Page 对象上添加额外的属性,或修改现有的属性等。
值得一提的是,针对
page.data
和page.routeMeta
的改动可以在客户端代码中使用。示例:
export default { + extendsPage: (page) => { + page.foo = 'foo' + page.data.bar = 'bar' + }, +} +
在客户端组件中:
`,5),B=p('import { usePageData } from '@vuepress/client' + +export default { + setup() { + const page = usePageData() + console.log(page.value.bar) // bar + }, +} +
# 生命周期 Hooks
# onInitialized
类型:
(app: App) => void | Promise<void>
详情:
该 Hook 会在 VuePress App 初始化后被立即调用。
# onPrepared
类型:
(app: App) => void | Promise<void>
详情:
该 Hook 会在 VuePress App 完成文件准备后被立即调用。
# onWatched
类型:
(app: App, watchers: Closable[], restart: () => Promise<void>) => void | Promise<void>
详情:
该 Hook 会在 VuePress App 启动开发服务器并开始监听文件修改后被调用。
watchers
是一个文件监听器的数组。在修改配置文件导致重启 dev 命令时,这些监听器会被自动关闭。如果你在当前 Hook 中添加了新的监听器,你应该把它们也加入到这个数组中,确保在重启 dev 命令时它们能被正确关闭。
restart
方法用来重启 dev 命令。调用该方法时,watchers
数组中的监听器也会被自动关闭。# onGenerated
',9);function H(z,I){const t=r("NpmBadge"),o=r("ExternalLinkIcon"),l=r("RouterLink");return c(),i("div",null,[y,a(t,{package:"@vuepress/core"}),s("p",null,[n("插件 API 是由 "),s("a",C,[n("@vuepress/core"),a(o)]),n(" 包支持的。你可以查看 "),a(l,{to:"/zh/reference/node-api.html"},{default:e(()=>[n("Node API")]),_:1}),n(" 来了解如何使用插件 Hooks 中的 VuePress App 实例。")]),u,s("blockquote",null,[s("p",null,[n("查看 "),a(l,{to:"/zh/advanced/architecture.html#%E6%A0%B8%E5%BF%83%E6%B5%81%E7%A8%8B%E4%B8%8E-hooks"},{default:e(()=>[n("深入 > 架构 > 核心流程与 Hooks")]),_:1}),n(" 来更好地理解该流程。")])]),v,s("ul",null,[s("li",null,[n("参考: "),s("ul",null,[s("li",null,[a(l,{to:"/zh/reference/client-api.html#defineclientconfig"},{default:e(()=>[n("客户端 API > defineClientConfig")]),_:1})]),s("li",null,[a(l,{to:"/zh/advanced/cookbook/usage-of-client-config.html"},{default:e(()=>[n("深入 > Cookbook > 客户端配置的使用方法")]),_:1})])])])]),m,s("p",null,[n("添加默认的 "),s("a",h,[n("app.compilerOptions.isCustomElement"),a(o)]),n(" 配置:")]),b,s("ul",null,[s("li",null,[n("参考: "),s("ul",null,[s("li",null,[a(l,{to:"/zh/reference/bundler/vite.html"},{default:e(()=>[n("打包工具 > Vite")]),_:1})]),s("li",null,[a(l,{to:"/zh/reference/bundler/webpack.html"},{default:e(()=>[n("打包工具 > Webpack")]),_:1})])])])]),E,s("ul",null,[s("li",null,[n("参考: "),s("ul",null,[s("li",null,[a(l,{to:"/zh/reference/config.html#markdown"},{default:e(()=>[n("配置 > markdown")]),_:1})])])])]),g,s("ul",null,[F,s("li",null,[f,k,s("p",null,[n("该 Hook 接收一个函数,在参数中会收到一个由 "),s("a",_,[n("markdown-it"),a(o)]),n(" 提供的 "),x,n(" 实例。")]),A]),P]),O,s("ul",null,[s("li",null,[n("参考: "),s("ul",null,[s("li",null,[a(l,{to:"/zh/reference/node-api.html#createPage"},{default:e(()=>[n("Node API > Page > createPage")]),_:1})])])])]),w,s("ul",null,[s("li",null,[n("参考: "),s("ul",null,[s("li",null,[a(l,{to:"/zh/reference/client-api.html#usepagedata"},{default:e(()=>[n("客户端 API > usePageData")]),_:1})]),s("li",null,[a(l,{to:"/zh/reference/node-api.html#data"},{default:e(()=>[n("Node API > Page 属性 > data")]),_:1})]),s("li",null,[a(l,{to:"/zh/reference/node-api.html#routemeta"},{default:e(()=>[n("Node API > Page 属性 > routeMeta")]),_:1})])])])]),B])}const N=D(d,[["render",H],["__file","plugin-api.html.vue"]]);export{N as default}; diff --git a/assets/plugin.html-1l5wit-Z.js b/assets/plugin.html-1l5wit-Z.js new file mode 100644 index 000000000..465ef7071 --- /dev/null +++ b/assets/plugin.html-1l5wit-Z.js @@ -0,0 +1,30 @@ +import{_ as t,r as p,o as c,c as r,a as n,b as s,d as a,w as e,e as o}from"./app-eU2v8o1B.js";const D={},d=n("h1",{id:"writing-a-plugin",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#writing-a-plugin","aria-hidden":"true"},"#"),s(" Writing a Plugin")],-1),u={class:"custom-container tip"},y=n("p",{class:"custom-container-title"},"TIP",-1),v=n("h2",{id:"create-a-plugin",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#create-a-plugin","aria-hidden":"true"},"#"),s(" Create a Plugin")],-1),h=n("em",null,"Plugin Object",-1),m=o(`
类型:
(app: App) => void | Promise<void>
详情:
该 Hook 会在 VuePress App 完成静态文件生成后被立即调用。
`,1),b=n("em",null,"Plugin Object",-1),g=n("em",null,"Plugin Function",-1),_=o(`const fooPlugin = { + name: 'vuepress-plugin-foo', + // ... +} +
const barPlugin = (app) => { + return { + name: 'vuepress-plugin-bar', + // ... + } +} +
A plugin usually needs to allow user options, so we typically provide users with a function to receive options, and returns a Plugin Object or a Plugin Function. Then your plugin should be converted like this:
const fooPlugin = (options) => { + return { + name: 'vuepress-plugin-foo', + // ... + } +} + +const barPlugin = (options) => { + return (app) => { + return { + name: 'vuepress-plugin-bar', + // ... + } + } +} +
# Publish to NPM
`,4),C={href:"https://docs.npmjs.com/cli/v8/configuring-npm/package-json",target:"_blank",rel:"noopener noreferrer"},f=o(``,1),E=n("code",null,"name",-1),k=n("code",null,"vuepress-plugin-xxx",-1),x=n("code",null,"@org/vuepress-plugin-xxx",-1),P=n("em",null,"Plugin Object",-1),w=n("li",null,[s("Set "),n("code",null,"keywords"),s(" to include "),n("code",null,"vuepress-plugin"),s(", so that users can search your plugin on NPM.")],-1);function A(F,j){const l=p("RouterLink"),i=p("ExternalLinkIcon");return c(),r("div",null,[d,n("div",u,[y,n("p",null,[s("Before reading this guide, you'd better learn the VuePress "),a(l,{to:"/advanced/architecture.html"},{default:e(()=>[s("architecture")]),_:1}),s(" first.")])]),v,n("p",null,[s("A plugin should be a plain JavaScript object that satisfies the "),a(l,{to:"/reference/plugin-api.html"},{default:e(()=>[s("Plugin API")]),_:1}),s(", which is called a "),h,s(":")]),m,n("p",null,[s("A plugin could also be a function that receives the "),a(l,{to:"/reference/node-api.html#app"},{default:e(()=>[s("app instance")]),_:1}),s(" as the param and returns a "),b,s(", which is called a "),g,s(":")]),_,n("p",null,[s("After creating a plugin, you should follow some conventions in the "),n("a",C,[s("package.json"),a(i)]),s(" file before publishing it to NPM:")]),f,n("ul",null,[n("li",null,[s("Set "),E,s(" to follow the naming convention, i.e. "),k,s(" or "),x,s(", which should be consistent with the "),a(l,{to:"/reference/plugin-api.html#name"},{default:e(()=>[s("name")]),_:1}),s(" field of the "),P,s(".")]),w])])}const N=t(D,[["render",A],["__file","plugin.html.vue"]]);export{N as default}; diff --git a/assets/plugin.html-69wz8wnr.js b/assets/plugin.html-69wz8wnr.js new file mode 100644 index 000000000..03a5bf971 --- /dev/null +++ b/assets/plugin.html-69wz8wnr.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-301ab792","path":"/advanced/plugin.html","title":"Writing a Plugin","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Create a Plugin","slug":"create-a-plugin","link":"#create-a-plugin","children":[]},{"level":2,"title":"Publish to NPM","slug":"publish-to-npm","link":"#publish-to-npm","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"advanced/plugin.md"}');export{e as data}; diff --git a/assets/plugin.html-GL3IPvy_.js b/assets/plugin.html-GL3IPvy_.js new file mode 100644 index 000000000..8d0e859fb --- /dev/null +++ b/assets/plugin.html-GL3IPvy_.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-9043126a","path":"/zh/guide/plugin.html","title":"插件","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"社区插件","slug":"社区插件","link":"#社区插件","children":[]},{"level":2,"title":"本地插件","slug":"本地插件","link":"#本地插件","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/guide/plugin.md"}');export{e as data}; diff --git a/assets/plugin.html-JBB6sUWc.js b/assets/plugin.html-JBB6sUWc.js new file mode 100644 index 000000000..92101e2bc --- /dev/null +++ b/assets/plugin.html-JBB6sUWc.js @@ -0,0 +1,15 @@ +import{_ as p,r as t,o as c,c as r,a as s,b as n,d as e,w as a,e as i}from"./app-eU2v8o1B.js";const u={},d=s("h1",{id:"plugin",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#plugin","aria-hidden":"true"},"#"),n(" Plugin")],-1),g=s("h2",{id:"community-plugin",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#community-plugin","aria-hidden":"true"},"#"),n(" Community Plugin")],-1),D={href:"https://www.npmjs.com/search?q=keywords:vuepress-plugin",target:"_blank",rel:"noopener noreferrer"},m={href:"https://www.npmjs.com/search?q=%40vuepress%20keywords%3Aplugin",target:"_blank",rel:"noopener noreferrer"},h=i(`{ + "name": "vuepress-plugin-foo", + "keywords": ["vuepress-plugin"] +} +
`,1),y={class:"custom-container tip"},f=s("p",{class:"custom-container-title"},"TIP",-1),v=s("p",null,"Most plugins can only be used once. If the same plugin is used multiple times, only the last one will take effect.",-1),_=s("h2",{id:"local-plugin",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#local-plugin","aria-hidden":"true"},"#"),n(" Local Plugin")],-1),C=s("p",null,"If you want to use your own plugin but don't want to publish it, you can create a local plugin.",-1),b=i(`import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics' + +export default { + plugins: [ + googleAnalyticsPlugin({ + id: 'G-XXXXXXXXXX', + }), + ], +} +
But if you have too many things to do in your config file, you can consider to extract them into separate plugins, and use them in your config file:
`,2);function w(k,x){const l=t("RouterLink"),o=t("ExternalLinkIcon");return c(),r("div",null,[d,s("p",null,[n("With the help of "),e(l,{to:"/reference/plugin-api.html"},{default:a(()=>[n("Plugin API")]),_:1}),n(", VuePress plugin can provide different features for you.")]),g,s("p",null,[n("Community users have created lots of plugins and published them to "),s("a",D,[n("NPM"),e(o)]),n(". VuePress team also maintains some official plugins under the "),s("a",m,[n("@vuepress"),e(o)]),n(" scope. You should check the plugin's own documentation for detailed guide.")]),s("p",null,[n("In general, you need to import the plugin and use it in your config file via the "),e(l,{to:"/reference/config.html#plugins"},{default:a(()=>[n("plugins")]),_:1}),n(" option. For example, use the "),e(l,{to:"/reference/plugin/google-analytics.html"},{default:a(()=>[n("@vuepress/plugin-google-analytics")]),_:1}),n(" to integrate Google Analytics:")]),h,s("div",y,[f,v,s("p",null,[n("However, some plugins can be used multiple times (e.g. "),e(l,{to:"/reference/plugin/container.html"},{default:a(()=>[n("@vuepress/plugin-container")]),_:1}),n("), and you should check the documentation of the plugin itself for detailed guide.")])]),_,C,s("p",null,[n("It is recommended to use the "),e(l,{to:"/guide/configuration.html#config-file"},{default:a(()=>[n("Config File")]),_:1}),n(" directly as a plugin, because "),e(l,{to:"/reference/config.html#plugin-api"},{default:a(()=>[n("almost all of the Plugin APIs are available")]),_:1}),n(", which would be more convenient in most cases.")]),b,s("p",null,[n("You can refer to "),e(l,{to:"/advanced/plugin.html"},{default:a(()=>[n("Advanced > Writing a Plugin")]),_:1}),n(" for how to write your own plugin.")])])}const P=p(u,[["render",w],["__file","plugin.html.vue"]]);export{P as default}; diff --git a/assets/plugin.html-LFMVvu2B.js b/assets/plugin.html-LFMVvu2B.js new file mode 100644 index 000000000..eb806e3e5 --- /dev/null +++ b/assets/plugin.html-LFMVvu2B.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-574aac41","path":"/zh/advanced/plugin.html","title":"开发插件","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"创建一个插件","slug":"创建一个插件","link":"#创建一个插件","children":[]},{"level":2,"title":"发布到 NPM","slug":"发布到-npm","link":"#发布到-npm","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/advanced/plugin.md"}');export{e as data}; diff --git a/assets/plugin.html-PD1th8Qg.js b/assets/plugin.html-PD1th8Qg.js new file mode 100644 index 000000000..c302d9b1c --- /dev/null +++ b/assets/plugin.html-PD1th8Qg.js @@ -0,0 +1,30 @@ +import{_ as r,r as o,o as i,c as t,a as n,b as s,d as a,w as e,e as p}from"./app-eU2v8o1B.js";const D={},d=n("h1",{id:"开发插件",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#开发插件","aria-hidden":"true"},"#"),s(" 开发插件")],-1),u={class:"custom-container tip"},y=n("p",{class:"custom-container-title"},"提示",-1),v=n("h2",{id:"创建一个插件",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#创建一个插件","aria-hidden":"true"},"#"),s(" 创建一个插件")],-1),m=n("em",null,"插件对象",-1),h=p(`import myPlugin from './path/to/my-plugin.js' + +export default { + plugins: [myPlugin()], +} +
`,1),b=n("em",null,"插件对象",-1),_=n("em",null,"插件函数",-1),C=p(`const fooPlugin = { + name: 'vuepress-plugin-foo', + // ... +} +
const barPlugin = (app) => { + return { + name: 'vuepress-plugin-bar', + // ... + } +} +
插件通常需要允许用户传入配置,因此我们一般都会提供给用户一个函数来接收配置,然后将 插件对象 或者 插件函数 作为返回值。于是,你的插件应该转换成这样的形式:
const fooPlugin = (options) => { + return { + name: 'vuepress-plugin-foo', + // ... + } +} + +const barPlugin = (options) => { + return (app) => { + return { + name: 'vuepress-plugin-bar', + // ... + } + } +} +
# 发布到 NPM
`,4),g={href:"https://docs.npmjs.com/cli/v8/configuring-npm/package-json",target:"_blank",rel:"noopener noreferrer"},E=p(``,1),f=n("code",null,"name",-1),x=n("code",null,"vuepress-plugin-xxx",-1),k=n("code",null,"@org/vuepress-plugin-xxx",-1),F=n("em",null,"插件对象",-1),A=n("li",null,[s("在 "),n("code",null,"keywords"),s(" 中包含 "),n("code",null,"vuepress-plugin"),s(" ,这样用户可以在 NPM 上搜索到你的插件。")],-1);function P(q,N){const l=o("RouterLink"),c=o("ExternalLinkIcon");return i(),t("div",null,[d,n("div",u,[y,n("p",null,[s("在阅读该指南之前,你最好先了解一下 VuePress 的 "),a(l,{to:"/zh/advanced/architecture.html"},{default:e(()=>[s("架构")]),_:1}),s(" 。")])]),v,n("p",null,[s("插件是一个符合 "),a(l,{to:"/zh/reference/plugin-api.html"},{default:e(()=>[s("插件 API")]),_:1}),s(" 的普通 JavaScript 对象,称之为 "),m,s(" :")]),h,n("p",null,[s("插件还可以是一个接收 "),a(l,{to:"/zh/reference/node-api.html#app"},{default:e(()=>[s("App 实例")]),_:1}),s(" 作为参数,且返回值为 "),b,s(" 的函数,称之为 "),_,s(" :")]),C,n("p",null,[s("在创建了插件之后,你需要在 "),n("a",g,[s("package.json"),a(c)]),s(" 文件中遵循一定的约定,然后再将其发布到 NPM 上:")]),E,n("ul",null,[n("li",null,[s("将 "),f,s(" 按照约定命名,即 "),x,s(" 或 "),k,s(" ,它应该和 "),F,s(" 的 "),a(l,{to:"/zh/reference/plugin-api.html#name"},{default:e(()=>[s("name")]),_:1}),s(" 字段保持一致。")]),A])])}const V=r(D,[["render",P],["__file","plugin.html.vue"]]);export{V as default}; diff --git a/assets/plugin.html-Z76xkPoN.js b/assets/plugin.html-Z76xkPoN.js new file mode 100644 index 000000000..9f1964cf3 --- /dev/null +++ b/assets/plugin.html-Z76xkPoN.js @@ -0,0 +1 @@ +const l=JSON.parse('{"key":"v-1d14d5cc","path":"/guide/plugin.html","title":"Plugin","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Community Plugin","slug":"community-plugin","link":"#community-plugin","children":[]},{"level":2,"title":"Local Plugin","slug":"local-plugin","link":"#local-plugin","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"guide/plugin.md"}');export{l as data}; diff --git a/assets/plugin.html-kN-P6k-m.js b/assets/plugin.html-kN-P6k-m.js new file mode 100644 index 000000000..2f54ddeae --- /dev/null +++ b/assets/plugin.html-kN-P6k-m.js @@ -0,0 +1,15 @@ +import{_ as r,r as p,o as i,c,a as n,b as s,d as e,w as l,e as t}from"./app-eU2v8o1B.js";const d={},u=n("h1",{id:"插件",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#插件","aria-hidden":"true"},"#"),s(" 插件")],-1),D=n("h2",{id:"社区插件",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#社区插件","aria-hidden":"true"},"#"),s(" 社区插件")],-1),y={href:"https://www.npmjs.com/search?q=keywords:vuepress-plugin",target:"_blank",rel:"noopener noreferrer"},h={href:"https://www.npmjs.com/search?q=%40vuepress%20keywords%3Aplugin",target:"_blank",rel:"noopener noreferrer"},m=t(`{ + "name": "vuepress-plugin-foo", + "keywords": ["vuepress-plugin"] +} +
`,1),v={class:"custom-container tip"},_=n("p",{class:"custom-container-title"},"提示",-1),g=n("p",null,"大部分插件只能使用一次,如果同一个插件被多次使用,那么只有最后一次会生效。",-1),C=n("h2",{id:"本地插件",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#本地插件","aria-hidden":"true"},"#"),s(" 本地插件")],-1),f=n("p",null,"如果你想要使用自己的插件,但是又不想发布它,你可以创建一个本地插件。",-1),b=t(`import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics' + +export default { + plugins: [ + googleAnalyticsPlugin({ + id: 'G-XXXXXXXXXX', + }), + ], +} +
但是如果你在配置文件中要做的事情太多了,你可以考虑将它们提取到单独的插件中,然后在你的配置文件中使用它们:
`,2);function E(k,x){const a=p("RouterLink"),o=p("ExternalLinkIcon");return i(),c("div",null,[u,n("p",null,[s("借助于 "),e(a,{to:"/zh/reference/plugin-api.html"},{default:l(()=>[s("插件 API")]),_:1}),s(" , VuePress 插件可以为你提供各种不同的功能。")]),D,n("p",null,[s("社区用户创建了很多插件,并将它们发布到了 "),n("a",y,[s("NPM"),e(o)]),s(" 上。 VuePress 团队也在 "),n("a",h,[s("@vuepress"),e(o)]),s(" Scope 下维护了一些官方插件。查看插件本身的文档可以获取更详细的指引。")]),n("p",null,[s("一般而言,你需要导入插件并通过配置文件的 "),e(a,{to:"/zh/reference/config.html#plugins"},{default:l(()=>[s("plugins")]),_:1}),s(" 配置项来使用它。举例来说,你可以使用 "),e(a,{to:"/zh/reference/plugin/google-analytics.html"},{default:l(()=>[s("@vuepress/plugin-google-analytics")]),_:1}),s(" 来使用 Google Analytics :")]),m,n("div",v,[_,g,n("p",null,[s("然而,部分插件是可以被多次使用的(例如 "),e(a,{to:"/zh/reference/plugin/container.html"},{default:l(()=>[s("@vuepress/plugin-container")]),_:1}),s("),你应该查看插件本身的文档来获取详细指引。")])]),C,f,n("p",null,[s("我们推荐你直接将 "),e(a,{to:"/zh/guide/configuration.html#%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"},{default:l(()=>[s("配置文件")]),_:1}),s(" 作为插件使用,因为 "),e(a,{to:"/zh/reference/config.html#%E6%8F%92%E4%BB%B6-api"},{default:l(()=>[s("几乎所有的插件 API 都可以在配置文件中使用")]),_:1}),s(",这在绝大多数场景下都更为方便。")]),b,n("p",null,[s("前往 "),e(a,{to:"/zh/advanced/plugin.html"},{default:l(()=>[s("深入 > 开发插件")]),_:1}),s(" 学习如何开发你自己的插件。")])])}const w=r(d,[["render",E],["__file","plugin.html.vue"]]);export{w as default}; diff --git a/assets/prismjs.html-0ulnQYWI.js b/assets/prismjs.html-0ulnQYWI.js new file mode 100644 index 000000000..e1852ec20 --- /dev/null +++ b/assets/prismjs.html-0ulnQYWI.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-35ebfb0e","path":"/reference/plugin/prismjs.html","title":"prismjs","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"preloadLanguages","slug":"preloadlanguages","link":"#preloadlanguages","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/prismjs.md"}');export{e as data}; diff --git a/assets/prismjs.html-N5-uNoGW.js b/assets/prismjs.html-N5-uNoGW.js new file mode 100644 index 000000000..3811ad9c0 --- /dev/null +++ b/assets/prismjs.html-N5-uNoGW.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-9cba4982","path":"/zh/reference/plugin/prismjs.html","title":"prismjs","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"preloadLanguages","slug":"preloadlanguages","link":"#preloadlanguages","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/prismjs.md"}');export{e as data}; diff --git a/assets/prismjs.html-gemLzpIR.js b/assets/prismjs.html-gemLzpIR.js new file mode 100644 index 000000000..c90c85962 --- /dev/null +++ b/assets/prismjs.html-gemLzpIR.js @@ -0,0 +1,11 @@ +import{_ as p,r as l,o,c as i,d as a,a as s,b as n,e as c}from"./app-eU2v8o1B.js";const t={},d=s("h1",{id:"prismjs",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#prismjs","aria-hidden":"true"},"#"),n(" prismjs")],-1),u={href:"https://prismjs.com/",target:"_blank",rel:"noopener noreferrer"},D=c(`import myPlugin from './path/to/my-plugin.js' + +export default { + plugins: [myPlugin()], +} +
该插件已经集成到默认主题中。
需要注意的是,该插件仅会给代码块添加 HTML 标记,而不会添加样式。当你在一个自定义主题中使用它时,可能需要自己选择并引入 Prism.js 样式主题。
# 使用方法
npm i -D @vuepress/plugin-prismjs@next +
import { prismjsPlugin } from '@vuepress/plugin-prismjs' + +export default { + plugins: [ + prismjsPlugin({ + // 配置项 + }), + ], +} +
# 配置项
# preloadLanguages
`,7),m=s("li",null,[s("p",null,[n("类型: "),s("code",null,"string[]")])],-1),h=s("li",null,[s("p",null,[n("默认值: "),s("code",null,"['markdown', 'jsdoc', 'yaml']")])],-1),_=s("p",null,"详情:",-1),v=s("p",null,"需要预加载的语言。",-1),y=s("p",null,"默认情况下,语言会在解析 Markdown 文件时按需加载。",-1),b={href:"https://github.com/PrismJS/prism/issues/2716",target:"_blank",rel:"noopener noreferrer"};function g(C,f){const r=l("NpmBadge"),e=l("ExternalLinkIcon");return o(),i("div",null,[d,a(r,{package:"@vuepress/plugin-prismjs"}),s("p",null,[n("该插件使用 "),s("a",u,[n("Prism.js"),a(e)]),n(" 来为 Markdown 代码块启用代码高亮。")]),D,s("ul",null,[m,h,s("li",null,[_,v,y,s("p",null,[n("然而, Prism.js 在动态加载语言时可能会遇到 "),s("a",b,[n("一些潜在的问题"),a(e)]),n(" 。为了避免这些问题,你可以使用该配置项来预加载一些语言。")])])])])}const x=p(t,[["render",g],["__file","prismjs.html.vue"]]);export{x as default}; diff --git a/assets/prismjs.html-hnhxNt6P.js b/assets/prismjs.html-hnhxNt6P.js new file mode 100644 index 000000000..9bd6e2360 --- /dev/null +++ b/assets/prismjs.html-hnhxNt6P.js @@ -0,0 +1,11 @@ +import{_ as i,r as l,o as p,c as r,d as e,a as s,b as n,e as t}from"./app-eU2v8o1B.js";const c={},d=s("h1",{id:"prismjs",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#prismjs","aria-hidden":"true"},"#"),n(" prismjs")],-1),u={href:"https://prismjs.com/",target:"_blank",rel:"noopener noreferrer"},h=t(`This plugin has been integrated into the default theme.
Notice that this plugin would only tokenize the code fence without adding styles. When using it with a custom theme, you may need to choose and import Prism.js style theme yourself.
# Usage
npm i -D @vuepress/plugin-prismjs@next +
import { prismjsPlugin } from '@vuepress/plugin-prismjs' + +export default { + plugins: [ + prismjsPlugin({ + // options + }), + ], +} +
# Options
# preloadLanguages
`,7),m=s("li",null,[s("p",null,[n("Type: "),s("code",null,"string[]")])],-1),D=s("li",null,[s("p",null,[n("Default: "),s("code",null,"['markdown', 'jsdoc', 'yaml']")])],-1),g=s("p",null,"Details:",-1),y=s("p",null,"Languages to preload.",-1),v=s("p",null,"By default, languages will be loaded on demand when parsing markdown files.",-1),_={href:"https://github.com/PrismJS/prism/issues/2716",target:"_blank",rel:"noopener noreferrer"};function b(f,C){const o=l("NpmBadge"),a=l("ExternalLinkIcon");return p(),r("div",null,[d,e(o,{package:"@vuepress/plugin-prismjs"}),s("p",null,[n("This plugin will enable syntax highlighting for markdown code fence with "),s("a",u,[n("Prism.js"),e(a)]),n(".")]),h,s("ul",null,[m,D,s("li",null,[g,y,v,s("p",null,[n("However, Prism.js has "),s("a",_,[n("some potential issues"),e(a)]),n(" about loading languages dynamically. To avoid them, you can preload languages via this option.")])])])])}const x=i(c,[["render",b],["__file","prismjs.html.vue"]]);export{x as default}; diff --git a/assets/pwa-popup.html--uhGb_lp.js b/assets/pwa-popup.html--uhGb_lp.js new file mode 100644 index 000000000..41100d2ee --- /dev/null +++ b/assets/pwa-popup.html--uhGb_lp.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5f86289f","path":"/reference/plugin/pwa-popup.html","title":"pwa-popup","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"Styles","slug":"styles","link":"#styles","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/pwa-popup.md"}');export{e as data}; diff --git a/assets/pwa-popup.html-FEkQ6tW5.js b/assets/pwa-popup.html-FEkQ6tW5.js new file mode 100644 index 000000000..f0b02b6ca --- /dev/null +++ b/assets/pwa-popup.html-FEkQ6tW5.js @@ -0,0 +1,42 @@ +import{_ as i,r as p,o as r,c as t,d as a,a as s,b as n,w as e,e as o}from"./app-eU2v8o1B.js";const D={},d=s("h1",{id:"pwa-popup",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#pwa-popup","aria-hidden":"true"},"#"),n(" pwa-popup")],-1),u=s("p",null,"Provide a popup component for users to activate the new PWA service worker manually.",-1),y=s("code",null,"skipWaiting",-1),v=s("code",null,"true",-1),C=o(`When the new service worker is ready, a popup will appear in the right bottom of the page to ask users to activate the waiting service worker.
# Usage
npm i -D @vuepress/plugin-pwa-popup@next +
import { pwaPlugin } from '@vuepress/plugin-pwa' +import { pwaPopupPlugin } from '@vuepress/plugin-pwa-popup' + +export default { + plugins: [ + pwaPlugin(), + pwaPopupPlugin({ + // options + }), + ], +} +
# Options
# locales
Type:
Record<string, { message: string, buttonText: string }>
Details:
The messages of the popup in different locales.
If this option is not specified, it will fallback to default messages.
Example:
`,8),m=o(`export default { + plugins: [ + pwaPlugin(), + pwaPopupPlugin({ + locales: { + '/': { + message: 'New content is available.', + buttonText: 'Refresh', + }, + '/zh/': { + message: '发现新内容可用', + buttonText: '刷新', + }, + }, + }), + ], +} +
# Styles
You can customize the style of the popup via CSS variables:
`,3);function b(h,E){const c=p("NpmBadge"),l=p("RouterLink");return r(),t("div",null,[d,a(c,{package:"@vuepress/plugin-pwa-popup"}),u,s("p",null,[n("This plugin must be used together with "),a(l,{to:"/reference/plugin/pwa.html"},{default:e(()=>[n("pwa plugin")]),_:1}),n(", and the "),y,n(" option must not be set to "),v,n(".")]),C,s("ul",null,[s("li",null,[n("Also see: "),s("ul",null,[s("li",null,[a(l,{to:"/guide/i18n.html"},{default:e(()=>[n("Guide > I18n")]),_:1})])])])]),m])}const f=i(D,[["render",b],["__file","pwa-popup.html.vue"]]);export{f as default}; diff --git a/assets/pwa-popup.html-VMOi2wzE.js b/assets/pwa-popup.html-VMOi2wzE.js new file mode 100644 index 000000000..6c7cebcc4 --- /dev/null +++ b/assets/pwa-popup.html-VMOi2wzE.js @@ -0,0 +1,42 @@ +import{_ as r,r as p,o as i,c as D,d as a,a as s,b as n,w as e,e as o}from"./app-eU2v8o1B.js";const t={},d=s("h1",{id:"pwa-popup",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#pwa-popup","aria-hidden":"true"},"#"),n(" pwa-popup")],-1),y=s("p",null,"提供一个弹窗组件,允许用户手动刷新 PWA Service Worker 。",-1),u=s("code",null,"skipWaiting",-1),v=s("code",null,"true",-1),C=o(`:root { + --pwa-popup-z-index: 10; + + --pwa-popup-text-color: #2c3e50; + --pwa-popup-bg-color: #ffffff; + --pwa-popup-border-color: #3eaf7c; + --pwa-popup-shadow: 0 4px 16px var(--pwa-popup-border-color); + + --pwa-popup-btn-text-color: #ffffff; + --pwa-popup-btn-bg-color: #3eaf7c; + --pwa-popup-btn-hover-bg-color: #4abf8a; +} +
当新的 Service Worker 就绪时,会在页面右下角出现一个弹窗,询问用户是否需要激活处于 Waiting 状态的 Service Worker 。
# 使用方法
npm i -D @vuepress/plugin-pwa-popup@next +
import { pwaPlugin } from '@vuepress/plugin-pwa' +import { pwaPopupPlugin } from '@vuepress/plugin-pwa-popup' + +export default { + plugins: [ + pwaPlugin(), + pwaPopupPlugin({ + // 配置项 + }), + ], +} +
# 配置项
# locales
类型:
Record<string, { message: string, buttonText: string }>
详情:
弹窗在不同 locales 下的信息。
如果没有指定该配置项,它会降级使用默认信息。
示例:
`,8),b=o(`export default { + plugins: [ + pwaPlugin(), + pwaPopupPlugin({ + locales: { + '/': { + message: 'New content is available.', + buttonText: 'Refresh', + }, + '/zh/': { + message: '发现新内容可用', + buttonText: '刷新', + }, + }, + }), + ], +} +
# 样式
你可以通过 CSS 变量来自定义弹窗的样式:
`,3);function m(h,E){const c=p("NpmBadge"),l=p("RouterLink");return i(),D("div",null,[d,a(c,{package:"@vuepress/plugin-pwa-popup"}),y,s("p",null,[n("该插件必须和 "),a(l,{to:"/zh/reference/plugin/pwa.html"},{default:e(()=>[n("pwa 插件")]),_:1}),n(" 一起使用,并且 "),u,n(" 配置项不能设置为 "),v,n(" 。")]),C,s("ul",null,[s("li",null,[n("参考: "),s("ul",null,[s("li",null,[a(l,{to:"/zh/guide/i18n.html"},{default:e(()=>[n("指南 > 多语言支持")]),_:1})])])])]),b])}const f=r(t,[["render",m],["__file","pwa-popup.html.vue"]]);export{f as default}; diff --git a/assets/pwa-popup.html-dTyC3ZgU.js b/assets/pwa-popup.html-dTyC3ZgU.js new file mode 100644 index 000000000..10f13011f --- /dev/null +++ b/assets/pwa-popup.html-dTyC3ZgU.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6df47ee0","path":"/zh/reference/plugin/pwa-popup.html","title":"pwa-popup","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]}]},{"level":2,"title":"样式","slug":"样式","link":"#样式","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/pwa-popup.md"}');export{e as data}; diff --git a/assets/pwa.html-7ewNita9.js b/assets/pwa.html-7ewNita9.js new file mode 100644 index 000000000..7809e9528 --- /dev/null +++ b/assets/pwa.html-7ewNita9.js @@ -0,0 +1,68 @@ +import{_ as i,r as t,o as c,c as D,d as e,a as s,b as n,w as p,e as l}from"./app-eU2v8o1B.js";const d={},u=s("h1",{id:"pwa",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#pwa","aria-hidden":"true"},"#"),n(" pwa")],-1),y={href:"https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps",target:"_blank",rel:"noopener noreferrer"},v={href:"https://developers.google.com/web/tools/workbox/modules/workbox-build",target:"_blank",rel:"noopener noreferrer"},h={href:"https://github.com/yyx990803/register-service-worker",target:"_blank",rel:"noopener noreferrer"},m=l(`:root { + --pwa-popup-z-index: 10; + + --pwa-popup-text-color: #2c3e50; + --pwa-popup-bg-color: #ffffff; + --pwa-popup-border-color: #3eaf7c; + --pwa-popup-shadow: 0 4px 16px var(--pwa-popup-border-color); + + --pwa-popup-btn-text-color: #ffffff; + --pwa-popup-btn-bg-color: #3eaf7c; + --pwa-popup-btn-hover-bg-color: #4abf8a; +} +
# Usage
npm i -D @vuepress/plugin-pwa@next +
import { pwaPlugin } from '@vuepress/plugin-pwa' + +export default { + plugins: [ + pwaPlugin({ + // options + }), + ], +} +
# Web App Manifests
`,4),C={href:"https://developer.mozilla.org/en-US/docs/Web/Manifest",target:"_blank",rel:"noopener noreferrer"},b=s("code",null,".vuepress/public",-1),g=l(`
- Create manifest file
Typically
.vuepress/public/manifest.webmanifest
:{ + "name": "VuePress", + "short_name": "VuePress", + "description": "Vue-powered Static Site Generator", + "start_url": "/index.html", + "display": "standalone", + "background_color": "#fff", + "theme_color": "#3eaf7c", + "icons": [ + { + "src": "/images/icons/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/images/icons/android-chrome-384x384.png", + "sizes": "384x384", + "type": "image/png" + } + ] +} +
- Generate PWA icons
To make your PWA more accessible, you need to generate some icons, and put them inside the public directory.
Make sure the path of icons matches the
icons
field in your manifest file:`,7),_={class:"custom-container tip"},f=s("p",{class:"custom-container-title"},"TIP",-1),E={href:"https://realfavicongenerator.net/",target:"_blank",rel:"noopener noreferrer"},k=s("ol",{start:"3"},[s("li",null,"Set tags in head")],-1),w={href:"https://developer.mozilla.org/en-US/docs/Web/Manifest#deploying_a_manifest_with_the_link_tag",target:"_blank",rel:"noopener noreferrer"},x=l(`
.vuepress/public/images/icons/android-chrome-192x192.png
.vuepress/public/images/icons/android-chrome-384x384.png
export default { + head: [ + ['link', { rel: 'manifest', href: '/manifest.webmanifest' }], + ['meta', { name: 'theme-color', content: '#3eaf7c' }], + // ...other tags + ], +} +
# Options
`,2),q={href:"https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.generateSW",target:"_blank",rel:"noopener noreferrer"},F=s("code",null,"globDirectory",-1),A=s("code",null,"swDest",-1),W=l(`For example, you can set
skipWaiting: true
to auto activate the new service worker once it is ready:export default { + plugins: [ + pwaPlugin({ + skipWaiting: true, + }), + ], +} +
But if you omit
`,3),P=s("li",null,[n("For developers, you can use our "),s("a",{href:"#composition-api"},"composition API"),n(" to take control of the service worker behavior.")],-1),S=s("h3",{id:"serviceworkerfilename",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#serviceworkerfilename","aria-hidden":"true"},"#"),n(" serviceWorkerFilename")],-1),T=s("li",null,[s("p",null,[n("Type: "),s("code",null,"string")])],-1),V=s("li",null,[s("p",null,[n("Default: "),s("code",null,"'service-worker.js'")])],-1),I=s("p",null,"Details:",-1),z=s("p",null,[n("The service worker file will only be generated in "),s("code",null,"build"),n(" mode.")],-1),B=s("h2",{id:"composition-api",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#composition-api","aria-hidden":"true"},"#"),n(" Composition API")],-1),N=s("h3",{id:"usepwaevent",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#usepwaevent","aria-hidden":"true"},"#"),n(" usePwaEvent")],-1),M=s("p",null,"Details:",-1),U=s("p",null,"Returns the event emitter of this plugin.",-1),G={href:"https://github.com/yyx990803/register-service-worker",target:"_blank",rel:"noopener noreferrer"},L=s("li",null,[s("p",null,"Example:")],-1),R=l(`skipWaiting
or set it tofalse
, you have to activate the new service worker manually:import { usePwaEvent } from '@vuepress/plugin-pwa/client' + +export default { + setup() { + const event = usePwaEvent() + event.on('ready', (registration) => { + console.log('Service worker is active.') + }) + }, +} +
# useSkipWaiting
- Parameters:
`,4),j=s("p",null,"Details:",-1),Y={href:"https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/skipWaiting",target:"_blank",rel:"noopener noreferrer"},O=s("li",null,[s("p",null,"Example:")],-1),H=l(`
Parameter Type Description registration ServiceWorkerRegistration
The registration of the service worker you want activate `,1);function J(K,Q){const r=t("NpmBadge"),a=t("ExternalLinkIcon"),o=t("RouterLink");return c(),D("div",null,[u,e(r,{package:"@vuepress/plugin-pwa"}),s("p",null,[n("Make your VuePress site a "),s("a",y,[n("Progressive Web Application (PWA)"),e(a)]),n(".")]),s("p",null,[n("This plugin uses "),s("a",v,[n("workbox-build"),e(a)]),n(" to generate service worker file, and uses "),s("a",h,[n("register-service-worker"),e(a)]),n(" to register service worker.")]),m,s("p",null,[n("To make your website fully compliant with PWA, you need to create a "),s("a",C,[n("Web app manifests"),e(a)]),n(" file and set the icons, colors, etc. for your PWA.")]),s("p",null,[n("You need to put your manifest file and icons into the "),e(o,{to:"/guide/assets.html#public-files"},{default:p(()=>[n("public files directory")]),_:1}),n(". In the following example, we assume that you are using the default public directory "),b,n(".")]),g,s("div",_,[f,s("p",null,[n("Some tools can help to do that. For example, "),s("a",E,[n("Favicon Generator"),e(a)]),n(" would help you to generate icons together with a sample manifest file.")])]),k,s("p",null,[n("You also need to set some tags via "),e(o,{to:"/reference/config.html#head"},{default:p(()=>[n("head")]),_:1}),n(" option to "),s("a",w,[n("deploy the manifest"),e(a)]),n(":")]),x,s("p",null,[n("This plugin accepts all parameters of workbox-build's "),s("a",q,[n("generateSW method"),e(a)]),n(" in its options, except "),F,n(" and "),A,n(".")]),W,s("ul",null,[s("li",null,[n("For users, you can use our "),e(o,{to:"/reference/plugin/pwa-popup.html"},{default:p(()=>[n("pwa-popup")]),_:1}),n(" plugin together.")]),P]),S,s("ul",null,[T,V,s("li",null,[I,s("p",null,[n("File path of the generated service worker file, which is relative to the "),e(o,{to:"/reference/config.html#dest"},{default:p(()=>[n("dest")]),_:1}),n(" directory.")]),z])]),B,N,s("ul",null,[s("li",null,[M,U,s("p",null,[n("You can add listener function to events that provided by "),s("a",G,[n("register-service-worker"),e(a)]),n(".")])]),L]),R,s("ul",null,[s("li",null,[j,s("p",null,[n("Call "),s("a",Y,[n("skipWaiting()"),e(a)]),n(" to activate the waiting service worker.")])]),O]),H])}const Z=i(d,[["render",J],["__file","pwa.html.vue"]]);export{Z as default}; diff --git a/assets/pwa.html-SVcJrjev.js b/assets/pwa.html-SVcJrjev.js new file mode 100644 index 000000000..f982d7618 --- /dev/null +++ b/assets/pwa.html-SVcJrjev.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-01fcaa4f","path":"/zh/reference/plugin/pwa.html","title":"pwa","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"Web App Manifests","slug":"web-app-manifests","link":"#web-app-manifests","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"serviceWorkerFilename","slug":"serviceworkerfilename","link":"#serviceworkerfilename","children":[]}]},{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","children":[{"level":3,"title":"usePwaEvent","slug":"usepwaevent","link":"#usepwaevent","children":[]},{"level":3,"title":"useSkipWaiting","slug":"useskipwaiting","link":"#useskipwaiting","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/pwa.md"}');export{e as data}; diff --git a/assets/pwa.html-dJHRD2Jh.js b/assets/pwa.html-dJHRD2Jh.js new file mode 100644 index 000000000..33526c637 --- /dev/null +++ b/assets/pwa.html-dJHRD2Jh.js @@ -0,0 +1,68 @@ +import{_ as i,r,o as c,c as D,d as a,a as s,b as n,w as p,e as l}from"./app-eU2v8o1B.js";const d={},u=s("h1",{id:"pwa",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#pwa","aria-hidden":"true"},"#"),n(" pwa")],-1),y={href:"https://developer.mozilla.org/zh-CN/docs/Web/Progressive_web_apps",target:"_blank",rel:"noopener noreferrer"},v={href:"https://developers.google.com/web/tools/workbox/modules/workbox-build",target:"_blank",rel:"noopener noreferrer"},C={href:"https://github.com/yyx990803/register-service-worker",target:"_blank",rel:"noopener noreferrer"},m=l(`import { usePwaEvent, useSkipWaiting } from '@vuepress/plugin-pwa/client' + +export default { + setup() { + const event = usePwaEvent() + event.on('updated', (registration) => { + console.log('The waiting service worker is available.') + // activate the waiting service worker + useSkipWaiting(registration) + }) + }, +} +
# 使用方法
npm i -D @vuepress/plugin-pwa@next +
import { pwaPlugin } from '@vuepress/plugin-pwa' + +export default { + plugins: [ + pwaPlugin({ + // 配置项 + }), + ], +} +
# Web App Manifests
`,4),b={href:"https://developer.mozilla.org/zh-CN/docs/Web/Manifest",target:"_blank",rel:"noopener noreferrer"},h=s("code",null,".vuepress/public",-1),_=l(`
- 创建 Manifest 文件
通常是
.vuepress/public/manifest.webmanifest
:{ + "name": "VuePress", + "short_name": "VuePress", + "description": "Vue-powered Static Site Generator", + "start_url": "/index.html", + "display": "standalone", + "background_color": "#fff", + "theme_color": "#3eaf7c", + "icons": [ + { + "src": "/images/icons/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/images/icons/android-chrome-384x384.png", + "sizes": "384x384", + "type": "image/png" + } + ] +} +
- 生成 PWA 图标
为了提高你的 PWA 的可用性,你需要生成一些图标,并将它们放置在 Public 目录下。
确保图标的路径匹配 Manifest 文件中的
icons
字段:`,7),g={class:"custom-container tip"},E=s("p",{class:"custom-container-title"},"提示",-1),f={href:"https://realfavicongenerator.net/",target:"_blank",rel:"noopener noreferrer"},k=s("ol",{start:"3"},[s("li",null,"设置 Head 中的标签")],-1),q={href:"https://developer.mozilla.org/en-US/docs/Web/Manifest#deploying_a_manifest_with_the_link_tag",target:"_blank",rel:"noopener noreferrer"},w=l(`
.vuepress/public/images/icons/android-chrome-192x192.png
.vuepress/public/images/icons/android-chrome-384x384.png
export default { + head: [ + ['link', { rel: 'manifest', href: '/manifest.webmanifest' }], + ['meta', { name: 'theme-color', content: '#3eaf7c' }], + // ...其他标签 + ], +} +
# 配置项
`,2),x={href:"https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build#.generateSW",target:"_blank",rel:"noopener noreferrer"},F=s("code",null,"globDirectory",-1),W=s("code",null,"swDest",-1),A=l(`比如,你可以设置
skipWaiting: true
,这将在新的 Service Worker 就绪之后立即激活它:export default { + plugins: [ + pwaPlugin({ + skipWaiting: true, + }), + ], +} +
但是如果你不设置
`,3),S=s("li",null,[n("对于开发者,你可以使用该插件提供的 "),s("a",{href:"#composition-api"},"Composition API"),n(" 来控制 Service Worker 的行为。")],-1),P=s("h3",{id:"serviceworkerfilename",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#serviceworkerfilename","aria-hidden":"true"},"#"),n(" serviceWorkerFilename")],-1),z=s("li",null,[s("p",null,[n("类型: "),s("code",null,"string")])],-1),B=s("li",null,[s("p",null,[n("默认值: "),s("code",null,"'service-worker.js'")])],-1),M=s("p",null,"详情:",-1),N=s("p",null,[n("Service Worker 文件只会在 "),s("code",null,"build"),n(" 模式下生成。")],-1),V=s("h2",{id:"composition-api",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#composition-api","aria-hidden":"true"},"#"),n(" Composition API")],-1),I=s("h3",{id:"usepwaevent",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#usepwaevent","aria-hidden":"true"},"#"),n(" usePwaEvent")],-1),L=s("p",null,"详情:",-1),R=s("p",null,"返回该插件的 Event Emitter 。",-1),j={href:"https://github.com/yyx990803/register-service-worker",target:"_blank",rel:"noopener noreferrer"},G=s("li",null,[s("p",null,"示例:")],-1),U=l(`skipWaiting
或设置为false
,你就需要手动激活新的 Service Worker 。import { usePwaEvent } from '@vuepress/plugin-pwa/client' + +export default { + setup() { + const event = usePwaEvent() + event.on('ready', (registration) => { + console.log('Service worker 已经生效。') + }) + }, +} +
# useSkipWaiting
- 参数:
`,4),H=s("p",null,"详情:",-1),T={href:"https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/skipWaiting",target:"_blank",rel:"noopener noreferrer"},J=s("li",null,[s("p",null,"示例:")],-1),K=l(`
参数 类型 描述 registration ServiceWorkerRegistration
你想要激活的 Service Worker 的 Registration `,1);function O(Q,X){const t=r("NpmBadge"),e=r("ExternalLinkIcon"),o=r("RouterLink");return c(),D("div",null,[u,a(t,{package:"@vuepress/plugin-pwa"}),s("p",null,[n("使你的 VuePress 站点成为一个 "),s("a",y,[n("渐进式 Web 应用 (PWA)"),a(e)]),n(".")]),s("p",null,[n("该插件使用 "),s("a",v,[n("workbox-build"),a(e)]),n(" 来生成 Service Worker 文件,并通过 "),s("a",C,[n("register-service-worker"),a(e)]),n(" 来注册 Service Worker 。")]),m,s("p",null,[n("为了使你的网站符合 PWA 的要求,你需要创建一个 "),s("a",b,[n("Web app manifests"),a(e)]),n(" 文件,并且为你的 PWA 设置图标、颜色等信息。")]),s("p",null,[n("你需要将你的 Manifest 文件和图标放置在 "),a(o,{to:"/zh/guide/assets.html#public-%E6%96%87%E4%BB%B6"},{default:p(()=>[n("Public 目录")]),_:1}),n(" 下。在下述的示例中,我们假设你正在使用默认的 Public 目录 "),h,n(" 。")]),_,s("div",g,[E,s("p",null,[n("一些工具可以帮助你做这些事。比如 "),s("a",f,[n("Favicon Generator"),a(e)]),n(" 可以帮助你生成图片以及一个 Manifest 文件样例。")])]),k,s("p",null,[n("你还需要通过 "),a(o,{to:"/zh/reference/config.html#head"},{default:p(()=>[n("head")]),_:1}),n(" 配置项来设置一些标签,用来 "),s("a",q,[n("部署你的 Manifest 文件"),a(e)]),n(" 。")]),w,s("p",null,[n("该插件的配置项可以接收 workbox-build 中 "),s("a",x,[n("generateSW 方法"),a(e)]),n(" 除了 "),F,n(" 和 "),W,n(" 以外的所有参数。")]),A,s("ul",null,[s("li",null,[n("对于用户,你可以配合我们提供的 "),a(o,{to:"/zh/reference/plugin/pwa-popup.html"},{default:p(()=>[n("pwa-popup")]),_:1}),n(" 插件一起使用。")]),S]),P,s("ul",null,[z,B,s("li",null,[M,s("p",null,[n("生成的 Service Worker 文件路径,该路径是 "),a(o,{to:"/zh/reference/config.html#dest"},{default:p(()=>[n("dest")]),_:1}),n(" 目录的相对路径。")]),N])]),V,I,s("ul",null,[s("li",null,[L,R,s("p",null,[n("你可以为 "),s("a",j,[n("register-service-worker"),a(e)]),n(" 提供的事件添加事件监听器。")])]),G]),U,s("ul",null,[s("li",null,[H,s("p",null,[n("调用 "),s("a",T,[n("skipWaiting()"),a(e)]),n(" 来激活处于 Waiting 状态的 Service Worker 。")])]),J]),K])}const Z=i(d,[["render",O],["__file","pwa.html.vue"]]);export{Z as default}; diff --git a/assets/pwa.html-vvcbXjjF.js b/assets/pwa.html-vvcbXjjF.js new file mode 100644 index 000000000..ea8694c88 --- /dev/null +++ b/assets/pwa.html-vvcbXjjF.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-7ab4099e","path":"/reference/plugin/pwa.html","title":"pwa","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Web App Manifests","slug":"web-app-manifests","link":"#web-app-manifests","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"serviceWorkerFilename","slug":"serviceworkerfilename","link":"#serviceworkerfilename","children":[]}]},{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","children":[{"level":3,"title":"usePwaEvent","slug":"usepwaevent","link":"#usepwaevent","children":[]},{"level":3,"title":"useSkipWaiting","slug":"useskipwaiting","link":"#useskipwaiting","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/pwa.md"}');export{e as data}; diff --git a/assets/register-components.html-56buZAHG.js b/assets/register-components.html-56buZAHG.js new file mode 100644 index 000000000..5bdb7771a --- /dev/null +++ b/assets/register-components.html-56buZAHG.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-7f8fee18","path":"/reference/plugin/register-components.html","title":"register-components","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"components","slug":"components","link":"#components","children":[]},{"level":3,"title":"componentsDir","slug":"componentsdir","link":"#componentsdir","children":[]},{"level":3,"title":"componentsPatterns","slug":"componentspatterns","link":"#componentspatterns","children":[]},{"level":3,"title":"getComponentName","slug":"getcomponentname","link":"#getcomponentname","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/register-components.md"}');export{e as data}; diff --git a/assets/register-components.html-Edirl6TP.js b/assets/register-components.html-Edirl6TP.js new file mode 100644 index 000000000..fb19ed438 --- /dev/null +++ b/assets/register-components.html-Edirl6TP.js @@ -0,0 +1,49 @@ +import{_ as t,r as a,o as r,c as i,d as e,a as s,b as n,e as l}from"./app-eU2v8o1B.js";const c={},D=s("h1",{id:"register-components",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#register-components","aria-hidden":"true"},"#"),n(" register-components")],-1),d=l(`import { usePwaEvent, useSkipWaiting } from '@vuepress/plugin-pwa/client' + +export default { + setup() { + const event = usePwaEvent() + event.on('updated', (registration) => { + console.log('在 Waiting 状态的 Service Worker 已经就绪。') + // 激活 Waiting 状态的 Service Worker + useSkipWaiting(registration) + }) + }, +} +
Register Vue components from component files or directory automatically.
# Usage
npm i -D @vuepress/plugin-register-components@next +
import { registerComponentsPlugin } from '@vuepress/plugin-register-components' + +export default { + plugins: [ + registerComponentsPlugin({ + // options + }), + ], +} +
# Options
# components
Type:
Record<string, string>
Default:
{}
Details:
An object that defines name of components and their corresponding file path.
The key will be used as the component name, and the value is an absolute path of the component file.
If the component name from this option conflicts with componentsDir option, this option will have a higher priority.
Example:
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + plugins: [ + registerComponentsPlugin({ + components: { + FooBar: path.resolve(__dirname, './components/FooBar.vue'), + }, + }), + ], +} +
# componentsDir
Type:
string | null
Default:
null
Details:
Absolute path to the components directory.
Files in this directory which are matched with componentsPatterns will be registered as Vue components automatically.
Example:
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + plugins: [ + registerComponentsPlugin({ + componentsDir: path.resolve(__dirname, './components'), + }), + ], +} +
Components directory:
components +├─ FooBar.vue +└─ Baz.vue +
Components will be registered like this:
import { defineAsyncComponent } from 'vue' + +app.component( + 'FooBar', + defineAsyncComponent(() => import('/path/to/components/FooBar.vue')), +) + +app.component( + 'Baz', + defineAsyncComponent(() => import('/path/to/components/Baz.vue')), +) +
# componentsPatterns
`,16),y=s("li",null,[s("p",null,[n("Type: "),s("code",null,"string[]")])],-1),m=s("li",null,[s("p",null,[n("Default: "),s("code",null,"['**/*.vue']")])],-1),u=s("p",null,"Details:",-1),v={href:"https://github.com/sindresorhus/globby",target:"_blank",rel:"noopener noreferrer"},C=s("p",null,[n("The patterns are relative to "),s("a",{href:"#componentsdir"},"componentsDir"),n(".")],-1),h=l('# getComponentName
',2);function b(g,E){const p=a("NpmBadge"),o=a("ExternalLinkIcon");return r(),i("div",null,[D,e(p,{package:"@vuepress/plugin-register-components"}),d,s("ul",null,[y,m,s("li",null,[u,s("p",null,[n("Patterns to match component files using "),s("a",v,[n("globby"),e(o)]),n(".")]),C])]),h])}const _=t(c,[["render",b],["__file","register-components.html.vue"]]);export{_ as default}; diff --git a/assets/register-components.html-RP8lipwZ.js b/assets/register-components.html-RP8lipwZ.js new file mode 100644 index 000000000..c54fd2ca6 --- /dev/null +++ b/assets/register-components.html-RP8lipwZ.js @@ -0,0 +1,49 @@ +import{_ as r,r as a,o as c,c as t,d as l,a as s,b as n,e}from"./app-eU2v8o1B.js";const i={},D=s("h1",{id:"register-components",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#register-components","aria-hidden":"true"},"#"),n(" register-components")],-1),d=e(`
Type:
(filename: string) => string
Default:
(filename) => path.trimExt(filename.replace(/\\/|\\\\/g, '-'))
Details:
A function to get component name from the filename.
It will only take effect on the files in the componentsDir which are matched with the componentsPatterns.
Notice that the
filename
is a filepath relative to componentsDir.根据组件文件或目录自动注册 Vue 组件。
# 使用方法
npm i -D @vuepress/plugin-register-components@next +
import { registerComponentsPlugin } from '@vuepress/plugin-register-components' + +export default { + plugins: [ + registerComponentsPlugin({ + // 配置项 + }), + ], +} +
# 配置项
# components
类型:
Record<string, string>
默认值:
{}
详情:
一个定义了组件名称和其对应文件路径的对象。
键会被用作组件名称,值是组件文件的绝对路径。
如果该配置项中的组件名称和 componentsDir 配置项发生冲突,那么该配置项会有更高的优先级。
示例:
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + plugins: [ + registerComponentsPlugin({ + components: { + FooBar: path.resolve(__dirname, './components/FooBar.vue'), + }, + }), + ], +} +
# componentsDir
类型:
string | null
默认值:
null
详情:
组件目录的绝对路径。
该目录下匹配 componentsPatterns 的文件会被自动注册为 Vue 组件。
示例:
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + plugins: [ + registerComponentsPlugin({ + componentsDir: path.resolve(__dirname, './components'), + }), + ], +} +
组件目录:
components +├─ FooBar.vue +└─ Baz.vue +
组件会像这样被注册:
import { defineAsyncComponent } from 'vue' + +app.component( + 'FooBar', + defineAsyncComponent(() => import('/path/to/components/FooBar.vue')), +) + +app.component( + 'Baz', + defineAsyncComponent(() => import('/path/to/components/Baz.vue')), +) +
# componentsPatterns
`,16),y=s("li",null,[s("p",null,[n("类型: "),s("code",null,"string[]")])],-1),m=s("li",null,[s("p",null,[n("默认值: "),s("code",null,"['**/*.vue']")])],-1),u=s("p",null,"详情:",-1),C={href:"https://github.com/sindresorhus/globby",target:"_blank",rel:"noopener noreferrer"},v=s("p",null,[n("该 Patterns 是相对于 "),s("a",{href:"#componentsdir"},"componentsDir"),n(" 目录的。")],-1),b=e('# getComponentName
',2);function h(g,E){const p=a("NpmBadge"),o=a("ExternalLinkIcon");return c(),t("div",null,[D,l(p,{package:"@vuepress/plugin-register-components"}),d,s("ul",null,[y,m,s("li",null,[u,s("p",null,[n("使用 "),s("a",C,[n("globby"),l(o)]),n(" 来匹配组件文件的 Patterns 。")]),v])]),b])}const f=r(i,[["render",h],["__file","register-components.html.vue"]]);export{f as default}; diff --git a/assets/register-components.html-X0BNrizM.js b/assets/register-components.html-X0BNrizM.js new file mode 100644 index 000000000..c2d59fdbf --- /dev/null +++ b/assets/register-components.html-X0BNrizM.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-670b0cc9","path":"/zh/reference/plugin/register-components.html","title":"register-components","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"components","slug":"components","link":"#components","children":[]},{"level":3,"title":"componentsDir","slug":"componentsdir","link":"#componentsdir","children":[]},{"level":3,"title":"componentsPatterns","slug":"componentspatterns","link":"#componentspatterns","children":[]},{"level":3,"title":"getComponentName","slug":"getcomponentname","link":"#getcomponentname","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/register-components.md"}');export{e as data}; diff --git a/assets/search.html-2D2lSrvH.js b/assets/search.html-2D2lSrvH.js new file mode 100644 index 000000000..593f05d05 --- /dev/null +++ b/assets/search.html-2D2lSrvH.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-42d1e5c1","path":"/zh/reference/plugin/search.html","title":"search","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"本地搜索索引","slug":"本地搜索索引","link":"#本地搜索索引","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]},{"level":3,"title":"hotKeys","slug":"hotkeys","link":"#hotkeys","children":[]},{"level":3,"title":"maxSuggestions","slug":"maxsuggestions","link":"#maxsuggestions","children":[]},{"level":3,"title":"isSearchable","slug":"issearchable","link":"#issearchable","children":[]},{"level":3,"title":"getExtraFields","slug":"getextrafields","link":"#getextrafields","children":[]}]},{"level":2,"title":"样式","slug":"样式","link":"#样式","children":[]},{"level":2,"title":"组件","slug":"组件","link":"#组件","children":[{"level":3,"title":"SearchBox","slug":"searchbox","link":"#searchbox","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/search.md"}');export{e as data}; diff --git a/assets/search.html-3IiPlknu.js b/assets/search.html-3IiPlknu.js new file mode 100644 index 000000000..9bc88f691 --- /dev/null +++ b/assets/search.html-3IiPlknu.js @@ -0,0 +1,77 @@ +import{_ as r,r as l,o as t,c as d,d as a,a as s,b as n,w as o,e}from"./app-eU2v8o1B.js";const D={},y=s("h1",{id:"search",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#search","aria-hidden":"true"},"#"),n(" search")],-1),u=e(`
类型:
(filename: string) => string
默认值:
(filename) => path.trimExt(filename.replace(/\\/|\\\\/g, '-'))
详情:
用于从文件名获取对应组件名称的函数。
它只会对 componentsDir 目录下匹配了 componentsPatterns 的文件生效。
注意,这里的
filename
是相对于 componentsPatterns 目录的文件路径。Provide local search to your documentation site.
TIP
Default theme will add search box to the navbar once you configure this plugin correctly.
This plugin may not be used directly in other themes, so you'd better refer to the documentation of your theme for more details.
# Usage
npm i -D @vuepress/plugin-search@next +
import { searchPlugin } from '@vuepress/plugin-search' + +export default { + plugins: [ + searchPlugin({ + // options + }), + ], +} +
# Local Search Index
This plugin will generate search index from your pages locally, and load the search index file when users enter your site. In other words, this is a lightweight built-in search which does not require any external requests.
`,7),h=e(`# Options
# locales
Type:
Record<string, { placeholder: string }>
Details:
The text of the search box in different locales.
If this option is not specified, it will fallback to default text.
Example:
`,4),v=e(`export default { + plugins: [ + searchPlugin({ + locales: { + '/': { + placeholder: 'Search', + }, + '/zh/': { + placeholder: '搜索', + }, + }, + }), + ], +} +
# hotKeys
- Type:
(string | HotKeyOptions)[]
`,3),m=s("li",null,[s("p",null,[n("Default: "),s("code",null,"['s', '/']")])],-1),b=s("p",null,"Details:",-1),C={href:"http://keycode.info/",target:"_blank",rel:"noopener noreferrer"},g=s("p",null,"When hotkeys are pressed, the search box input will be focused.",-1),f=s("p",null,"Set to an empty array to disable hotkeys.",-1),E=e(`export interface HotKeyOptions { + /** + * Value of \`event.key\` to trigger the hot key + */ + key: string; + /** + * Whether to press \`event.altKey\` at the same time + * + * @default false + */ + alt?: boolean; + /** + * Whether to press \`event.ctrlKey\` at the same time + * + * @default false + */ + ctrl?: boolean; + /** + * Whether to press \`event.shiftKey\` at the same time + * + * @default false + */ + shift?: boolean; +} +
# maxSuggestions
Type:
number
Default:
5
Details:
Specify the maximum number of search results.
# isSearchable
Type:
(page: Page) => boolean
Default:
() => true
Details:
A function to determine whether a page should be included in the search index.
- Return
true
to include the page.- Return
false
to exclude the page.Example:
export default { + plugins: [ + searchPlugin({ + // exclude the homepage + isSearchable: (page) => page.path !== '/', + }), + ], +} +
# getExtraFields
Type:
(page: Page) => string[]
Default:
() => []
Details:
A function to add extra fields to the search index of a page.
By default, this plugin will use page title and headers as the search index. This option could help you to add more searchable fields.
Example:
export default { + plugins: [ + searchPlugin({ + // allow searching the \`tags\` frontmatter + getExtraFields: (page) => page.frontmatter.tags ?? [], + }), + ], +} +
# Styles
You can customize the style of the search box via CSS variables:
:root { + --search-bg-color: #ffffff; + --search-accent-color: #3eaf7c; + --search-text-color: #2c3e50; + --search-border-color: #eaecef; + + --search-item-text-color: #5d81a5; + --search-item-focus-bg-color: #f3f4f5; + + --search-input-width: 8rem; + --search-result-width: 20rem; +} +
# Components
# SearchBox
Details:
This plugin will register a
<SearchBox />
component globally, and you can use it without any props.Put this component to where you want to place the search box. For example, default theme puts this component to the end of the navbar.
`,15);function x(A,_){const i=l("NpmBadge"),p=l("RouterLink"),c=l("ExternalLinkIcon");return t(),d("div",null,[y,a(i,{package:"@vuepress/plugin-search"}),u,s("p",null,[n("However, when your site has a large number of pages, the size of search index file would be very large, which could slow down the page loading speed. In this case, we recommend you to use a more professional solution - "),a(p,{to:"/reference/plugin/docsearch.html"},{default:o(()=>[n("docsearch")]),_:1}),n(".")]),h,s("ul",null,[s("li",null,[n("Also see: "),s("ul",null,[s("li",null,[a(p,{to:"/guide/i18n.html"},{default:o(()=>[n("Guide > I18n")]),_:1})])])])]),v,s("ul",null,[m,s("li",null,[b,s("p",null,[n("Specify the "),s("a",C,[n("event.key"),a(c)]),n(" of the hotkeys.")]),g,f])]),E])}const F=r(D,[["render",x],["__file","search.html.vue"]]);export{F as default}; diff --git a/assets/search.html-fZuVMAaU.js b/assets/search.html-fZuVMAaU.js new file mode 100644 index 000000000..4b67c5728 --- /dev/null +++ b/assets/search.html-fZuVMAaU.js @@ -0,0 +1,77 @@ +import{_ as r,r as e,o as t,c as D,d as a,a as s,b as n,w as o,e as l}from"./app-eU2v8o1B.js";const d={},y=s("h1",{id:"search",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#search","aria-hidden":"true"},"#"),n(" search")],-1),u=l(`TIP
This component is mainly used for theme development. You don't need to use it directly in most cases.
为你的文档网站提供本地搜索能力。
提示
当你正确配置该插件后,默认主题会把搜索框添加到导航栏。
该插件不一定能在其他主题中直接使用,因此你应参考主题本身的文档来获取更多信息。
# 使用方法
npm i -D @vuepress/plugin-search@next +
import { searchPlugin } from '@vuepress/plugin-search' + +export default { + plugins: [ + searchPlugin({ + // 配置项 + }), + ], +} +
# 本地搜索索引
该插件会根据你的页面,在本地生成搜索索引,然后在用户访问站点时加载搜索索引文件。换句话说,这是一个轻量级的内置搜索能力,不会进行任何外部请求。
`,7),v=l(`# 配置项
# locales
类型:
Record<string, { placeholder: string }>
详情:
搜索框在不同 locales 下的文字。
如果没有指定该配置项,它会降级使用默认文字。
示例:
`,4),h=l(`export default { + plugins: [ + searchPlugin({ + locales: { + '/': { + placeholder: 'Search', + }, + '/zh/': { + placeholder: '搜索', + }, + }, + }), + ], +} +
# hotKeys
- 类型:
(string | HotKeyOptions)[]
`,3),C=s("li",null,[s("p",null,[n("默认值: "),s("code",null,"['s', '/']")])],-1),m=s("p",null,"详情:",-1),b={href:"http://keycode.info/",target:"_blank",rel:"noopener noreferrer"},E=s("p",null,"当按下热键时,搜索框会被聚焦。",-1),g=s("p",null,"将该配置项设为空数组可以禁用热键功能。",-1),f=l(`export interface HotKeyOptions { + /** + * Value of \`event.key\` to trigger the hot key + */ + key: string; + /** + * Whether to press \`event.altKey\` at the same time + * + * @default false + */ + alt?: boolean; + /** + * Whether to press \`event.ctrlKey\` at the same time + * + * @default false + */ + ctrl?: boolean; + /** + * Whether to press \`event.shiftKey\` at the same time + * + * @default false + */ + shift?: boolean; +} +
# maxSuggestions
类型:
number
默认值:
5
详情:
指定搜索结果的最大条数。
# isSearchable
类型:
(page: Page) => boolean
默认值:
() => true
详情:
一个函数,用于判断一个页面是否应该被包含在搜索索引中。
- 返回
true
来包含该页面。- 返回
false
来排除该页面。示例:
export default { + plugins: [ + searchPlugin({ + // 排除首页 + isSearchable: (page) => page.path !== '/', + }), + ], +} +
# getExtraFields
类型:
(page: Page) => string[]
默认值:
() => []
详情:
一个函数,用于在页面的搜索索引中添加额外字段。
默认情况下,该插件会将页面标题和小标题作为搜索索引。该配置项可以帮助你添加更多的可搜索字段。
示例:
export default { + plugins: [ + searchPlugin({ + // 允许搜索 Frontmatter 中的 \`tags\` + getExtraFields: (page) => page.frontmatter.tags ?? [], + }), + ], +} +
# 样式
你可以通过 CSS 变量来自定义搜索框的样式:
:root { + --search-bg-color: #ffffff; + --search-accent-color: #3eaf7c; + --search-text-color: #2c3e50; + --search-border-color: #eaecef; + + --search-item-text-color: #5d81a5; + --search-item-focus-bg-color: #f3f4f5; + + --search-input-width: 8rem; + --search-result-width: 20rem; +} +
# 组件
# SearchBox
详情:
该插件会全局注册一个
<SearchBox />
组件,你可以不传入任何 Props 来使用它。将该组件放置在你想要显示搜索框的地方。例如,默认主题将这个组件放在了导航栏的末尾。
`,15);function x(A,_){const c=e("NpmBadge"),p=e("RouterLink"),i=e("ExternalLinkIcon");return t(),D("div",null,[y,a(c,{package:"@vuepress/plugin-search"}),u,s("p",null,[n("然而,当你的站点包含大量页面时,搜索索引文件也会变得非常大,它可能会拖慢你的页面加载速度。在这种情况下,我们建议你使用更成熟的解决方案 - "),a(p,{to:"/zh/reference/plugin/docsearch.html"},{default:o(()=>[n("docsearch")]),_:1}),n(" 。")]),v,s("ul",null,[s("li",null,[n("参考: "),s("ul",null,[s("li",null,[a(p,{to:"/zh/guide/i18n.html"},{default:o(()=>[n("指南 > 多语言支持")]),_:1})])])])]),h,s("ul",null,[C,s("li",null,[m,s("p",null,[n("指定热键的 "),s("a",b,[n("event.key"),a(i)]),n(" 。")]),E,g])]),f])}const k=r(d,[["render",x],["__file","search.html.vue"]]);export{k as default}; diff --git a/assets/search.html-uJRJ7ae7.js b/assets/search.html-uJRJ7ae7.js new file mode 100644 index 000000000..5038c9c90 --- /dev/null +++ b/assets/search.html-uJRJ7ae7.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-260e1012","path":"/reference/plugin/search.html","title":"search","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Local Search Index","slug":"local-search-index","link":"#local-search-index","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"locales","slug":"locales","link":"#locales","children":[]},{"level":3,"title":"hotKeys","slug":"hotkeys","link":"#hotkeys","children":[]},{"level":3,"title":"maxSuggestions","slug":"maxsuggestions","link":"#maxsuggestions","children":[]},{"level":3,"title":"isSearchable","slug":"issearchable","link":"#issearchable","children":[]},{"level":3,"title":"getExtraFields","slug":"getextrafields","link":"#getextrafields","children":[]}]},{"level":2,"title":"Styles","slug":"styles","link":"#styles","children":[]},{"level":2,"title":"Components","slug":"components","link":"#components","children":[{"level":3,"title":"SearchBox","slug":"searchbox","link":"#searchbox","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/search.md"}');export{e as data}; diff --git a/assets/shiki.html-0DoPKGkm.js b/assets/shiki.html-0DoPKGkm.js new file mode 100644 index 000000000..893ea7b00 --- /dev/null +++ b/assets/shiki.html-0DoPKGkm.js @@ -0,0 +1,11 @@ +import{_ as t,r as i,o as r,c as p,d as n,a as s,b as e,e as l}from"./app-eU2v8o1B.js";const c={},d=s("h1",{id:"shiki",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#shiki","aria-hidden":"true"},"#"),e(" shiki")],-1),h={href:"https://shiki.matsu.io/",target:"_blank",rel:"noopener noreferrer"},u={class:"custom-container tip"},g=s("p",{class:"custom-container-title"},"TIP",-1),D={href:"https://shiki.matsu.io/",target:"_blank",rel:"noopener noreferrer"},m={href:"https://prismjs.com/",target:"_blank",rel:"noopener noreferrer"},_=s("p",null,[e("You could consider disabling this plugin in "),s("code",null,"dev"),e(" mode to get better development experience.")],-1),b=l(`提示
该组件主要用于主题开发。在大多数情况下你不需要直接使用该组件。
# Usage
npm i -D @vuepress/plugin-shiki@next +
import { shikiPlugin } from '@vuepress/plugin-shiki' + +export default { + plugins: [ + shikiPlugin({ + // options + }), + ], +} +
# Options
# theme
`,5),k=l("Type:
IThemeRegistration
Default:
'nord'
",3),v=s("p",null,"Also see:",-1),y={href:"https://github.com/shikijs/shiki/blob/master/docs/themes.md",target:"_blank",rel:"noopener noreferrer"},f=s("h3",{id:"langs",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#langs","aria-hidden":"true"},"#"),e(" langs")],-1),C=l(" Details:
Theme of shiki.
This option will be forwarded to
getHighlighter()
method of shiki.Type:
(Lang | ILanguageRegistration)[]
Default:
[]
",3),x=s("p",null,"Also see:",-1),E={href:"https://github.com/shikijs/shiki/blob/master/docs/languages.md",target:"_blank",rel:"noopener noreferrer"};function w(T,A){const o=i("NpmBadge"),a=i("ExternalLinkIcon");return r(),p("div",null,[d,n(o,{package:"@vuepress/plugin-shiki"}),s("p",null,[e("This plugin will enable syntax highlighting for markdown code fence with "),s("a",h,[e("Shiki"),n(a)]),e(".")]),s("div",u,[g,s("p",null,[s("a",D,[e("Shiki"),n(a)]),e(" is the syntax highlighter being used by VSCode. It has higher fidelity, but it is slower than "),s("a",m,[e("Prism.js"),n(a)]),e(".")]),_]),b,s("ul",null,[k,s("li",null,[v,s("ul",null,[s("li",null,[s("a",y,[e("shiki > themes"),n(a)])])])])]),f,s("ul",null,[C,s("li",null,[x,s("ul",null,[s("li",null,[s("a",E,[e("shiki > languages"),n(a)])])])])])])}const N=t(c,[["render",w],["__file","shiki.html.vue"]]);export{N as default}; diff --git a/assets/shiki.html-10ErS_oq.js b/assets/shiki.html-10ErS_oq.js new file mode 100644 index 000000000..6e0b743b4 --- /dev/null +++ b/assets/shiki.html-10ErS_oq.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-bb2079f4","path":"/reference/plugin/shiki.html","title":"shiki","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"theme","slug":"theme","link":"#theme","children":[]},{"level":3,"title":"langs","slug":"langs","link":"#langs","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/shiki.md"}');export{e as data}; diff --git a/assets/shiki.html-ANgciB6g.js b/assets/shiki.html-ANgciB6g.js new file mode 100644 index 000000000..e8c131f64 --- /dev/null +++ b/assets/shiki.html-ANgciB6g.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-7a12fb77","path":"/zh/reference/plugin/shiki.html","title":"shiki","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"theme","slug":"theme","link":"#theme","children":[]},{"level":3,"title":"langs","slug":"langs","link":"#langs","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/shiki.md"}');export{e as data}; diff --git a/assets/shiki.html-WJxb9HXD.js b/assets/shiki.html-WJxb9HXD.js new file mode 100644 index 000000000..b1ec69876 --- /dev/null +++ b/assets/shiki.html-WJxb9HXD.js @@ -0,0 +1,11 @@ +import{_ as r,r as i,o as t,c as p,d as n,a as s,b as e,e as l}from"./app-eU2v8o1B.js";const c={},d=s("h1",{id:"shiki",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#shiki","aria-hidden":"true"},"#"),e(" shiki")],-1),h={href:"https://shiki.matsu.io/",target:"_blank",rel:"noopener noreferrer"},u={class:"custom-container tip"},D=s("p",{class:"custom-container-title"},"提示",-1),_={href:"https://shiki.matsu.io/",target:"_blank",rel:"noopener noreferrer"},m={href:"https://prismjs.com/",target:"_blank",rel:"noopener noreferrer"},k=s("p",null,[e("你可以考虑在 "),s("code",null,"dev"),e(" 模式下禁用该插件来获取更好的开发体验。")],-1),g=l(` Details:
Languages of shiki.
This option will be forwarded to
getHighlighter()
method of shiki.If no languages are provided, shiki will load all available languages automatically.
# 使用方法
npm i -D @vuepress/plugin-shiki@next +
import { shikiPlugin } from '@vuepress/plugin-shiki' + +export default { + plugins: [ + shikiPlugin({ + // 配置项 + }), + ], +} +
# 配置项
# theme
`,5),b=l("类型:
IThemeRegistration
默认值:
'nord'
",3),v=s("p",null,"参考:",-1),y={href:"https://github.com/shikijs/shiki/blob/master/docs/themes.md",target:"_blank",rel:"noopener noreferrer"},f=s("h3",{id:"langs",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#langs","aria-hidden":"true"},"#"),e(" langs")],-1),C=l(" 详情:
Shiki 的主题。
该配置项会被传递到 Shiki 的
getHighlighter()
方法中。类型:
(Lang | ILanguageRegistration)[]
默认值:
[]
",3),x=s("p",null,"参考:",-1),E={href:"https://github.com/shikijs/shiki/blob/master/docs/languages.md",target:"_blank",rel:"noopener noreferrer"};function S(N,A){const o=i("NpmBadge"),a=i("ExternalLinkIcon");return t(),p("div",null,[d,n(o,{package:"@vuepress/plugin-shiki"}),s("p",null,[e("该插件使用 "),s("a",h,[e("Shiki"),n(a)]),e(" 来为 Markdown 代码块启用代码高亮。")]),s("div",u,[D,s("p",null,[s("a",_,[e("Shiki"),n(a)]),e(" 是 VSCode 正在使用的代码高亮器。它具有更高的保真度,但比 "),s("a",m,[e("Prism.js"),n(a)]),e(" 要慢一些,特别是在有大量代码块需要处理的时候。")]),k]),g,s("ul",null,[b,s("li",null,[v,s("ul",null,[s("li",null,[s("a",y,[e("shiki > themes"),n(a)])])])])]),f,s("ul",null,[C,s("li",null,[x,s("ul",null,[s("li",null,[s("a",E,[e("shiki > languages"),n(a)])])])])])])}const V=r(c,[["render",S],["__file","shiki.html.vue"]]);export{V as default}; diff --git a/assets/style-JdokpXsH.css b/assets/style-JdokpXsH.css new file mode 100644 index 000000000..cef2a4389 --- /dev/null +++ b/assets/style-JdokpXsH.css @@ -0,0 +1 @@ +:root{--back-to-top-z-index: 5;--back-to-top-color: #3eaf7c;--back-to-top-color-hover: #71cda3}.back-to-top{cursor:pointer;position:fixed;bottom:2rem;right:2.5rem;width:2rem;height:1.2rem;background-color:var(--back-to-top-color);-webkit-mask:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2049.484%2028.284'%3e%3cg%20transform='translate(-229%20-126.358)'%20fill='currentColor'%3e%3crect%20width='35'%20height='5'%20rx='2'%20transform='rotate(-45%20296.902%20-200.874)'/%3e%3crect%20width='35'%20height='5'%20rx='2'%20transform='rotate(-135%20169.502%2020.377)'/%3e%3c/g%3e%3c/svg%3e") no-repeat;mask:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2049.484%2028.284'%3e%3cg%20transform='translate(-229%20-126.358)'%20fill='currentColor'%3e%3crect%20width='35'%20height='5'%20rx='2'%20transform='rotate(-45%20296.902%20-200.874)'/%3e%3crect%20width='35'%20height='5'%20rx='2'%20transform='rotate(-135%20169.502%2020.377)'/%3e%3c/g%3e%3c/svg%3e") no-repeat;z-index:var(--back-to-top-z-index)}.back-to-top:hover{background-color:var(--back-to-top-color-hover)}@media (max-width: 959px){.back-to-top{display:none}}@media print{.back-to-top{display:none}}.back-to-top-enter-active,.back-to-top-leave-active{transition:opacity .3s}.back-to-top-enter-from,.back-to-top-leave-to{opacity:0}:root{--external-link-icon-color: #aaa}.external-link-icon{position:relative;display:inline-block;color:var(--external-link-icon-color);vertical-align:middle;top:-1px}@media print{.external-link-icon{display:none}}.external-link-icon-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}:root{--medium-zoom-z-index: 100;--medium-zoom-bg-color: #ffffff;--medium-zoom-opacity: 1}.medium-zoom-overlay{background-color:var(--medium-zoom-bg-color)!important;z-index:var(--medium-zoom-z-index)}.medium-zoom-overlay~img{z-index:calc(var(--medium-zoom-z-index) + 1)}.medium-zoom--opened .medium-zoom-overlay{opacity:var(--medium-zoom-opacity)}:root{--nprogress-color: #29d;--nprogress-z-index: 1031}#nprogress{pointer-events:none}#nprogress .bar{background:var(--nprogress-color);position:fixed;z-index:var(--nprogress-z-index);top:0;left:0;width:100%;height:2px}:root{--c-brand: #3eaf7c;--c-brand-light: #4abf8a;--c-bg: #ffffff;--c-bg-light: #f3f4f5;--c-bg-lighter: #eeeeee;--c-bg-dark: #ebebec;--c-bg-darker: #e6e6e6;--c-bg-navbar: var(--c-bg);--c-bg-sidebar: var(--c-bg);--c-bg-arrow: #cccccc;--c-text: #2c3e50;--c-text-accent: var(--c-brand);--c-text-light: #3a5169;--c-text-lighter: #4e6e8e;--c-text-lightest: #6a8bad;--c-text-quote: #999999;--c-border: #eaecef;--c-border-dark: #dfe2e5;--c-tip: #42b983;--c-tip-bg: var(--c-bg-light);--c-tip-title: var(--c-text);--c-tip-text: var(--c-text);--c-tip-text-accent: var(--c-text-accent);--c-warning: #ffc310;--c-warning-bg: #fffae3;--c-warning-bg-light: #fff3ba;--c-warning-bg-lighter: #fff0b0;--c-warning-border-dark: #f7dc91;--c-warning-details-bg: #fff5ca;--c-warning-title: #f1b300;--c-warning-text: #746000;--c-warning-text-accent: #edb100;--c-warning-text-light: #c1971c;--c-warning-text-quote: #ccab49;--c-danger: #f11e37;--c-danger-bg: #ffe0e0;--c-danger-bg-light: #ffcfde;--c-danger-bg-lighter: #ffc9c9;--c-danger-border-dark: #f1abab;--c-danger-details-bg: #ffd4d4;--c-danger-title: #ed1e2c;--c-danger-text: #660000;--c-danger-text-accent: #bd1a1a;--c-danger-text-light: #b5474d;--c-danger-text-quote: #c15b5b;--c-details-bg: #eeeeee;--c-badge-tip: var(--c-tip);--c-badge-warning: #ecc808;--c-badge-warning-text: var(--c-bg);--c-badge-danger: #dc2626;--c-badge-danger-text: var(--c-bg);--t-color: .3s ease;--t-transform: .3s ease;--code-bg-color: #282c34;--code-hl-bg-color: rgba(0, 0, 0, .66);--code-ln-color: #9e9e9e;--code-ln-wrapper-width: 3.5rem;--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--font-family-code: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;--navbar-height: 3.6rem;--navbar-padding-v: .7rem;--navbar-padding-h: 1.5rem;--sidebar-width: 20rem;--sidebar-width-mobile: calc(var(--sidebar-width) * .82);--content-width: 740px;--homepage-width: 960px}.back-to-top{--back-to-top-color: var(--c-brand);--back-to-top-color-hover: var(--c-brand-light)}.DocSearch{--docsearch-primary-color: var(--c-brand);--docsearch-text-color: var(--c-text);--docsearch-highlight-color: var(--c-brand);--docsearch-muted-color: var(--c-text-quote);--docsearch-container-background: rgba(9, 10, 17, .8);--docsearch-modal-background: var(--c-bg-light);--docsearch-searchbox-background: var(--c-bg-lighter);--docsearch-searchbox-focus-background: var(--c-bg);--docsearch-searchbox-shadow: inset 0 0 0 2px var(--c-brand);--docsearch-hit-color: var(--c-text-light);--docsearch-hit-active-color: var(--c-bg);--docsearch-hit-background: var(--c-bg);--docsearch-hit-shadow: 0 1px 3px 0 var(--c-border-dark);--docsearch-footer-background: var(--c-bg)}.external-link-icon{--external-link-icon-color: var(--c-text-quote)}.medium-zoom-overlay{--medium-zoom-bg-color: var(--c-bg)}#nprogress{--nprogress-color: var(--c-brand)}.pwa-popup{--pwa-popup-text-color: var(--c-text);--pwa-popup-bg-color: var(--c-bg);--pwa-popup-border-color: var(--c-brand);--pwa-popup-shadow: 0 4px 16px var(--c-brand);--pwa-popup-btn-text-color: var(--c-bg);--pwa-popup-btn-bg-color: var(--c-brand);--pwa-popup-btn-hover-bg-color: var(--c-brand-light)}.search-box{--search-bg-color: var(--c-bg);--search-accent-color: var(--c-brand);--search-text-color: var(--c-text);--search-border-color: var(--c-border);--search-item-text-color: var(--c-text-lighter);--search-item-focus-bg-color: var(--c-bg-light)}html.dark{--c-brand: #3aa675;--c-brand-light: #349469;--c-bg: #22272e;--c-bg-light: #2b313a;--c-bg-lighter: #262c34;--c-bg-dark: #343b44;--c-bg-darker: #37404c;--c-text: #adbac7;--c-text-light: #96a7b7;--c-text-lighter: #8b9eb0;--c-text-lightest: #8094a8;--c-border: #3e4c5a;--c-border-dark: #34404c;--c-tip: #318a62;--c-warning: #e0ad15;--c-warning-bg: #2d2f2d;--c-warning-bg-light: #423e2a;--c-warning-bg-lighter: #44442f;--c-warning-border-dark: #957c35;--c-warning-details-bg: #39392d;--c-warning-title: #fdca31;--c-warning-text: #d8d96d;--c-warning-text-accent: #ffbf00;--c-warning-text-light: #ddb84b;--c-warning-text-quote: #ccab49;--c-danger: #fc1e38;--c-danger-bg: #39232c;--c-danger-bg-light: #4b2b35;--c-danger-bg-lighter: #553040;--c-danger-border-dark: #a25151;--c-danger-details-bg: #482936;--c-danger-title: #fc2d3b;--c-danger-text: #ea9ca0;--c-danger-text-accent: #fd3636;--c-danger-text-light: #d9777c;--c-danger-text-quote: #d56b6b;--c-details-bg: #323843;--c-badge-warning: var(--c-warning);--c-badge-warning-text: #3c2e05;--c-badge-danger: var(--c-danger);--c-badge-danger-text: #401416;--code-hl-bg-color: #363b46}html.dark .DocSearch{--docsearch-logo-color: var(--c-text);--docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;--docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 2px 2px 0 rgba(3, 4, 9, .3);--docsearch-key-gradient: linear-gradient(-225deg, #444950, #1c1e21);--docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, .5), 0 -4px 8px 0 rgba(0, 0, 0, .2)}html,body{padding:0;margin:0;background-color:var(--c-bg);transition:background-color var(--t-color)}html.dark{color-scheme:dark}html{font-size:16px}body{font-family:var(--font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:1rem;color:var(--c-text)}a{font-weight:500;color:var(--c-text-accent);text-decoration:none;overflow-wrap:break-word}p a code{font-weight:400;color:var(--c-text-accent)}kbd{font-family:var(--font-family-code);color:var(--c-text);background:var(--c-bg-lighter);border:solid .15rem var(--c-border-dark);border-bottom:solid .25rem var(--c-border-dark);border-radius:.15rem;padding:0 .15em}code{font-family:var(--font-family-code);color:var(--c-text-lighter);padding:.25rem .5rem;margin:0;font-size:.85em;background-color:var(--c-bg-light);border-radius:3px;overflow-wrap:break-word;transition:background-color var(--t-color)}blockquote{font-size:1rem;color:var(--c-text-quote);border-left:.2rem solid var(--c-border-dark);margin:1rem 0;padding:.25rem 0 .25rem 1rem;overflow-wrap:break-word}blockquote>p{margin:0}ul,ol{padding-left:1.2em}strong{font-weight:600}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.25;overflow-wrap:break-word}h1:focus-visible,h2:focus-visible,h3:focus-visible,h4:focus-visible,h5:focus-visible,h6:focus-visible{outline:none}h1:hover .header-anchor,h2:hover .header-anchor,h3:hover .header-anchor,h4:hover .header-anchor,h5:hover .header-anchor,h6:hover .header-anchor{opacity:1}h1{font-size:2.2rem}h2{font-size:1.65rem;padding-bottom:.3rem;border-bottom:1px solid var(--c-border);transition:border-color var(--t-color)}h3{font-size:1.35rem}h4{font-size:1.15rem}h5{font-size:1.05rem}h6{font-size:1rem}a.header-anchor{font-size:.85em;float:left;margin-left:-.87em;padding-right:.23em;margin-top:.125em;opacity:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media print{a.header-anchor{display:none}}a.header-anchor:hover{text-decoration:none}a.header-anchor:focus-visible{opacity:1}@media print{a[href^="http://"]:after,a[href^="https://"]:after{content:" (" attr(href) ") "}}p,ul,ol{line-height:1.7;overflow-wrap:break-word}hr{border:0;border-top:1px solid var(--c-border)}table{border-collapse:collapse;margin:1rem 0;display:block;overflow-x:auto;transition:border-color var(--t-color)}tr{border-top:1px solid var(--c-border-dark);transition:border-color var(--t-color)}tr:nth-child(2n){background-color:var(--c-bg-light);transition:background-color var(--t-color)}tr:nth-child(2n) code{background-color:var(--c-bg-dark)}th,td{padding:.6em 1em;border:1px solid var(--c-border-dark);transition:border-color var(--t-color)}.arrow{display:inline-block;width:0;height:0}.arrow.up{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:6px solid var(--c-bg-arrow)}.arrow.down{border-left:4px solid transparent;border-right:4px solid transparent;border-top:6px solid var(--c-bg-arrow)}.arrow.right{border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:6px solid var(--c-bg-arrow)}.arrow.left{border-top:4px solid transparent;border-bottom:4px solid transparent;border-right:6px solid var(--c-bg-arrow)}.badge{display:inline-block;font-size:14px;font-weight:600;height:18px;line-height:18px;border-radius:3px;padding:0 6px;color:var(--c-bg);vertical-align:top;transition:color var(--t-color),background-color var(--t-color)}.badge.tip{background-color:var(--c-badge-tip)}.badge.warning{background-color:var(--c-badge-warning);color:var(--c-badge-warning-text)}.badge.danger{background-color:var(--c-badge-danger);color:var(--c-badge-danger-text)}.badge+.badge{margin-left:5px}code[class*=language-],pre[class*=language-]{color:#ccc;background:none;font-family:var(--font-family-code);font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.comment,.token.block-comment,.token.prolog,.token.doctype,.token.cdata{color:#999}.token.punctuation{color:#ccc}.token.tag,.token.attr-name,.token.namespace,.token.deleted{color:#ec5975}.token.function-name{color:#6196cc}.token.boolean,.token.number,.token.function{color:#f08d49}.token.property,.token.class-name,.token.constant,.token.symbol{color:#f8c555}.token.selector,.token.important,.token.atrule,.token.keyword,.token.builtin{color:#cc99cd}.token.string,.token.char,.token.attr-value,.token.regex,.token.variable{color:#7ec699}.token.operator,.token.entity,.token.url{color:#67cdcc}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:#3eaf7c}.theme-default-content pre,.theme-default-content pre[class*=language-]{line-height:1.375;padding:1.3rem 1.5rem;margin:.85rem 0;border-radius:6px;overflow:auto}.theme-default-content pre code,.theme-default-content pre[class*=language-] code{color:#fff;padding:0;background-color:transparent!important;border-radius:0;overflow-wrap:unset;-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.theme-default-content .line-number{font-family:var(--font-family-code)}div[class*=language-]{position:relative;background-color:var(--code-bg-color);border-radius:6px}div[class*=language-]:before{content:attr(data-ext);position:absolute;z-index:3;top:.8em;right:1em;font-size:.75rem;color:var(--code-ln-color)}div[class*=language-] pre,div[class*=language-] pre[class*=language-]{background:transparent!important;position:relative;z-index:1}div[class*=language-] .highlight-lines{-webkit-user-select:none;-moz-user-select:none;user-select:none;padding-top:1.3rem;position:absolute;top:0;left:0;width:100%;line-height:1.375}div[class*=language-] .highlight-lines .highlight-line{background-color:var(--code-hl-bg-color)}div[class*=language-]:not(.line-numbers-mode) .line-numbers{display:none}div[class*=language-].line-numbers-mode .highlight-lines .highlight-line{position:relative}div[class*=language-].line-numbers-mode .highlight-lines .highlight-line:before{content:" ";position:absolute;z-index:2;left:0;top:0;display:block;width:var(--code-ln-wrapper-width);height:100%}div[class*=language-].line-numbers-mode pre{margin-left:var(--code-ln-wrapper-width);padding-left:1rem;vertical-align:middle}div[class*=language-].line-numbers-mode .line-numbers{position:absolute;top:0;width:var(--code-ln-wrapper-width);text-align:center;color:var(--code-ln-color);padding-top:1.25rem;line-height:1.375;counter-reset:line-number}div[class*=language-].line-numbers-mode .line-numbers .line-number{position:relative;z-index:3;-webkit-user-select:none;-moz-user-select:none;user-select:none;height:1.375em}div[class*=language-].line-numbers-mode .line-numbers .line-number:before{counter-increment:line-number;content:counter(line-number);font-size:.85em}div[class*=language-].line-numbers-mode:after{content:"";position:absolute;top:0;left:0;width:var(--code-ln-wrapper-width);height:100%;border-radius:6px 0 0 6px;border-right:1px solid var(--code-hl-bg-color)}@media (max-width: 419px){.theme-default-content div[class*=language-]{margin:.85rem -1.5rem;border-radius:0}}.code-group__nav{margin-top:.85rem;margin-bottom:calc(-1.7rem - 6px);padding-bottom:calc(1.7rem - 6px);padding-left:10px;padding-top:10px;border-top-left-radius:6px;border-top-right-radius:6px;background-color:var(--code-bg-color)}.code-group__ul{margin:auto 0;padding-left:0;display:inline-flex;list-style:none}.code-group__nav-tab{border:0;padding:5px;cursor:pointer;background-color:transparent;font-size:.85em;line-height:1.4;color:#ffffffe6;font-weight:600}.code-group__nav-tab:focus{outline:none}.code-group__nav-tab:focus-visible{outline:1px solid rgba(255,255,255,.9)}.code-group__nav-tab-active{border-bottom:var(--c-brand) 1px solid}@media (max-width: 419px){.code-group__nav{margin-left:-1.5rem;margin-right:-1.5rem;border-radius:0}}.code-group-item{display:none}.code-group-item__active{display:block}.code-group-item>pre{background-color:orange}.custom-container{transition:color var(--t-color),border-color var(--t-color),background-color var(--t-color)}.custom-container .custom-container-title{font-weight:600}.custom-container .custom-container-title:not(:only-child){margin-bottom:-.4rem}.custom-container.tip,.custom-container.warning,.custom-container.danger{padding:.1rem 1.5rem;border-left-width:.5rem;border-left-style:solid;margin:1rem 0}.custom-container.tip{border-color:var(--c-tip);background-color:var(--c-tip-bg);color:var(--c-tip-text)}.custom-container.tip .custom-container-title{color:var(--c-tip-title)}.custom-container.tip a{color:var(--c-tip-text-accent)}.custom-container.tip code{background-color:var(--c-bg-dark)}.custom-container.warning{border-color:var(--c-warning);background-color:var(--c-warning-bg);color:var(--c-warning-text)}.custom-container.warning .custom-container-title{color:var(--c-warning-title)}.custom-container.warning a{color:var(--c-warning-text-accent)}.custom-container.warning blockquote{border-left-color:var(--c-warning-border-dark);color:var(--c-warning-text-quote)}.custom-container.warning code{color:var(--c-warning-text-light);background-color:var(--c-warning-bg-light)}.custom-container.warning details{background-color:var(--c-warning-details-bg)}.custom-container.warning details code{background-color:var(--c-warning-bg-lighter)}.custom-container.warning .external-link-icon{--external-link-icon-color: var(--c-warning-text-quote)}.custom-container.danger{border-color:var(--c-danger);background-color:var(--c-danger-bg);color:var(--c-danger-text)}.custom-container.danger .custom-container-title{color:var(--c-danger-title)}.custom-container.danger a{color:var(--c-danger-text-accent)}.custom-container.danger blockquote{border-left-color:var(--c-danger-border-dark);color:var(--c-danger-text-quote)}.custom-container.danger code{color:var(--c-danger-text-light);background-color:var(--c-danger-bg-light)}.custom-container.danger details{background-color:var(--c-danger-details-bg)}.custom-container.danger details code{background-color:var(--c-danger-bg-lighter)}.custom-container.danger .external-link-icon{--external-link-icon-color: var(--c-danger-text-quote)}.custom-container.details{display:block;position:relative;border-radius:2px;margin:1.6em 0;padding:1.6em;background-color:var(--c-details-bg)}.custom-container.details code{background-color:var(--c-bg-darker)}.custom-container.details h4{margin-top:0}.custom-container.details figure:last-child,.custom-container.details p:last-child{margin-bottom:0;padding-bottom:0}.custom-container.details summary{outline:none;cursor:pointer}.home{padding:var(--navbar-height) 2rem 0;max-width:var(--homepage-width);margin:0 auto;display:block}.home .hero{text-align:center}.home .hero img{max-width:100%;max-height:280px;display:block;margin:3rem auto 1.5rem}.home .hero h1{font-size:3rem}.home .hero h1,.home .hero .description,.home .hero .actions{margin:1.8rem auto}.home .hero .actions{display:flex;flex-wrap:wrap;gap:1rem;justify-content:center}.home .hero .description{max-width:35rem;font-size:1.6rem;line-height:1.3;color:var(--c-text-lightest)}.home .hero .action-button{display:inline-block;font-size:1.2rem;padding:.8rem 1.6rem;border-width:2px;border-style:solid;border-radius:4px;transition:background-color var(--t-color);box-sizing:border-box}.home .hero .action-button.primary{color:var(--c-bg);background-color:var(--c-brand);border-color:var(--c-brand)}.home .hero .action-button.primary:hover{background-color:var(--c-brand-light)}.home .hero .action-button.secondary{color:var(--c-brand);background-color:var(--c-bg);border-color:var(--c-brand)}.home .hero .action-button.secondary:hover{color:var(--c-bg);background-color:var(--c-brand-light)}.home .features{border-top:1px solid var(--c-border);transition:border-color var(--t-color);padding:1.2rem 0;margin-top:2.5rem;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:stretch;justify-content:space-between}.home .feature{flex-grow:1;flex-basis:30%;max-width:30%}.home .feature h2{font-size:1.4rem;font-weight:500;border-bottom:none;padding-bottom:0;color:var(--c-text-light)}.home .feature p{color:var(--c-text-lighter)}.home .theme-default-content{padding:0;margin:0}.home .footer{padding:2.5rem;border-top:1px solid var(--c-border);text-align:center;color:var(--c-text-lighter);transition:border-color var(--t-color)}@media (max-width: 719px){.home .features{flex-direction:column}.home .feature{max-width:100%;padding:0 2.5rem}}@media (max-width: 419px){.home{padding-left:1.5rem;padding-right:1.5rem}.home .hero img{max-height:210px;margin:2rem auto 1.2rem}.home .hero h1{font-size:2rem}.home .hero h1,.home .hero .description,.home .hero .actions{margin:1.2rem auto}.home .hero .description{font-size:1.2rem}.home .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home .feature h2{font-size:1.25rem}}.page{padding-top:var(--navbar-height);padding-left:var(--sidebar-width)}.navbar{position:fixed;z-index:20;top:0;left:0;right:0;height:var(--navbar-height);box-sizing:border-box;border-bottom:1px solid var(--c-border);background-color:var(--c-bg-navbar);transition:background-color var(--t-color),border-color var(--t-color)}.sidebar{font-size:16px;width:var(--sidebar-width);position:fixed;z-index:10;margin:0;top:var(--navbar-height);left:0;bottom:0;box-sizing:border-box;border-right:1px solid var(--c-border);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--c-brand) var(--c-border);background-color:var(--c-bg-sidebar);transition:transform var(--t-transform),background-color var(--t-color),border-color var(--t-color)}.sidebar::-webkit-scrollbar{width:7px}.sidebar::-webkit-scrollbar-track{background-color:var(--c-border)}.sidebar::-webkit-scrollbar-thumb{background-color:var(--c-brand)}.sidebar-mask{position:fixed;z-index:9;top:0;left:0;width:100vw;height:100vh;display:none}.theme-container.sidebar-open .sidebar-mask{display:block}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(1){transform:rotate(45deg) translate3d(5.5px,5.5px,0)}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(2){transform:scale3d(0,1,1)}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(3){transform:rotate(-45deg) translate3d(6px,-6px,0)}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(1),.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(3){transform-origin:center}.theme-container.no-navbar .theme-default-content h1,.theme-container.no-navbar .theme-default-content h2,.theme-container.no-navbar .theme-default-content h3,.theme-container.no-navbar .theme-default-content h4,.theme-container.no-navbar .theme-default-content h5,.theme-container.no-navbar .theme-default-content h6{margin-top:1.5rem;padding-top:0}.theme-container.no-navbar .page{padding-top:0}.theme-container.no-navbar .sidebar{top:0}.theme-container.no-sidebar .sidebar{display:none}@media (max-width: 719px){.theme-container.no-sidebar .sidebar{display:block}}.theme-container.no-sidebar .page{padding-left:0}.theme-default-content a:hover{text-decoration:underline}.theme-default-content img{max-width:100%}.theme-default-content h1,.theme-default-content h2,.theme-default-content h3,.theme-default-content h4,.theme-default-content h5,.theme-default-content h6{margin-top:calc(.5rem - var(--navbar-height));padding-top:calc(1rem + var(--navbar-height));margin-bottom:0}.theme-default-content h1:first-child,.theme-default-content h2:first-child,.theme-default-content h3:first-child,.theme-default-content h4:first-child,.theme-default-content h5:first-child,.theme-default-content h6:first-child{margin-bottom:1rem}.theme-default-content h1:first-child+p,.theme-default-content h1:first-child+pre,.theme-default-content h1:first-child+.custom-container,.theme-default-content h2:first-child+p,.theme-default-content h2:first-child+pre,.theme-default-content h2:first-child+.custom-container,.theme-default-content h3:first-child+p,.theme-default-content h3:first-child+pre,.theme-default-content h3:first-child+.custom-container,.theme-default-content h4:first-child+p,.theme-default-content h4:first-child+pre,.theme-default-content h4:first-child+.custom-container,.theme-default-content h5:first-child+p,.theme-default-content h5:first-child+pre,.theme-default-content h5:first-child+.custom-container,.theme-default-content h6:first-child+p,.theme-default-content h6:first-child+pre,.theme-default-content h6:first-child+.custom-container{margin-top:2rem}@media (max-width: 959px){.sidebar{font-size:15px;width:var(--sidebar-width-mobile)}.page{padding-left:var(--sidebar-width-mobile)}}@media (max-width: 719px){.sidebar{top:0;padding-top:var(--navbar-height);transform:translate(-100%)}.page{padding-left:0}.theme-container.sidebar-open .sidebar{transform:translate(0)}.theme-container.no-navbar .sidebar{padding-top:0}}@media (max-width: 419px){h1{font-size:1.9rem}}.navbar{--navbar-line-height: calc( var(--navbar-height) - 2 * var(--navbar-padding-v) );padding:var(--navbar-padding-v) var(--navbar-padding-h);line-height:var(--navbar-line-height)}.navbar .logo{height:var(--navbar-line-height);margin-right:var(--navbar-padding-v);vertical-align:top}.navbar .site-name{font-size:1.3rem;font-weight:600;color:var(--c-text);position:relative}.navbar .navbar-items-wrapper{display:flex;position:absolute;box-sizing:border-box;top:var(--navbar-padding-v);right:var(--navbar-padding-h);height:var(--navbar-line-height);padding-left:var(--navbar-padding-h);white-space:nowrap;font-size:.9rem}.navbar .navbar-items-wrapper .search-box{flex:0 0 auto;vertical-align:top}@media screen and (max-width: 719px){.navbar{padding-left:4rem}.navbar .site-name{display:block;width:calc(100vw - 11rem);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.navbar .can-hide{display:none}}.navbar-items{display:inline-block}@media print{.navbar-items{display:none}}.navbar-items a{display:inline-block;line-height:1.4rem;color:inherit}.navbar-items a:hover,.navbar-items a.router-link-active{color:var(--c-text)}.navbar-items .navbar-item{position:relative;display:inline-block;margin-left:1.5rem;line-height:var(--navbar-line-height)}.navbar-items .navbar-item:first-child{margin-left:0}.navbar-items .navbar-item>a:hover,.navbar-items .navbar-item>a.router-link-active{margin-bottom:-2px;border-bottom:2px solid var(--c-text-accent)}@media (max-width: 719px){.navbar-items .navbar-item{margin-left:0}.navbar-items .navbar-item>a:hover,.navbar-items .navbar-item>a.router-link-active{margin-bottom:0;border-bottom:none}.navbar-items a:hover,.navbar-items a.router-link-active{color:var(--c-text-accent)}}.toggle-sidebar-button{position:absolute;top:.6rem;left:1rem;display:none;padding:.6rem;cursor:pointer}.toggle-sidebar-button .icon{display:flex;flex-direction:column;justify-content:center;align-items:center;width:1.25rem;height:1.25rem;cursor:inherit}.toggle-sidebar-button .icon span{display:inline-block;width:100%;height:2px;border-radius:2px;background-color:var(--c-text);transition:transform var(--t-transform)}.toggle-sidebar-button .icon span:nth-child(2){margin:6px 0}@media screen and (max-width: 719px){.toggle-sidebar-button{display:block}}.toggle-color-mode-button{display:flex;margin:auto;margin-left:1rem;border:0;background:none;color:var(--c-text);opacity:.8;cursor:pointer}@media print{.toggle-color-mode-button{display:none}}.toggle-color-mode-button:hover{opacity:1}.toggle-color-mode-button .icon{width:1.25rem;height:1.25rem}.DocSearch{transition:background-color var(--t-color)}.navbar-dropdown-wrapper{cursor:pointer}.navbar-dropdown-wrapper .navbar-dropdown-title,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile{display:block;font-size:.9rem;font-family:inherit;cursor:inherit;padding:inherit;line-height:1.4rem;background:transparent;border:none;font-weight:500;color:var(--c-text)}.navbar-dropdown-wrapper .navbar-dropdown-title:hover,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile:hover{border-color:transparent}.navbar-dropdown-wrapper .navbar-dropdown-title .arrow,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile .arrow{vertical-align:middle;margin-top:-1px;margin-left:.4rem}.navbar-dropdown-wrapper .navbar-dropdown-title-mobile{display:none;font-weight:600;font-size:inherit}.navbar-dropdown-wrapper .navbar-dropdown-title-mobile:hover{color:var(--c-text-accent)}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item{color:inherit;line-height:1.7rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle{margin:.45rem 0 0;border-top:1px solid var(--c-border);padding:1rem 0 .45rem;font-size:.9rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle>span{padding:0 1.5rem 0 1.25rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle>a{font-weight:inherit}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle>a.router-link-active:after{display:none}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subitem-wrapper{padding:0;list-style:none}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subitem-wrapper .navbar-dropdown-subitem{font-size:.9em}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a{display:block;line-height:1.7rem;position:relative;border-bottom:none;font-weight:400;margin-bottom:0;padding:0 1.5rem 0 1.25rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a:hover,.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a.router-link-active{color:var(--c-text-accent)}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a.router-link-active:after{content:"";width:0;height:0;border-left:5px solid var(--c-text-accent);border-top:3px solid transparent;border-bottom:3px solid transparent;position:absolute;top:calc(50% - 2px);left:9px}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item:first-child .navbar-dropdown-subtitle{margin-top:0;padding-top:0;border-top:0}.navbar-dropdown-wrapper.mobile.open .navbar-dropdown-title,.navbar-dropdown-wrapper.mobile.open .navbar-dropdown-title-mobile{margin-bottom:.5rem}.navbar-dropdown-wrapper.mobile .navbar-dropdown-title,.navbar-dropdown-wrapper.mobile .navbar-dropdown-title-mobile{display:none}.navbar-dropdown-wrapper.mobile .navbar-dropdown-title-mobile{display:block}.navbar-dropdown-wrapper.mobile .navbar-dropdown{transition:height .1s ease-out;overflow:hidden}.navbar-dropdown-wrapper.mobile .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle{border-top:0;margin-top:0;padding-top:0;padding-bottom:0}.navbar-dropdown-wrapper.mobile .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle,.navbar-dropdown-wrapper.mobile .navbar-dropdown .navbar-dropdown-item>a{font-size:15px;line-height:2rem}.navbar-dropdown-wrapper.mobile .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subitem{font-size:14px;padding-left:1rem}.navbar-dropdown-wrapper:not(.mobile){height:1.8rem}.navbar-dropdown-wrapper:not(.mobile):hover .navbar-dropdown,.navbar-dropdown-wrapper:not(.mobile).open .navbar-dropdown{display:block!important}.navbar-dropdown-wrapper:not(.mobile).open:blur{display:none}.navbar-dropdown-wrapper:not(.mobile) .navbar-dropdown{display:none;height:auto!important;box-sizing:border-box;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;background-color:var(--c-bg-navbar);padding:.6rem 0;border:1px solid var(--c-border);border-bottom-color:var(--c-border-dark);text-align:left;border-radius:.25rem;white-space:nowrap;margin:0}.page{padding-bottom:2rem;display:block}.page .theme-default-content{max-width:var(--content-width);margin:0 auto;padding:2rem 2.5rem;padding-top:0}@media (max-width: 959px){.page .theme-default-content{padding:2rem}}@media (max-width: 419px){.page .theme-default-content{padding:1.5rem}}.page-meta{max-width:var(--content-width);margin:0 auto;padding:1rem 2.5rem;overflow:auto}@media (max-width: 959px){.page-meta{padding:2rem}}@media (max-width: 419px){.page-meta{padding:1.5rem}}.page-meta .meta-item{cursor:default;margin-top:.8rem}.page-meta .meta-item .meta-item-label{font-weight:500;color:var(--c-text-lighter)}.page-meta .meta-item .meta-item-info{font-weight:400;color:var(--c-text-quote)}.page-meta .edit-link{display:inline-block;margin-right:.25rem}@media print{.page-meta .edit-link{display:none}}.page-meta .last-updated{float:right}@media (max-width: 719px){.page-meta .last-updated{font-size:.8em;float:none}.page-meta .contributors{font-size:.8em}}.page-nav{max-width:var(--content-width);margin:0 auto;padding:1rem 2.5rem 2rem;padding-bottom:0}@media (max-width: 959px){.page-nav{padding:2rem}}@media (max-width: 419px){.page-nav{padding:1.5rem}}.page-nav .inner{min-height:2rem;margin-top:0;border-top:1px solid var(--c-border);transition:border-color var(--t-color);padding-top:1rem;overflow:auto}.page-nav .prev a:before{content:"←"}.page-nav .next{float:right}.page-nav .next a:after{content:"→"}.sidebar ul{padding:0;margin:0;list-style-type:none}.sidebar a{display:inline-block}.sidebar .navbar-items{display:none;border-bottom:1px solid var(--c-border);transition:border-color var(--t-color);padding:.5rem 0 .75rem}.sidebar .navbar-items a{font-weight:600}.sidebar .navbar-items .navbar-item{display:block;line-height:1.25rem;font-size:1.1em;padding:.5rem 0 .5rem 1.5rem}.sidebar .sidebar-items{padding:1.5rem 0}@media (max-width: 719px){.sidebar .navbar-items{display:block}.sidebar .navbar-items .navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a.router-link-active:after{top:calc(1rem - 2px)}.sidebar .sidebar-items{padding:1rem 0}}.sidebar-item{cursor:default;border-left:.25rem solid transparent;color:var(--c-text)}.sidebar-item:focus-visible{outline-width:1px;outline-offset:-1px}.sidebar-item.active:not(p.sidebar-heading){font-weight:600;color:var(--c-text-accent);border-left-color:var(--c-text-accent)}.sidebar-item.sidebar-heading{transition:color .15s ease;font-size:1.1em;font-weight:700;padding:.35rem 1.5rem .35rem 1.25rem;width:100%;box-sizing:border-box;margin:0}.sidebar-item.sidebar-heading+.sidebar-item-children{transition:height .1s ease-out;overflow:hidden;margin-bottom:.75rem}.sidebar-item.collapsible{cursor:pointer}.sidebar-item.collapsible .arrow{position:relative;top:-.12em;left:.5em}.sidebar-item:not(.sidebar-heading){font-size:1em;font-weight:400;display:inline-block;margin:0;padding:.35rem 1rem .35rem 2rem;line-height:1.4;width:100%;box-sizing:border-box}.sidebar-item:not(.sidebar-heading)+.sidebar-item-children{padding-left:1rem;font-size:.95em}.sidebar-item-children .sidebar-item-children .sidebar-item:not(.sidebar-heading){padding:.25rem 1rem .25rem 1.75rem}.sidebar-item-children .sidebar-item-children .sidebar-item:not(.sidebar-heading).active{font-weight:500;border-left-color:transparent}a.sidebar-heading+.sidebar-item-children .sidebar-item:not(.sidebar-heading).active{border-left-color:transparent}a.sidebar-item{cursor:pointer}a.sidebar-item:hover{color:var(--c-text-accent)}.table-of-contents .badge{vertical-align:middle}.dropdown-enter-from,.dropdown-leave-to{height:0!important}.fade-slide-y-enter-active{transition:all .2s ease}.fade-slide-y-leave-active{transition:all .2s cubic-bezier(1,.5,.8,1)}.fade-slide-y-enter-from,.fade-slide-y-leave-to{transform:translateY(10px);opacity:0}:root{scroll-behavior:smooth}@media (min-width: 751px){#docsearch-container:lang(zh-CN){min-width:184.66px}}.red-div{color:red}.npm-badge[data-v-c758b2a0]{margin-right:.5rem}/*! @docsearch/css 3.5.2 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */:root{--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:rgba(101,108,133,.8);--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 hsla(0,0%,100%,.5),0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px rgba(30,35,90,.4);--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 rgba(69,98,155,.12)}html[data-theme=dark]{--docsearch-text-color:#f5f6f7;--docsearch-container-background:rgba(9,10,17,.8);--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 rgba(3,4,9,.3);--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 rgba(73,76,106,.5),0 -4px 8px 0 rgba(0,0,0,.2);--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}.DocSearch-Button{align-items:center;background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;display:flex;font-weight:500;height:36px;justify-content:space-between;margin:0 0 0 16px;padding:0 8px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:none}.DocSearch-Button-Container{align-items:center;display:flex}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;position:relative;padding:0 0 2px;border:0;top:-1px;width:20px}@media (max-width:768px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder{display:none}}.DocSearch--active{overflow:hidden!important}.DocSearch-Container,.DocSearch-Container *{box-sizing:border-box}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Container a{text-decoration:none}.DocSearch-Link{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;font:inherit;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:var(--docsearch-text-color);flex:1;font:inherit;font-size:1.2em;height:100%;outline:none;padding:0 0 0 8px;width:80%}.DocSearch-Input::-moz-placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator{display:none}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{animation:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0;stroke-width:var(--docsearch-icon-stroke-width)}}.DocSearch-Reset{animation:fade-in .1s ease-in forwards;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;padding:2px;right:0;stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Cancel{display:none}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:transparent}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Help{font-size:.9em;margin:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{color:var(--docsearch-muted-color);display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--deleting{transition:none}}.DocSearch-Hit--deleting{opacity:0;transition:all .25s linear}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--favoriting{transition:none}}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:all .25s linear;transition-delay:.25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;stroke-width:var(--docsearch-icon-stroke-width);width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color);stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer;padding:2px}svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:rgba(0,0,0,.2);transition:background-color .1s ease-in}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{transition:none}}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:rgba(0,0,0,.2);transition:none}}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"» "}.DocSearch-Prefill{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:none;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:300}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li{align-items:center;display:flex}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{align-items:center;background:var(--docsearch-key-gradient);border-radius:2px;box-shadow:var(--docsearch-key-shadow);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 1px;color:var(--docsearch-muted-color);border:0;width:20px}@media (max-width:768px){:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Dropdown{max-height:calc(var(--docsearch-vh, 1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Cancel{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:none;overflow:hidden;padding:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@media (min-width: 751px){#docsearch-container{min-width:171.36px}}@media (max-width: 750px){.DocSearch-Container{position:fixed}#docsearch-container{min-width:52px}}@media print{#docsearch-container{display:none}} diff --git a/assets/style-w40geAFS.js b/assets/style-w40geAFS.js new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/assets/style-w40geAFS.js @@ -0,0 +1 @@ + diff --git a/assets/styles.html-4XyMA79B.js b/assets/styles.html-4XyMA79B.js new file mode 100644 index 000000000..dd643e3ad --- /dev/null +++ b/assets/styles.html-4XyMA79B.js @@ -0,0 +1,225 @@ +import{_ as e,r as a,o as D,c,d as l,a as n,b as s,e as r}from"./app-eU2v8o1B.js";const t={},i=n("h1",{id:"styles",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#styles","aria-hidden":"true"},"#"),s(" Styles")],-1),y={href:"https://sass-lang.com/",target:"_blank",rel:"noopener noreferrer"},d=r(` 详情:
Shiki 的语言。
该配置项会被传递到 Shiki 的
getHighlighter()
方法中。如果没有传入语言, Shiki 会自动加载所有可用的语言。
Users can customize style variables via a palette file, and add extra styles via a style file.
# Palette File
The path of the palette file is
.vuepress/styles/palette.scss
.You can make use of it to override predefined SASS variables of the default theme.
Click to expand SASS variables
// responsive breakpoints +$MQNarrow: 959px !default; +$MQMobile: 719px !default; +$MQMobileNarrow: 419px !default; +
# Style File
The path of the style file is
.vuepress/styles/index.scss
.You can add extra styles here, or override the default styles:
:root { + scroll-behavior: smooth; +} +
You can also make use of it to override predefined CSS variables of the default theme.
Click to expand CSS variables
:root { + // brand colors + --c-brand: #3eaf7c; + --c-brand-light: #4abf8a; + + // background colors + --c-bg: #ffffff; + --c-bg-light: #f3f4f5; + --c-bg-lighter: #eeeeee; + --c-bg-dark: #ebebec; + --c-bg-darker: #e6e6e6; + --c-bg-navbar: var(--c-bg); + --c-bg-sidebar: var(--c-bg); + --c-bg-arrow: #cccccc; + + // text colors + --c-text: #2c3e50; + --c-text-accent: var(--c-brand); + --c-text-light: #3a5169; + --c-text-lighter: #4e6e8e; + --c-text-lightest: #6a8bad; + --c-text-quote: #999999; + + // border colors + --c-border: #eaecef; + --c-border-dark: #dfe2e5; + + // custom container colors + --c-tip: #42b983; + --c-tip-bg: var(--c-bg-light); + --c-tip-title: var(--c-text); + --c-tip-text: var(--c-text); + --c-tip-text-accent: var(--c-text-accent); + --c-warning: #ffc310; + --c-warning-bg: #fffae3; + --c-warning-bg-light: #fff3ba; + --c-warning-bg-lighter: #fff0b0; + --c-warning-border-dark: #f7dc91; + --c-warning-details-bg: #fff5ca; + --c-warning-title: #f1b300; + --c-warning-text: #746000; + --c-warning-text-accent: #edb100; + --c-warning-text-light: #c1971c; + --c-warning-text-quote: #ccab49; + --c-danger: #f11e37; + --c-danger-bg: #ffe0e0; + --c-danger-bg-light: #ffcfde; + --c-danger-bg-lighter: #ffc9c9; + --c-danger-border-dark: #f1abab; + --c-danger-details-bg: #ffd4d4; + --c-danger-title: #ed1e2c; + --c-danger-text: #660000; + --c-danger-text-accent: #bd1a1a; + --c-danger-text-light: #b5474d; + --c-danger-text-quote: #c15b5b; + --c-details-bg: #eeeeee; + + // badge component colors + --c-badge-tip: var(--c-tip); + --c-badge-warning: #ecc808; + --c-badge-warning-text: var(--c-bg); + --c-badge-danger: #dc2626; + --c-badge-danger-text: var(--c-bg); + + // transition vars + --t-color: 0.3s ease; + --t-transform: 0.3s ease; + + // code blocks vars + --code-bg-color: #282c34; + --code-hl-bg-color: rgba(0, 0, 0, 0.66); + --code-ln-color: #9e9e9e; + --code-ln-wrapper-width: 3.5rem; + + // font vars + --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, + Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; + --font-family-code: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + + // layout vars + --navbar-height: 3.6rem; + --navbar-padding-v: 0.7rem; + --navbar-padding-h: 1.5rem; + --sidebar-width: 20rem; + --sidebar-width-mobile: calc(var(--sidebar-width) * 0.82); + --content-width: 740px; + --homepage-width: 960px; +} + +// plugin-back-to-top +.back-to-top { + --back-to-top-color: var(--c-brand); + --back-to-top-color-hover: var(--c-brand-light); +} + +// plugin-docsearch +.DocSearch { + --docsearch-primary-color: var(--c-brand); + --docsearch-text-color: var(--c-text); + --docsearch-highlight-color: var(--c-brand); + --docsearch-muted-color: var(--c-text-quote); + --docsearch-container-background: rgba(9, 10, 17, 0.8); + --docsearch-modal-background: var(--c-bg-light); + --docsearch-searchbox-background: var(--c-bg-lighter); + --docsearch-searchbox-focus-background: var(--c-bg); + --docsearch-searchbox-shadow: inset 0 0 0 2px var(--c-brand); + --docsearch-hit-color: var(--c-text-light); + --docsearch-hit-active-color: var(--c-bg); + --docsearch-hit-background: var(--c-bg); + --docsearch-hit-shadow: 0 1px 3px 0 var(--c-border-dark); + --docsearch-footer-background: var(--c-bg); +} + +// plugin-external-link-icon +.external-link-icon { + --external-link-icon-color: var(--c-text-quote); +} + +// plugin-medium-zoom +.medium-zoom-overlay { + --medium-zoom-bg-color: var(--c-bg); +} + +// plugin-nprogress +#nprogress { + --nprogress-color: var(--c-brand); +} + +// plugin-pwa-popup +.pwa-popup { + --pwa-popup-text-color: var(--c-text); + --pwa-popup-bg-color: var(--c-bg); + --pwa-popup-border-color: var(--c-brand); + --pwa-popup-shadow: 0 4px 16px var(--c-brand); + --pwa-popup-btn-text-color: var(--c-bg); + --pwa-popup-btn-bg-color: var(--c-brand); + --pwa-popup-btn-hover-bg-color: var(--c-brand-light); +} + +// plugin-search +.search-box { + --search-bg-color: var(--c-bg); + --search-accent-color: var(--c-brand); + --search-text-color: var(--c-text); + --search-border-color: var(--c-border); + + --search-item-text-color: var(--c-text-lighter); + --search-item-focus-bg-color: var(--c-bg-light); +} +
`,12);function C(v,b){const p=a("NpmBadge"),o=a("ExternalLinkIcon");return D(),c("div",null,[i,l(p,{package:"@vuepress/theme-default"}),n("p",null,[s("The default theme uses "),n("a",y,[s("SASS"),l(o)]),s(" as the CSS pre-processor.")]),d])}const u=e(t,[["render",C],["__file","styles.html.vue"]]);export{u as default}; diff --git a/assets/styles.html-5VBO1PYN.js b/assets/styles.html-5VBO1PYN.js new file mode 100644 index 000000000..7371682aa --- /dev/null +++ b/assets/styles.html-5VBO1PYN.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2100bd79","path":"/zh/reference/default-theme/styles.html","title":"样式","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"Palette 文件","slug":"palette-文件","link":"#palette-文件","children":[]},{"level":2,"title":"Style 文件","slug":"style-文件","link":"#style-文件","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/default-theme/styles.md"}');export{e as data}; diff --git a/assets/styles.html-dqTsW5CV.js b/assets/styles.html-dqTsW5CV.js new file mode 100644 index 000000000..50d475450 --- /dev/null +++ b/assets/styles.html-dqTsW5CV.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-31e08608","path":"/reference/default-theme/styles.html","title":"Styles","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Palette File","slug":"palette-file","link":"#palette-file","children":[]},{"level":2,"title":"Style File","slug":"style-file","link":"#style-file","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/default-theme/styles.md"}');export{e as data}; diff --git a/assets/styles.html-ppE-xWyH.js b/assets/styles.html-ppE-xWyH.js new file mode 100644 index 000000000..6d2d3ea78 --- /dev/null +++ b/assets/styles.html-ppE-xWyH.js @@ -0,0 +1,225 @@ +import{_ as e,r as a,o as D,c,d as l,a as n,b as s,e as r}from"./app-eU2v8o1B.js";const t={},i=n("h1",{id:"样式",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#样式","aria-hidden":"true"},"#"),s(" 样式")],-1),y={href:"https://sass-lang.com/",target:"_blank",rel:"noopener noreferrer"},d=r(`Click to expand dark mode CSS variables
html.dark { + // brand colors + --c-brand: #3aa675; + --c-brand-light: #349469; + + // background colors + --c-bg: #22272e; + --c-bg-light: #2b313a; + --c-bg-lighter: #262c34; + --c-bg-dark: #343b44; + --c-bg-darker: #37404c; + + // text colors + --c-text: #adbac7; + --c-text-light: #96a7b7; + --c-text-lighter: #8b9eb0; + --c-text-lightest: #8094a8; + + // border colors + --c-border: #3e4c5a; + --c-border-dark: #34404c; + + // custom container colors + --c-tip: #318a62; + --c-warning: #e0ad15; + --c-warning-bg: #2d2f2d; + --c-warning-bg-light: #423e2a; + --c-warning-bg-lighter: #44442f; + --c-warning-border-dark: #957c35; + --c-warning-details-bg: #39392d; + --c-warning-title: #fdca31; + --c-warning-text: #d8d96d; + --c-warning-text-accent: #ffbf00; + --c-warning-text-light: #ddb84b; + --c-warning-text-quote: #ccab49; + --c-danger: #fc1e38; + --c-danger-bg: #39232c; + --c-danger-bg-light: #4b2b35; + --c-danger-bg-lighter: #553040; + --c-danger-border-dark: #a25151; + --c-danger-details-bg: #482936; + --c-danger-title: #fc2d3b; + --c-danger-text: #ea9ca0; + --c-danger-text-accent: #fd3636; + --c-danger-text-light: #d9777c; + --c-danger-text-quote: #d56b6b; + --c-details-bg: #323843; + + // badge component colors + --c-badge-warning: var(--c-warning); + --c-badge-warning-text: #3c2e05; + --c-badge-danger: var(--c-danger); + --c-badge-danger-text: #401416; + + // code blocks vars + --code-hl-bg-color: #363b46; +} + +// plugin-docsearch +html.dark .DocSearch { + --docsearch-logo-color: var(--c-text); + --docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309; + --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, + 0 2px 2px 0 rgba(3, 4, 9, 0.3); + --docsearch-key-gradient: linear-gradient(-225deg, #444950, #1c1e21); + --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5), + 0 -4px 8px 0 rgba(0, 0, 0, 0.2); +} +
用户可以通过 palette 文件 来自定义样式变量,还可以通过 style 文件 来添加额外的样式。
# Palette 文件
Palette 文件的路径是
.vuepress/styles/palette.scss
。你可以利用它来覆盖默认主题的预定义 SASS 变量。
点击查看 SASS 变量
// responsive breakpoints +$MQNarrow: 959px !default; +$MQMobile: 719px !default; +$MQMobileNarrow: 419px !default; +
# Style 文件
Style 文件的路径是
.vuepress/styles/index.scss
。你可以在这里添加额外的样式,或者覆盖默认样式:
:root { + scroll-behavior: smooth; +} +
你也可以利用它来覆盖默认主题的预定义 CSS 变量。
点击查看 CSS 变量
:root { + // brand colors + --c-brand: #3eaf7c; + --c-brand-light: #4abf8a; + + // background colors + --c-bg: #ffffff; + --c-bg-light: #f3f4f5; + --c-bg-lighter: #eeeeee; + --c-bg-dark: #ebebec; + --c-bg-darker: #e6e6e6; + --c-bg-navbar: var(--c-bg); + --c-bg-sidebar: var(--c-bg); + --c-bg-arrow: #cccccc; + + // text colors + --c-text: #2c3e50; + --c-text-accent: var(--c-brand); + --c-text-light: #3a5169; + --c-text-lighter: #4e6e8e; + --c-text-lightest: #6a8bad; + --c-text-quote: #999999; + + // border colors + --c-border: #eaecef; + --c-border-dark: #dfe2e5; + + // custom container colors + --c-tip: #42b983; + --c-tip-bg: var(--c-bg-light); + --c-tip-title: var(--c-text); + --c-tip-text: var(--c-text); + --c-tip-text-accent: var(--c-text-accent); + --c-warning: #ffc310; + --c-warning-bg: #fffae3; + --c-warning-bg-light: #fff3ba; + --c-warning-bg-lighter: #fff0b0; + --c-warning-border-dark: #f7dc91; + --c-warning-details-bg: #fff5ca; + --c-warning-title: #f1b300; + --c-warning-text: #746000; + --c-warning-text-accent: #edb100; + --c-warning-text-light: #c1971c; + --c-warning-text-quote: #ccab49; + --c-danger: #f11e37; + --c-danger-bg: #ffe0e0; + --c-danger-bg-light: #ffcfde; + --c-danger-bg-lighter: #ffc9c9; + --c-danger-border-dark: #f1abab; + --c-danger-details-bg: #ffd4d4; + --c-danger-title: #ed1e2c; + --c-danger-text: #660000; + --c-danger-text-accent: #bd1a1a; + --c-danger-text-light: #b5474d; + --c-danger-text-quote: #c15b5b; + --c-details-bg: #eeeeee; + + // badge component colors + --c-badge-tip: var(--c-tip); + --c-badge-warning: #ecc808; + --c-badge-warning-text: var(--c-bg); + --c-badge-danger: #dc2626; + --c-badge-danger-text: var(--c-bg); + + // transition vars + --t-color: 0.3s ease; + --t-transform: 0.3s ease; + + // code blocks vars + --code-bg-color: #282c34; + --code-hl-bg-color: rgba(0, 0, 0, 0.66); + --code-ln-color: #9e9e9e; + --code-ln-wrapper-width: 3.5rem; + + // font vars + --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, + Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; + --font-family-code: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + + // layout vars + --navbar-height: 3.6rem; + --navbar-padding-v: 0.7rem; + --navbar-padding-h: 1.5rem; + --sidebar-width: 20rem; + --sidebar-width-mobile: calc(var(--sidebar-width) * 0.82); + --content-width: 740px; + --homepage-width: 960px; +} + +// plugin-back-to-top +.back-to-top { + --back-to-top-color: var(--c-brand); + --back-to-top-color-hover: var(--c-brand-light); +} + +// plugin-docsearch +.DocSearch { + --docsearch-primary-color: var(--c-brand); + --docsearch-text-color: var(--c-text); + --docsearch-highlight-color: var(--c-brand); + --docsearch-muted-color: var(--c-text-quote); + --docsearch-container-background: rgba(9, 10, 17, 0.8); + --docsearch-modal-background: var(--c-bg-light); + --docsearch-searchbox-background: var(--c-bg-lighter); + --docsearch-searchbox-focus-background: var(--c-bg); + --docsearch-searchbox-shadow: inset 0 0 0 2px var(--c-brand); + --docsearch-hit-color: var(--c-text-light); + --docsearch-hit-active-color: var(--c-bg); + --docsearch-hit-background: var(--c-bg); + --docsearch-hit-shadow: 0 1px 3px 0 var(--c-border-dark); + --docsearch-footer-background: var(--c-bg); +} + +// plugin-external-link-icon +.external-link-icon { + --external-link-icon-color: var(--c-text-quote); +} + +// plugin-medium-zoom +.medium-zoom-overlay { + --medium-zoom-bg-color: var(--c-bg); +} + +// plugin-nprogress +#nprogress { + --nprogress-color: var(--c-brand); +} + +// plugin-pwa-popup +.pwa-popup { + --pwa-popup-text-color: var(--c-text); + --pwa-popup-bg-color: var(--c-bg); + --pwa-popup-border-color: var(--c-brand); + --pwa-popup-shadow: 0 4px 16px var(--c-brand); + --pwa-popup-btn-text-color: var(--c-bg); + --pwa-popup-btn-bg-color: var(--c-brand); + --pwa-popup-btn-hover-bg-color: var(--c-brand-light); +} + +// plugin-search +.search-box { + --search-bg-color: var(--c-bg); + --search-accent-color: var(--c-brand); + --search-text-color: var(--c-text); + --search-border-color: var(--c-border); + + --search-item-text-color: var(--c-text-lighter); + --search-item-focus-bg-color: var(--c-bg-light); +} +
`,12);function C(v,b){const p=a("NpmBadge"),o=a("ExternalLinkIcon");return D(),c("div",null,[i,l(p,{package:"@vuepress/theme-default"}),n("p",null,[s("默认主题使用 "),n("a",y,[s("SASS"),l(o)]),s(" 作为 CSS 预处理器。")]),d])}const u=e(t,[["render",C],["__file","styles.html.vue"]]);export{u as default}; diff --git a/assets/theme-api.html--P_ZE6Od.js b/assets/theme-api.html--P_ZE6Od.js new file mode 100644 index 000000000..cfc0e4a50 --- /dev/null +++ b/assets/theme-api.html--P_ZE6Od.js @@ -0,0 +1,10 @@ +import{_ as o,r as a,o as p,c as r,d as n,a as e,b as l,w as t,e as d}from"./app-eU2v8o1B.js";const c={},u=e("h1",{id:"theme-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#theme-api","aria-hidden":"true"},"#"),l(" Theme API")],-1),h=d(`点击查看暗黑模式 CSS 变量
html.dark { + // brand colors + --c-brand: #3aa675; + --c-brand-light: #349469; + + // background colors + --c-bg: #22272e; + --c-bg-light: #2b313a; + --c-bg-lighter: #262c34; + --c-bg-dark: #343b44; + --c-bg-darker: #37404c; + + // text colors + --c-text: #adbac7; + --c-text-light: #96a7b7; + --c-text-lighter: #8b9eb0; + --c-text-lightest: #8094a8; + + // border colors + --c-border: #3e4c5a; + --c-border-dark: #34404c; + + // custom container colors + --c-tip: #318a62; + --c-warning: #e0ad15; + --c-warning-bg: #2d2f2d; + --c-warning-bg-light: #423e2a; + --c-warning-bg-lighter: #44442f; + --c-warning-border-dark: #957c35; + --c-warning-details-bg: #39392d; + --c-warning-title: #fdca31; + --c-warning-text: #d8d96d; + --c-warning-text-accent: #ffbf00; + --c-warning-text-light: #ddb84b; + --c-warning-text-quote: #ccab49; + --c-danger: #fc1e38; + --c-danger-bg: #39232c; + --c-danger-bg-light: #4b2b35; + --c-danger-bg-lighter: #553040; + --c-danger-border-dark: #a25151; + --c-danger-details-bg: #482936; + --c-danger-title: #fc2d3b; + --c-danger-text: #ea9ca0; + --c-danger-text-accent: #fd3636; + --c-danger-text-light: #d9777c; + --c-danger-text-quote: #d56b6b; + --c-details-bg: #323843; + + // badge component colors + --c-badge-warning: var(--c-warning); + --c-badge-warning-text: #3c2e05; + --c-badge-danger: var(--c-danger); + --c-badge-danger-text: #401416; + + // code blocks vars + --code-hl-bg-color: #363b46; +} + +// plugin-docsearch +html.dark .DocSearch { + --docsearch-logo-color: var(--c-text); + --docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309; + --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, + 0 2px 2px 0 rgba(3, 4, 9, 0.3); + --docsearch-key-gradient: linear-gradient(-225deg, #444950, #1c1e21); + --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5), + 0 -4px 8px 0 rgba(0, 0, 0, 0.2); +} +
# Basic Options
# name
Type:
string
Details:
Name of the theme.
It should follow the naming convention, and ensure consistency with the package name when publishing to NPM:
- Non-scoped:
vuepress-theme-foo
- Scoped:
@org/vuepress-theme-foo
# multiple
Details:
A theme should never be used multiple times, so this option is not supported in theme API.
# Theme Specific Options
# extends
Type:
Theme
Details:
The theme to inherit.
All of the Theme API of the parent theme will be inherited, but the child theme will not override the parent theme directly. Theme specific options will override according to following rules:
- plugins: When a same plugin is used in both child and parent theme, if the plugin does not support to be used multiple times, only the one used in the child theme will take effect.
- templateBuild / templateDev: Child theme templates will override parent theme templates.
Multi-level inheritance is supported, i.e. theme B could be extended from theme A, and then theme C could be extended from theme B. In other words, a theme could have a parent theme, a grandparent theme and so on.
Example:
import { defaultTheme } from '@vuepress/theme-default' +import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + // inherit the default theme + extends: defaultTheme(), +} +
# plugins
`,10),m=e("li",null,[e("p",null,[l("Type: "),e("code",null,"(Plugin | Plugin[])[]")])],-1),f=e("li",null,[e("p",null,"Details:"),e("p",null,"Plugins to use in the theme.")],-1),D=e("p",null,"Also see:",-1),_=e("h3",{id:"templatebuild",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#templatebuild","aria-hidden":"true"},"#"),l(" templateBuild")],-1),y=e("li",null,[e("p",null,[l("Type: "),e("code",null,"string")])],-1),v=e("p",null,"Details:",-1),b=e("p",null,"Specify the path of the HTML template for build.",-1),g=e("p",null,"Also see:",-1),C=e("h3",{id:"templatebuildrenderer",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#templatebuildrenderer","aria-hidden":"true"},"#"),l(" templateBuildRenderer")],-1),x=e("li",null,[e("p",null,[l("Type: "),e("code",null,"TemplateRenderer")])],-1),T=e("p",null,"Details:",-1),w=e("p",null,"Specify the HTML template renderer to be used for build.",-1),A=e("p",null,"Also see:",-1),B=e("h3",{id:"templatedev",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#templatedev","aria-hidden":"true"},"#"),l(" templateDev")],-1),E=e("li",null,[e("p",null,[l("Type: "),e("code",null,"string")])],-1),k=e("p",null,"Details:",-1),P=e("p",null,"Specify the HTML template for dev.",-1),I=e("p",null,"Also see:",-1);function F(N,R){const i=a("NpmBadge"),s=a("RouterLink");return p(),r("div",null,[u,n(i,{package:"@vuepress/core"}),e("p",null,[l("VuePress theme also works as a plugin, so Theme API can accept all the options of "),n(s,{to:"/reference/plugin-api.html"},{default:t(()=>[l("Plugin API")]),_:1}),l(" with following differences.")]),h,e("ul",null,[m,f,e("li",null,[D,e("ul",null,[e("li",null,[n(s,{to:"/reference/config.html#plugins"},{default:t(()=>[l("Config > plugins")]),_:1})])])])]),_,e("ul",null,[y,e("li",null,[v,b,e("p",null,[l("It would override the default value of "),n(s,{to:"/reference/config.html#templatebuild"},{default:t(()=>[l("templateBuild")]),_:1}),l(", and could be overridden by user config.")])]),e("li",null,[g,e("ul",null,[e("li",null,[n(s,{to:"/reference/config.html#templatebuild"},{default:t(()=>[l("Config > templateBuild")]),_:1})])])])]),C,e("ul",null,[x,e("li",null,[T,w,e("p",null,[l("It would override the default value of "),n(s,{to:"/reference/config.html#templatebuildrenderer"},{default:t(()=>[l("templateBuildRenderer")]),_:1}),l(", and could be overridden by user config.")])]),e("li",null,[A,e("ul",null,[e("li",null,[n(s,{to:"/reference/config.html#templatebuildrenderer"},{default:t(()=>[l("Config > templateBuildRenderer")]),_:1})])])])]),B,e("ul",null,[E,e("li",null,[k,P,e("p",null,[l("It would override the default value of "),n(s,{to:"/reference/config.html#templatedev"},{default:t(()=>[l("templateDev")]),_:1}),l(", but could be overridden by user config.")])]),e("li",null,[I,e("ul",null,[e("li",null,[n(s,{to:"/reference/config.html#templatedev"},{default:t(()=>[l("Config > templateDev")]),_:1})])])])])])}const L=o(c,[["render",F],["__file","theme-api.html.vue"]]);export{L as default}; diff --git a/assets/theme-api.html-KX9s0kwh.js b/assets/theme-api.html-KX9s0kwh.js new file mode 100644 index 000000000..646821d7a --- /dev/null +++ b/assets/theme-api.html-KX9s0kwh.js @@ -0,0 +1,10 @@ +import{_ as i,r as t,o,c as r,d as n,a as e,b as l,w as a,e as d}from"./app-eU2v8o1B.js";const c={},u=e("h1",{id:"主题-api",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#主题-api","aria-hidden":"true"},"#"),l(" 主题 API")],-1),h=d(`# 基础配置项
# name
类型:
string
详情:
主题的名称。
它应遵从如下命名约定,并且在发布到 NPM 时应确保和包名保持一致:
- 非 Scoped:
vuepress-theme-foo
- Scoped:
@org/vuepress-theme-foo
# multiple
详情:
主题永远不能被多次使用,因此主题 API 不支持该配置项。
# 主题特定配置项
# extends
类型:
Theme
详情:
要继承的主题。
父主题的所有主题 API 都会被继承,但是子主题不会直接覆盖父主题。主题特定的配置项会根据以下规则进行覆盖:
- plugins: 当同一个插件在子主题和父主题中都被使用时,如果该插件不支持被多次使用,那么只有在子主题中使用的插件会生效。
- templateBuild / templateDev: 子主题的模板会覆盖父主题的模板。
支持多级继承,即主题 B 可以继承主题 A ,然后主题 C 可以继承主题 B 。换句话说,一个主题可以有一个父主题、一个祖父主题等等。
示例:
import { defaultTheme } from '@vuepress/theme-default' +import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + // 继承默认主题 + extends: defaultTheme(), +} +
# plugins
`,10),m=e("li",null,[e("p",null,[l("类型: "),e("code",null,"(Plugin | Plugin[])[]")])],-1),D=e("li",null,[e("p",null,"详情:"),e("p",null,"主题中要使用的插件。")],-1),_=e("p",null,"参考:",-1),f=e("h3",{id:"templatebuild",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#templatebuild","aria-hidden":"true"},"#"),l(" templateBuild")],-1),y=e("li",null,[e("p",null,[l("类型: "),e("code",null,"string")])],-1),v=e("p",null,"详情:",-1),C=e("p",null,"指定构建时使用的 HTML 模板路径。",-1),b=e("p",null,"参考:",-1),g=e("h3",{id:"templatebuildrenderer",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#templatebuildrenderer","aria-hidden":"true"},"#"),l(" templateBuildRenderer")],-1),x=e("li",null,[e("p",null,[l("类型: "),e("code",null,"TemplateRenderer"),l(" from "),e("code",null,"@vuepress/utils")])],-1),B=e("p",null,"详情:",-1),A=e("p",null,"指定构建时使用的 HTML 模板渲染函数。",-1),E=e("p",null,"参考:",-1),F=e("h3",{id:"templatedev",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#templatedev","aria-hidden":"true"},"#"),l(" templateDev")],-1),P=e("li",null,[e("p",null,[l("类型: "),e("code",null,"string")])],-1),k=e("p",null,"详情:",-1),z=e("p",null,"指定开发时使用的 HTML 模板。",-1),T=e("p",null,"参考:",-1);function N(R,I){const p=t("NpmBadge"),s=t("RouterLink");return o(),r("div",null,[u,n(p,{package:"@vuepress/core"}),e("p",null,[l("VuePress 主题同样是一个插件,因此主题 API 可以接收 "),n(s,{to:"/zh/reference/plugin-api.html"},{default:a(()=>[l("插件 API")]),_:1}),l(" 的所有选项,但存在以下差别:")]),h,e("ul",null,[m,D,e("li",null,[_,e("ul",null,[e("li",null,[n(s,{to:"/zh/reference/config.html#plugins"},{default:a(()=>[l("配置 > plugins")]),_:1})])])])]),f,e("ul",null,[y,e("li",null,[v,C,e("p",null,[l("它会覆盖 "),n(s,{to:"/zh/reference/config.html#templatebuild"},{default:a(()=>[l("templateBuild")]),_:1}),l(" 的默认值,同时也会被用户配置覆盖。")])]),e("li",null,[b,e("ul",null,[e("li",null,[n(s,{to:"/zh/reference/config.html#templatebuild"},{default:a(()=>[l("配置 > templateBuild")]),_:1})])])])]),g,e("ul",null,[x,e("li",null,[B,A,e("p",null,[l("它会覆盖 "),n(s,{to:"/zh/reference/config.html#templatebuildrenderer"},{default:a(()=>[l("templateBuildRenderer")]),_:1}),l(" 的默认值,同时也会被用户配置覆盖。")])]),e("li",null,[E,e("ul",null,[e("li",null,[n(s,{to:"/zh/reference/config.html#templatebuildrenderer"},{default:a(()=>[l("配置 > templateBuildRenderer")]),_:1})])])])]),F,e("ul",null,[P,e("li",null,[k,z,e("p",null,[l("它会覆盖 "),n(s,{to:"/zh/reference/config.html#templatedev"},{default:a(()=>[l("templateDev")]),_:1}),l(" 的默认值,但是也会被用户配置覆盖。")])]),e("li",null,[T,e("ul",null,[e("li",null,[n(s,{to:"/zh/reference/config.html#templatedev"},{default:a(()=>[l("配置 > templateDev")]),_:1})])])])])])}const V=i(c,[["render",N],["__file","theme-api.html.vue"]]);export{V as default}; diff --git a/assets/theme-api.html-NnDk2D-T.js b/assets/theme-api.html-NnDk2D-T.js new file mode 100644 index 000000000..f1d8fb517 --- /dev/null +++ b/assets/theme-api.html-NnDk2D-T.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-49a27222","path":"/zh/reference/theme-api.html","title":"主题 API","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"基础配置项","slug":"基础配置项","link":"#基础配置项","children":[{"level":3,"title":"name","slug":"name","link":"#name","children":[]},{"level":3,"title":"multiple","slug":"multiple","link":"#multiple","children":[]}]},{"level":2,"title":"主题特定配置项","slug":"主题特定配置项","link":"#主题特定配置项","children":[{"level":3,"title":"extends","slug":"extends","link":"#extends","children":[]},{"level":3,"title":"plugins","slug":"plugins","link":"#plugins","children":[]},{"level":3,"title":"templateBuild","slug":"templatebuild","link":"#templatebuild","children":[]},{"level":3,"title":"templateBuildRenderer","slug":"templatebuildrenderer","link":"#templatebuildrenderer","children":[]},{"level":3,"title":"templateDev","slug":"templatedev","link":"#templatedev","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/theme-api.md"}');export{e as data}; diff --git a/assets/theme-api.html-ZqagUKXR.js b/assets/theme-api.html-ZqagUKXR.js new file mode 100644 index 000000000..9951ba5f0 --- /dev/null +++ b/assets/theme-api.html-ZqagUKXR.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6b76c1c0","path":"/reference/theme-api.html","title":"Theme API","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Basic Options","slug":"basic-options","link":"#basic-options","children":[{"level":3,"title":"name","slug":"name","link":"#name","children":[]},{"level":3,"title":"multiple","slug":"multiple","link":"#multiple","children":[]}]},{"level":2,"title":"Theme Specific Options","slug":"theme-specific-options","link":"#theme-specific-options","children":[{"level":3,"title":"extends","slug":"extends","link":"#extends","children":[]},{"level":3,"title":"plugins","slug":"plugins","link":"#plugins","children":[]},{"level":3,"title":"templateBuild","slug":"templatebuild","link":"#templatebuild","children":[]},{"level":3,"title":"templateBuildRenderer","slug":"templatebuildrenderer","link":"#templatebuildrenderer","children":[]},{"level":3,"title":"templateDev","slug":"templatedev","link":"#templatedev","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/theme-api.md"}');export{e as data}; diff --git a/assets/theme-data.html-7AgSCC4i.js b/assets/theme-data.html-7AgSCC4i.js new file mode 100644 index 000000000..d79f385a1 --- /dev/null +++ b/assets/theme-data.html-7AgSCC4i.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-18fd0fcc","path":"/reference/plugin/theme-data.html","title":"theme-data","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"themeData","slug":"themedata","link":"#themedata","children":[]}]},{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","children":[{"level":3,"title":"useThemeData","slug":"usethemedata","link":"#usethemedata","children":[]},{"level":3,"title":"useThemeLocaleData","slug":"usethemelocaledata","link":"#usethemelocaledata","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/theme-data.md"}');export{e as data}; diff --git a/assets/theme-data.html-C8hdJMe3.js b/assets/theme-data.html-C8hdJMe3.js new file mode 100644 index 000000000..04ee2314e --- /dev/null +++ b/assets/theme-data.html-C8hdJMe3.js @@ -0,0 +1,51 @@ +import{_ as o,r as n,o as c,c as t,d as l,a,b as s,w as D,e as i}from"./app-eU2v8o1B.js";const r={},d=a("h1",{id:"theme-data",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#theme-data","aria-hidden":"true"},"#"),s(" theme-data")],-1),y=i(`该插件主要用于开发主题,并且已经集成到默认主题中。大部分情况下你不需要直接使用它。
对于主题作者,该插件可以提供与 VuePress 及默认主题相同的多语言支持机制。但是如果你的主题不需要提供多语言支持,或者你想用你自己的方式来实现多语言支持,那么你不需要使用该插件。
# 使用方法
npm i -D @vuepress/plugin-theme-data@next +
import { themeDataPlugin } from '@vuepress/plugin-theme-data' + +export default { + plugins: [ + themeDataPlugin({ + // 配置项 + }), + ], +} +
# 配置项
# themeData
类型:
ThemeData
默认值:
{}
详情:
你希望在 Client 端中使用的主题数据对象。
你可以通过该配置项,在 Node 端提供主题数据,然后在客户端通过 useThemeData 和 useThemeLocaleData 来使用主题数据。
示例:
export default { + plugins: [ + themeDataPlugin({ + themeData: { + foo: 'foo', + locales: { + '/zh/': { + foo: 'zh-foo', + }, + }, + }, + }), + ], +} +
注意
主题数据对象在传递到客户端之前,会使用
JSON.stringify()
进行处理,因此你需要保证你提供的是一个可以被 JSON 序列化的对象。# Composition API
# useThemeData
详情:
返回主题数据的 Ref 对象。
数据是通过 themeData 配置项提供的。
示例:
import { useThemeData } from '@vuepress/plugin-theme-data/client' +import type { ThemeData } from '@vuepress/plugin-theme-data/client' + +type MyThemeData = ThemeData<{ + foo: string +}> + +export default { + setup() { + const themeData = useThemeData<MyThemeData>() + console.log(themeData.value) + }, +} +
# useThemeLocaleData
详情:
返回当前 locale 下主题数据的 Ref 对象。
当前 locale 中的字段已被合并到顶层字段中。
示例:
`,17);function u(m,v){const e=n("NpmBadge"),p=n("RouterLink");return c(),t("div",null,[d,l(e,{package:"@vuepress/plugin-theme-data"}),a("p",null,[s("为你的主题提供客户端数据,包含 VuePress 的 "),l(p,{to:"/zh/guide/i18n.html"},{default:D(()=>[s("多语言支持")]),_:1}),s(" 。")]),y])}const h=o(r,[["render",u],["__file","theme-data.html.vue"]]);export{h as default}; diff --git a/assets/theme-data.html-O0pSpAdt.js b/assets/theme-data.html-O0pSpAdt.js new file mode 100644 index 000000000..83e07138e --- /dev/null +++ b/assets/theme-data.html-O0pSpAdt.js @@ -0,0 +1,51 @@ +import{_ as o,r as n,o as t,c as i,d as e,a,b as s,w as c,e as r}from"./app-eU2v8o1B.js";const D={},d=a("h1",{id:"theme-data",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#theme-data","aria-hidden":"true"},"#"),s(" theme-data")],-1),y=r(`import { useThemeLocaleData } from '@vuepress/plugin-theme-data/client' +import type { ThemeData } from '@vuepress/plugin-theme-data/client' + +type MyThemeData = ThemeData<{ + foo: string +}> + +export default { + setup() { + const themeLocaleData = useThemeLocaleData<MyThemeData>() + console.log(themeLocaleData.value) + }, +} +
This plugin is mainly used to develop themes, and has been integrated into the default theme. You won't need to use it directly in most cases.
For theme authors, this plugin will help you to use the same i18n mechanism as VuePress and the default theme. But if you don't want to provide i18n support, or you want to implement in your own way, you don't need this plugin.
# Usage
npm i -D @vuepress/plugin-theme-data@next +
import { themeDataPlugin } from '@vuepress/plugin-theme-data' + +export default { + plugins: [ + themeDataPlugin({ + // options + }), + ], +} +
# Options
# themeData
Type:
ThemeData
Default:
{}
Details:
The theme data object that you want to use in client side.
You can provide theme data in Node side via this option, and use it in client side via useThemeData and useThemeLocaleData.
Example:
export default { + plugins: [ + themeDataPlugin({ + themeData: { + foo: 'foo', + locales: { + '/zh/': { + foo: 'zh-foo', + }, + }, + }, + }), + ], +} +
WARNING
The theme data object will be processed by
JSON.stringify()
before forwarding to client side, so you should ensure that you are providing a JSON-friendly object.# Composition API
# useThemeData
Details:
Returns the theme data ref object.
The value is provided by themeData option.
Example:
import { useThemeData } from '@vuepress/plugin-theme-data/client' +import type { ThemeData } from '@vuepress/plugin-theme-data/client' + +type MyThemeData = ThemeData<{ + foo: string +}> + +export default { + setup() { + const themeData = useThemeData<MyThemeData>() + console.log(themeData.value) + }, +} +
# useThemeLocaleData
Details:
Returns the theme data ref object in current locale.
The properties of current locale has been merged into the root-level properties.
Example:
`,17);function u(m,h){const l=n("NpmBadge"),p=n("RouterLink");return t(),i("div",null,[d,e(l,{package:"@vuepress/plugin-theme-data"}),a("p",null,[s("Provide client data for your theme, with VuePress "),e(p,{to:"/guide/i18n.html"},{default:c(()=>[s("i18n")]),_:1}),s(" support.")]),y])}const C=o(D,[["render",u],["__file","theme-data.html.vue"]]);export{C as default}; diff --git a/assets/theme-data.html-ODrPozv0.js b/assets/theme-data.html-ODrPozv0.js new file mode 100644 index 000000000..5affce0a5 --- /dev/null +++ b/assets/theme-data.html-ODrPozv0.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-411f140a","path":"/zh/reference/plugin/theme-data.html","title":"theme-data","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"themeData","slug":"themedata","link":"#themedata","children":[]}]},{"level":2,"title":"Composition API","slug":"composition-api","link":"#composition-api","children":[{"level":3,"title":"useThemeData","slug":"usethemedata","link":"#usethemedata","children":[]},{"level":3,"title":"useThemeLocaleData","slug":"usethemelocaledata","link":"#usethemelocaledata","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/theme-data.md"}');export{e as data}; diff --git a/assets/theme.html-1lMGI_to.js b/assets/theme.html-1lMGI_to.js new file mode 100644 index 000000000..e0b114586 --- /dev/null +++ b/assets/theme.html-1lMGI_to.js @@ -0,0 +1,14 @@ +import{_ as i,r as t,o as r,c,a as e,b as s,d as n,w as o,e as p}from"./app-eU2v8o1B.js";const d={},u=e("h1",{id:"theme",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#theme","aria-hidden":"true"},"#"),s(" Theme")],-1),h=e("p",null,"VuePress theme can provide layouts, styles and many other features for you, helping you to focus on writing Markdown content.",-1),m=e("h2",{id:"default-theme",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#default-theme","aria-hidden":"true"},"#"),s(" Default Theme")],-1),D=e("p",null,"VuePress has a default theme out of the box, which is applied to our documentation site you are currently browsing.",-1),y=e("p",null,"If you don't specify the theme to use, the default theme will be used automatically.",-1),f=p(`import { useThemeLocaleData } from '@vuepress/plugin-theme-data/client' +import type { ThemeData } from '@vuepress/plugin-theme-data/client' + +type MyThemeData = ThemeData<{ + foo: string +}> + +export default { + setup() { + const themeLocaleData = useThemeLocaleData<MyThemeData>() + console.log(themeLocaleData.value) + }, +} +
`,1),v=e("p",null,"However, you might think it is not good enough. Or, you want to build a different type of site, for example, a blog, instead of a documentation. Then, you can try to use a community theme or create a local theme.",-1),_=e("h2",{id:"community-theme",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#community-theme","aria-hidden":"true"},"#"),s(" Community Theme")],-1),b={href:"https://www.npmjs.com/search?q=keywords:vuepress-theme",target:"_blank",rel:"noopener noreferrer"},C=e("h2",{id:"local-theme",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#local-theme","aria-hidden":"true"},"#"),s(" Local Theme")],-1);function g(w,x){const a=t("RouterLink"),l=t("ExternalLinkIcon");return r(),c("div",null,[u,h,m,D,y,e("p",null,[s("To configure the default theme, you need to import and use it in your config file via the "),n(a,{to:"/reference/config.html#theme"},{default:o(()=>[s("theme")]),_:1}),s(" option:")]),f,e("p",null,[s("The default theme provides basic but useful features for documentation site, you can check out "),n(a,{to:"/reference/default-theme/config.html"},{default:o(()=>[s("Default Theme Config Reference")]),_:1}),s(" for a full list of config.")]),v,_,e("p",null,[s("Community users have created lots of theme and published them to "),e("a",b,[s("NPM"),n(l)]),s(". You should check the theme's own documentation for detailed guide.")]),C,e("p",null,[s("If you want to use your own custom theme but don't want to publish it, you can create a local theme. Refer to "),n(a,{to:"/advanced/theme.html"},{default:o(()=>[s("Advanced > Writing a Theme")]),_:1}),s(" for how to write your own theme.")])])}const E=i(d,[["render",g],["__file","theme.html.vue"]]);export{E as default}; diff --git a/assets/theme.html-AYISgrKz.js b/assets/theme.html-AYISgrKz.js new file mode 100644 index 000000000..55dcad977 --- /dev/null +++ b/assets/theme.html-AYISgrKz.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-06329db8","path":"/advanced/theme.html","title":"Writing a Theme","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Create a Theme","slug":"create-a-theme","link":"#create-a-theme","children":[]},{"level":2,"title":"Publish to NPM","slug":"publish-to-npm","link":"#publish-to-npm","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"advanced/theme.md"}');export{e as data}; diff --git a/assets/theme.html-HAoqhZVd.js b/assets/theme.html-HAoqhZVd.js new file mode 100644 index 000000000..98b577343 --- /dev/null +++ b/assets/theme.html-HAoqhZVd.js @@ -0,0 +1,14 @@ +import{_ as p,r as o,o as r,c,a as s,b as n,d as e,w as l,e as i}from"./app-eU2v8o1B.js";const d={},D=s("h1",{id:"主题",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#主题","aria-hidden":"true"},"#"),n(" 主题")],-1),h=s("p",null,"VuePress 主题为你提供了布局、样式和其他功能,帮助你专注于 Markdown 内容的写作。",-1),u=s("h2",{id:"默认主题",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#默认主题","aria-hidden":"true"},"#"),n(" 默认主题")],-1),m=s("p",null,"VuePress 有一个开箱即用的默认主题,正使用在你当前正在浏览的文档网站上。",-1),_=s("p",null,"如果你不指定要使用的主题,那么就会自动使用默认主题。",-1),y=i(`import { defaultTheme } from 'vuepress' + +export default { + theme: defaultTheme({ + // default theme config + navbar: [ + { + text: 'Home', + link: '/', + }, + ], + }), +} +
`,1),v=s("p",null,"然而,你可能觉得默认主题不够出色,又或者你不想搭建一个文档网站,而是一个其他类型的网站,比如博客。此时,你可以尝试使用社区主题或者创建本地主题。",-1),f=s("h2",{id:"社区主题",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#社区主题","aria-hidden":"true"},"#"),n(" 社区主题")],-1),C={href:"https://www.npmjs.com/search?q=keywords:vuepress-theme",target:"_blank",rel:"noopener noreferrer"},b=s("h2",{id:"本地主题",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#本地主题","aria-hidden":"true"},"#"),n(" 本地主题")],-1);function x(E,k){const a=o("RouterLink"),t=o("ExternalLinkIcon");return r(),c("div",null,[D,h,u,m,_,s("p",null,[n("为了配置默认主题,你需要在你的配置文件中通过 "),e(a,{to:"/zh/reference/config.html#theme"},{default:l(()=>[n("theme")]),_:1}),n(" 配置项来使用它:")]),y,s("p",null,[n("默认主题为文档网站提供了基础且实用的功能,你可以前往 "),e(a,{to:"/zh/reference/default-theme/config.html"},{default:l(()=>[n("默认主题配置参考")]),_:1}),n(" 获取全部的配置列表。")]),v,f,s("p",null,[n("社区用户创建了很多主题,并将它们发布到了 "),s("a",C,[n("NPM"),e(t)]),n(" 上。查看主题本身的文档可以获取更详细的指引。")]),b,s("p",null,[n("如果你想要使用自己的自定义主题,但是又不想发布它,你可以创建一个本地主题。前往 "),e(a,{to:"/zh/advanced/theme.html"},{default:l(()=>[n("深入 > 开发主题")]),_:1}),n(" 学习如何开发你自己的主题。")])])}const g=p(d,[["render",x],["__file","theme.html.vue"]]);export{g as default}; diff --git a/assets/theme.html-PTEeVU-K.js b/assets/theme.html-PTEeVU-K.js new file mode 100644 index 000000000..9e3279367 --- /dev/null +++ b/assets/theme.html-PTEeVU-K.js @@ -0,0 +1,58 @@ +import{_ as t,r as o,o as r,c as i,a as n,b as s,d as a,w as e,e as p}from"./app-eU2v8o1B.js";const D={},d=n("h1",{id:"开发主题",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#开发主题","aria-hidden":"true"},"#"),s(" 开发主题")],-1),y={class:"custom-container tip"},u=n("p",{class:"custom-container-title"},"提示",-1),v=n("h2",{id:"创建一个主题",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#创建一个主题","aria-hidden":"true"},"#"),s(" 创建一个主题")],-1),m=n("em",null,"主题对象",-1),C=n("em",null,"主题函数",-1),b=p(`import { defaultTheme } from 'vuepress' + +export default { + theme: defaultTheme({ + // 默认主题配置 + navbar: [ + { + text: '首页', + link: '/', + }, + ], + }), +} +
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +const fooTheme = (options) => { + // 返回一个主题对象 + return { + name: 'vuepress-theme-foo', + + // 主题的客户端配置文件的路径 + clientConfigFile: path.resolve(__dirname, 'client.js'), + + // 设置自定义 dev / build 模板 + // 如果没有指定模板,将会使用 \`@vuepress/client\` 提供的默认模板 + templateBuild: path.resolve(__dirname, 'templates/build.html'), + templateDev: path.resolve(__dirname, 'templates/dev.html'), + + // 使用插件 + plugins: [ + // ... + ], + + // 其他的插件 API 也都可用 + } +} + +const barTheme = (options) => { + // 返回一个主题函数 + return (app) => { + return { + name: 'vuepress-theme-bar', + // ... + } + } +} +
然后,创建主题的客户端配置文件
client.js
:import { defineClientConfig } from '@vuepress/client' +import Layout from './layouts/Layout.vue' +import NotFound from './layouts/NotFound.vue' + +export default defineClientConfig({ + layouts: { + Layout, + NotFound, + }, +}) +
`,4),h=n("code",null,"Layout",-1),_=p(`
layouts
字段声明了你的主题提供的布局。一个主题必须提供至少两个布局:Layout
和NotFound
。前者用于提供一般页面的默认布局,后者用于提供 404 页面的布局。<template> + <div> + <Content /> + </div> +</template> +
NotFound
布局会被用于404.html
页面:`,3),E=n("h2",{id:"发布到-npm",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#发布到-npm","aria-hidden":"true"},"#"),s(" 发布到 NPM")],-1),g={href:"https://docs.npmjs.com/cli/v8/configuring-npm/package-json",target:"_blank",rel:"noopener noreferrer"},F=p(`<template> + <div>404 Not Found</div> +</template> +
`,1),f=n("code",null,"name",-1),k=n("code",null,"vuepress-theme-xxx",-1),x=n("code",null,"@org/vuepress-theme-xxx",-1),A=n("em",null,"主题对象",-1),N=n("li",null,[s("在 "),n("code",null,"keywords"),s(" 中包含 "),n("code",null,"vuepress-theme"),s(" ,这样用户可以在 NPM 上搜索到你的主题。")],-1);function L(q,j){const l=o("RouterLink"),c=o("ExternalLinkIcon");return r(),i("div",null,[d,n("div",y,[u,n("p",null,[s("在阅读该指南之前,你最好先了解一下 "),a(l,{to:"/zh/advanced/plugin.html"},{default:e(()=>[s("开发插件")]),_:1}),s(" 指南。")])]),v,n("p",null,[s("VuePress 主题是一个特殊的插件,它应该符合 "),a(l,{to:"/zh/reference/theme-api.html"},{default:e(()=>[s("主题 API")]),_:1}),s(" 。和插件一样,主题可以是一个 "),m,s(" 或一个 "),C,s(" ,并且通常通过一个函数来接收配置项:")]),b,n("p",null,[h,s(" 布局应该包含 "),a(l,{to:"/zh/reference/components.html#content"},{default:e(()=>[s("Content")]),_:1}),s(" 组件来展示 Markdown 内容:")]),_,n("p",null,[s("你可以提供多个布局,用户可以通过 "),a(l,{to:"/zh/reference/frontmatter.html#layout"},{default:e(()=>[s("layout")]),_:1}),s(" Frontmatter 来修改布局。")]),E,n("p",null,[s("同样的,对于主题也有 "),n("a",g,[s("package.json"),a(c)]),s(" 相关的约定:")]),F,n("ul",null,[n("li",null,[s("将 "),f,s(" 按照约定命名: "),k,s(" 或 "),x,s(" ,它应该和 "),A,s(" 的 "),a(l,{to:"/zh/reference/theme-api.html#name"},{default:e(()=>[s("name")]),_:1}),s(" 字段保持一致。")]),N])])}const z=t(D,[["render",L],["__file","theme.html.vue"]]);export{z as default}; diff --git a/assets/theme.html-PWswBlx_.js b/assets/theme.html-PWswBlx_.js new file mode 100644 index 000000000..65f510447 --- /dev/null +++ b/assets/theme.html-PWswBlx_.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2efcb26a","path":"/zh/guide/theme.html","title":"主题","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"默认主题","slug":"默认主题","link":"#默认主题","children":[]},{"level":2,"title":"社区主题","slug":"社区主题","link":"#社区主题","children":[]},{"level":2,"title":"本地主题","slug":"本地主题","link":"#本地主题","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/guide/theme.md"}');export{e as data}; diff --git a/assets/theme.html-bQwRzLau.js b/assets/theme.html-bQwRzLau.js new file mode 100644 index 000000000..ed6ba4f47 --- /dev/null +++ b/assets/theme.html-bQwRzLau.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-66c42ad6","path":"/zh/advanced/theme.html","title":"开发主题","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"创建一个主题","slug":"创建一个主题","link":"#创建一个主题","children":[]},{"level":2,"title":"发布到 NPM","slug":"发布到-npm","link":"#发布到-npm","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/advanced/theme.md"}');export{e as data}; diff --git a/assets/theme.html-pdgRQ6zJ.js b/assets/theme.html-pdgRQ6zJ.js new file mode 100644 index 000000000..1e9ede4f1 --- /dev/null +++ b/assets/theme.html-pdgRQ6zJ.js @@ -0,0 +1,58 @@ +import{_ as c,r as p,o as r,c as i,a as n,b as s,d as a,w as e,e as o}from"./app-eU2v8o1B.js";const D={},d=n("h1",{id:"writing-a-theme",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#writing-a-theme","aria-hidden":"true"},"#"),s(" Writing a Theme")],-1),y={class:"custom-container tip"},u=n("p",{class:"custom-container-title"},"TIP",-1),m=n("h2",{id:"create-a-theme",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#create-a-theme","aria-hidden":"true"},"#"),s(" Create a Theme")],-1),v=n("em",null,"Theme Object",-1),h=n("em",null,"Theme Function",-1),C=o(`{ + "name": "vuepress-theme-foo", + "keywords": ["vuepress-theme"] +} +
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +const fooTheme = (options) => { + // returns a theme object + return { + name: 'vuepress-theme-foo', + + // path to the client config of your theme + clientConfigFile: path.resolve(__dirname, 'client.js'), + + // set custom dev / build template + // if the template is not specified, the default template from \`@vuepress/client\` will be used + templateBuild: path.resolve(__dirname, 'templates/build.html'), + templateDev: path.resolve(__dirname, 'templates/dev.html'), + + // use plugins + plugins: [ + // ... + ], + + // other plugin APIs are also available + } +} + +const barTheme = (options) => { + // returns a theme function + return (app) => { + return { + name: 'vuepress-theme-bar', + // ... + } + } +} +
Then, create theme's client config file
client.js
:import { defineClientConfig } from '@vuepress/client' +import Layout from './layouts/Layout.vue' +import NotFound from './layouts/NotFound.vue' + +export default defineClientConfig({ + layouts: { + Layout, + NotFound, + }, +}) +
The
`,4),b=n("code",null,"Layout",-1),_=o(`layouts
field declares the layouts provided by your theme. A theme must provide at least two layouts:Layout
andNotFound
. The former is to provide default layout for common pages, while the latter is to provide layout for 404-not-found page.<template> + <div> + <Content /> + </div> +</template> +
The
NotFound
layout will be used for the404.html
page:`,3),f=n("h2",{id:"publish-to-npm",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#publish-to-npm","aria-hidden":"true"},"#"),s(" Publish to NPM")],-1),g={href:"https://docs.npmjs.com/cli/v8/configuring-npm/package-json",target:"_blank",rel:"noopener noreferrer"},E=o(`<template> + <div>404 Not Found</div> +</template> +
`,1),F=n("code",null,"name",-1),k=n("code",null,"vuepress-theme-xxx",-1),A=n("code",null,"@org/vuepress-theme-xxx",-1),x=n("em",null,"Theme Object",-1),w=n("li",null,[s("Set "),n("code",null,"keywords"),s(" to include "),n("code",null,"vuepress-theme"),s(", so that users can search your theme on NPM.")],-1);function T(N,j){const l=p("RouterLink"),t=p("ExternalLinkIcon");return r(),i("div",null,[d,n("div",y,[u,n("p",null,[s("Before reading this guide, you'd better learn the guide of "),a(l,{to:"/advanced/plugin.html"},{default:e(()=>[s("Writing a Plugin")]),_:1}),s(" first.")])]),m,n("p",null,[s("A VuePress theme is a special plugin, which should satisfy the "),a(l,{to:"/reference/theme-api.html"},{default:e(()=>[s("Theme API")]),_:1}),s(". Like plugins, a theme should also be a "),v,s(" or a "),h,s(", and could be wrapped with a function to receive options:")]),C,n("p",null,[s("The "),b,s(" layout should contain the "),a(l,{to:"/reference/components.html#content"},{default:e(()=>[s("Content")]),_:1}),s(" component to display the markdown content:")]),_,n("p",null,[s("You can provide more layouts, and users can change layout via "),a(l,{to:"/reference/frontmatter.html#layout"},{default:e(()=>[s("layout")]),_:1}),s(" frontmatter.")]),f,n("p",null,[s("Also, there are some conventions for theme in "),n("a",g,[s("package.json"),a(t)]),s(":")]),E,n("ul",null,[n("li",null,[s("Set "),F,s(" to follow the naming convention: "),k,s(" or "),A,s(", which should be consistent with the "),a(l,{to:"/reference/theme-api.html#name"},{default:e(()=>[s("name")]),_:1}),s(" field of the "),x,s(".")]),w])])}const q=c(D,[["render",T],["__file","theme.html.vue"]]);export{q as default}; diff --git a/assets/theme.html-wQhmGWE7.js b/assets/theme.html-wQhmGWE7.js new file mode 100644 index 000000000..1afd9f164 --- /dev/null +++ b/assets/theme.html-wQhmGWE7.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4d76029c","path":"/guide/theme.html","title":"Theme","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Default Theme","slug":"default-theme","link":"#default-theme","children":[]},{"level":2,"title":"Community Theme","slug":"community-theme","link":"#community-theme","children":[]},{"level":2,"title":"Local Theme","slug":"local-theme","link":"#local-theme","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"guide/theme.md"}');export{e as data}; diff --git a/assets/toc.html-5nixziN1.js b/assets/toc.html-5nixziN1.js new file mode 100644 index 000000000..eb024c2ad --- /dev/null +++ b/assets/toc.html-5nixziN1.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-76709450","path":"/reference/plugin/toc.html","title":"toc","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Usage","slug":"usage","link":"#usage","children":[]},{"level":2,"title":"Differences with Markdown TOC Syntax","slug":"differences-with-markdown-toc-syntax","link":"#differences-with-markdown-toc-syntax","children":[]},{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"componentName","slug":"componentname","link":"#componentname","children":[]},{"level":3,"title":"defaultPropsOptions","slug":"defaultpropsoptions","link":"#defaultpropsoptions","children":[]}]},{"level":2,"title":"Component Props","slug":"component-props","link":"#component-props","children":[{"level":3,"title":"headers","slug":"headers","link":"#headers","children":[]},{"level":3,"title":"options","slug":"options-1","link":"#options-1","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/toc.md"}');export{e as data}; diff --git a/assets/toc.html-UM_HyWdr.js b/assets/toc.html-UM_HyWdr.js new file mode 100644 index 000000000..b8a286546 --- /dev/null +++ b/assets/toc.html-UM_HyWdr.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-048d95fe","path":"/zh/reference/plugin/toc.html","title":"toc","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"与 Markdown 目录语法的区别","slug":"与-markdown-目录语法的区别","link":"#与-markdown-目录语法的区别","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"componentName","slug":"componentname","link":"#componentname","children":[]},{"level":3,"title":"defaultPropsOptions","slug":"defaultpropsoptions","link":"#defaultpropsoptions","children":[]}]},{"level":2,"title":"组件 Props","slug":"组件-props","link":"#组件-props","children":[{"level":3,"title":"headers","slug":"headers","link":"#headers","children":[]},{"level":3,"title":"options","slug":"options","link":"#options","children":[]}]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/toc.md"}');export{e as data}; diff --git a/assets/toc.html-a3Qmvl1r.js b/assets/toc.html-a3Qmvl1r.js new file mode 100644 index 000000000..b879a3bbd --- /dev/null +++ b/assets/toc.html-a3Qmvl1r.js @@ -0,0 +1,74 @@ +import{_ as t,r as o,o as r,c as i,d as a,a as n,b as s,w as e,e as p}from"./app-eU2v8o1B.js";const D={},d=n("h1",{id:"toc",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#toc","aria-hidden":"true"},"#"),s(" toc")],-1),y=p(`{ + "name": "vuepress-theme-foo", + "keywords": ["vuepress-theme"] +} +
该插件会提供一个目录 (table-of-contents, TOC) 组件。
# 使用方法
npm i -D @vuepress/plugin-toc@next +
import { tocPlugin } from '@vuepress/plugin-toc' + +export default { + plugins: [ + tocPlugin({ + // 配置项 + }), + ], +} +
# 与 Markdown 目录语法的区别
`,5),u=p(`<!-- Markdown 目录语法 --> + +[[toc]] + +<!-- Vue 目录组件 --> +<Toc /> +
在 Build 模式中,它们都可以被正确地预渲染。然而,它们之间存在一些区别。
Markdown 语法
[[toc]]
仅能在 Markdown 文件中使用。它是由 markdown-it 解析的,生成的目录是静态内容。组件
`,4),v=n("code",null,"linkClass",-1),C=n("code",null,"linkActiveClass",-1),m=p(`<Toc/>
既可以用在 Markdown 文件中,也可以用在 Vue 文件中。它是由 Vue 加载的,生成的目录是一个 Vue 组件。因此,该插件对于主题开发者来说更为有用。
# 配置项
# componentName
类型:
string
默认值:
'Toc'
详情:
指定目录组件的名称。
# defaultPropsOptions
类型:
Partial<TocPropsOptions>
默认值:
{}
详情:
覆盖组件 options Prop 的默认值。
# 组件 Props
目录组件可以通过 Props 来进行自定义。
<template> + <Toc :headers="headers" :options="options" /> +</template> +
# headers
- 类型:
PageHeader[]
interface PageHeader { + level: number + title: string + slug: string + children: PageHeader[] +} +
详情:
指定要渲染的标题数组。
如果该 Prop 没有被设置,默认会使用当前页面的标题。
# options
- 类型:
Partial<TocPropsOptions>
interface TocPropsOptions { + containerTag: string + containerClass: string + listClass: string + itemClass: string + linkTag: 'a' | 'RouterLink' + linkClass: string + linkActiveClass: string + linkChildrenActiveClass: string +} +
默认值:
下列默认值可以用过 defaultPropsOptions 来覆盖:
const defaultOptions = { + containerTag: 'nav', + containerClass: 'vuepress-toc', + listClass: 'vuepress-toc-list', + itemClass: 'vuepress-toc-item', + linkTag: 'RouterLink', + linkClass: 'vuepress-toc-link', + linkActiveClass: 'active', + linkChildrenActiveClass: 'active', +} +
详情:
自定义目录组件。
如果
containerTag
设置为空字符串''
,那么最外层的<nav>
Container 会被完全移除。示例:
使用默认 options 的目录组件的渲染结果类似以下结构:
`,20);function b(h,E){const c=o("NpmBadge"),l=o("RouterLink");return r(),i("div",null,[d,a(c,{package:"@vuepress/plugin-toc"}),y,n("p",null,[s("与 "),a(l,{to:"/zh/guide/markdown.html#%E7%9B%AE%E5%BD%95"},{default:e(()=>[s("Markdown 目录语法")]),_:1}),s(" 类似,该插件提供的目录组件可以直接在你的 Markdown 内容中使用:")]),u,n("p",null,[s("该插件可以和 "),a(l,{to:"/zh/reference/plugin/active-header-links.html"},{default:e(()=>[s("@vuepress/plugin-active-header-links")]),_:1}),s(" 协同工作,你只需要将 "),a(l,{to:"/zh/reference/plugin/active-header-links.html#headerlinkselector"},{default:e(()=>[s("headerLinkSelector")]),_:1}),s(" 与该插件的 "),v,s(" 匹配即可。当页面滚动至某个标题锚点后,对应的链接就会被加上 "),C,s(" 类名。")]),m])}const k=t(D,[["render",b],["__file","toc.html.vue"]]);export{k as default}; diff --git a/assets/toc.html-k5VmjERh.js b/assets/toc.html-k5VmjERh.js new file mode 100644 index 000000000..e5505c426 --- /dev/null +++ b/assets/toc.html-k5VmjERh.js @@ -0,0 +1,74 @@ +import{_ as c,r as o,o as r,c as i,d as a,a as n,b as s,w as e,e as p}from"./app-eU2v8o1B.js";const D={},d=n("h1",{id:"toc",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#toc","aria-hidden":"true"},"#"),s(" toc")],-1),y=p(`<template> + <!-- container --> + <nav class="vuepress-toc"> + <!-- list --> + <ul class="vuepress-toc-list"> + <!-- item --> + <li class="vuepress-toc-item"> + <!-- link --> + <RouterLink class="vuepress-toc-link" to="#foo">Foo</RouterLink> + </li> + <!-- item with children --> + <li class="vuepress-toc-item"> + <!-- link (children active) --> + <RouterLink class="vuepress-toc-link active" to="#bar">Bar</RouterLink> + <!-- list (children) --> + <ul class="vuepress-toc-list"> + <!-- item --> + <li class="vuepress-toc-item"> + <!-- link (active) --> + <RouterLink class="vuepress-toc-link active" to="#bar-child"> + Bar Child + </RouterLink> + </li> + </ul> + </li> + </ul> + </nav> +</template> +
This plugin will provide a table-of-contents (TOC) component.
# Usage
npm i -D @vuepress/plugin-toc@next +
import { tocPlugin } from '@vuepress/plugin-toc' + +export default { + plugins: [ + tocPlugin({ + // options + }), + ], +} +
# Differences with Markdown TOC Syntax
`,5),u=p(`<!-- markdown toc syntax --> + +[[toc]] + +<!-- vue toc component --> +<Toc /> +
Both of them can be pre-rendered correctly in build mode. However, there are some differences between them.
The markdown syntax
[[toc]]
could only be used in markdown files. It is parsed by markdown-it, and the generated TOC is static content.The component
`,4),v=n("code",null,"linkClass",-1),C=n("code",null,"linkActiveClass",-1),m=p(`<Toc/>
could be used in both markdown files and vue files. It is loaded by vue, and the generated TOC is a vue component.Therefore, this plugin is more useful for theme developers.
# Options
# componentName
Type:
string
Default:
'Toc'
Details:
Specify the name of the TOC component.
# defaultPropsOptions
Type:
Partial<TocPropsOptions>
Default:
{}
Details:
Override the default values of the component options prop.
# Component Props
The TOC component also accepts props for customization.
<template> + <Toc :headers="headers" :options="options" /> +</template> +
# headers
- Type:
PageHeader[]
interface PageHeader { + level: number + title: string + slug: string + children: PageHeader[] +} +
Details:
Specify the headers array to render.
If this prop is not specified, the headers of current page will be used.
# options
- Type:
Partial<TocPropsOptions>
interface TocPropsOptions { + containerTag: string + containerClass: string + listClass: string + itemClass: string + linkTag: 'a' | 'RouterLink' + linkClass: string + linkActiveClass: string + linkChildrenActiveClass: string +} +
Default:
Following default values can be overridden by defaultPropsOptions.
const defaultOptions = { + containerTag: 'nav', + containerClass: 'vuepress-toc', + listClass: 'vuepress-toc-list', + itemClass: 'vuepress-toc-item', + linkTag: 'RouterLink', + linkClass: 'vuepress-toc-link', + linkActiveClass: 'active', + linkChildrenActiveClass: 'active', +} +
Details:
Customize the TOC component.
If the
containerTag
is set to an empty string''
, the<nav>
container will be removed totally.Example:
The rendered TOC component with default options looks like:
`,20);function h(b,g){const t=o("NpmBadge"),l=o("RouterLink");return r(),i("div",null,[d,a(t,{package:"@vuepress/plugin-toc"}),y,n("p",null,[s("Similar to the "),a(l,{to:"/guide/markdown.html#table-of-contents"},{default:e(()=>[s("Table of Contents Markdown Syntax")]),_:1}),s(", the TOC component that provided by this plugin could be used in your markdown content directly:")]),u,n("p",null,[s("This plugin could work together with "),a(l,{to:"/reference/plugin/active-header-links.html"},{default:e(()=>[s("@vuepress/plugin-active-header-links")]),_:1}),s(" by setting the "),a(l,{to:"/reference/plugin/active-header-links.html#headerlinkselector"},{default:e(()=>[s("headerLinkSelector")]),_:1}),s(" to match the "),v,s(" option. When the page scroll to a certain header anchor, this corresponding link will be added "),C,s(" class name.")]),m])}const k=c(D,[["render",h],["__file","toc.html.vue"]]);export{k as default}; diff --git a/assets/usage-of-client-config.html-2Br2VXom.js b/assets/usage-of-client-config.html-2Br2VXom.js new file mode 100644 index 000000000..46d3764f4 --- /dev/null +++ b/assets/usage-of-client-config.html-2Br2VXom.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3d6c80f5","path":"/advanced/cookbook/usage-of-client-config.html","title":"Usage of Client Config","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"enhance","slug":"enhance","link":"#enhance","children":[{"level":3,"title":"Register Vue Components","slug":"register-vue-components","link":"#register-vue-components","children":[]},{"level":3,"title":"Use Non-SSR-Friendly Features","slug":"use-non-ssr-friendly-features","link":"#use-non-ssr-friendly-features","children":[]},{"level":3,"title":"Use Router Methods","slug":"use-router-methods","link":"#use-router-methods","children":[]}]},{"level":2,"title":"setup","slug":"setup","link":"#setup","children":[{"level":3,"title":"Use Composition API","slug":"use-composition-api","link":"#use-composition-api","children":[]},{"level":3,"title":"Use Non-SSR-Friendly Features","slug":"use-non-ssr-friendly-features-1","link":"#use-non-ssr-friendly-features-1","children":[]}]},{"level":2,"title":"layouts","slug":"layouts","link":"#layouts","children":[]},{"level":2,"title":"rootComponents","slug":"rootcomponents","link":"#rootcomponents","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"advanced/cookbook/usage-of-client-config.md"}');export{e as data}; diff --git a/assets/usage-of-client-config.html-WviU2RhQ.js b/assets/usage-of-client-config.html-WviU2RhQ.js new file mode 100644 index 000000000..58a800898 --- /dev/null +++ b/assets/usage-of-client-config.html-WviU2RhQ.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-c03241b4","path":"/zh/advanced/cookbook/usage-of-client-config.html","title":"客户端配置的使用方法","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"enhance","slug":"enhance","link":"#enhance","children":[{"level":3,"title":"注册 Vue 组件","slug":"注册-vue-组件","link":"#注册-vue-组件","children":[]},{"level":3,"title":"使用不支持 SSR 的功能","slug":"使用不支持-ssr-的功能","link":"#使用不支持-ssr-的功能","children":[]},{"level":3,"title":"使用 Router 方法","slug":"使用-router-方法","link":"#使用-router-方法","children":[]}]},{"level":2,"title":"setup","slug":"setup","link":"#setup","children":[{"level":3,"title":"使用组合式 API","slug":"使用组合式-api","link":"#使用组合式-api","children":[]},{"level":3,"title":"使用不支持 SSR 的功能","slug":"使用不支持-ssr-的功能-1","link":"#使用不支持-ssr-的功能-1","children":[]}]},{"level":2,"title":"layouts","slug":"layouts","link":"#layouts","children":[]},{"level":2,"title":"rootComponents","slug":"rootcomponents","link":"#rootcomponents","children":[]}],"git":{"updatedTime":1702213846000,"contributors":[{"name":"Mr.Hope","email":"mister-hope@outlook.com","commits":1},{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/advanced/cookbook/usage-of-client-config.md"}');export{e as data}; diff --git a/assets/usage-of-client-config.html-d0TxxEeJ.js b/assets/usage-of-client-config.html-d0TxxEeJ.js new file mode 100644 index 000000000..37c4ff6e0 --- /dev/null +++ b/assets/usage-of-client-config.html-d0TxxEeJ.js @@ -0,0 +1,87 @@ +import{_ as r,r as t,o as c,c as i,a as n,b as s,d as a,w as e,e as o}from"./app-eU2v8o1B.js";const D={},d=n("h1",{id:"客户端配置的使用方法",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#客户端配置的使用方法","aria-hidden":"true"},"#"),s(" 客户端配置的使用方法")],-1),y=o(`<template> + <!-- container --> + <nav class="vuepress-toc"> + <!-- list --> + <ul class="vuepress-toc-list"> + <!-- item --> + <li class="vuepress-toc-item"> + <!-- link --> + <RouterLink class="vuepress-toc-link" to="#foo">Foo</RouterLink> + </li> + <!-- item with children --> + <li class="vuepress-toc-item"> + <!-- link (children active) --> + <RouterLink class="vuepress-toc-link active" to="#bar">Bar</RouterLink> + <!-- list (children) --> + <ul class="vuepress-toc-list"> + <!-- item --> + <li class="vuepress-toc-item"> + <!-- link (active) --> + <RouterLink class="vuepress-toc-link active" to="#bar-child"> + Bar Child + </RouterLink> + </li> + </ul> + </li> + </ul> + </nav> +</template> +
`,1),C=n("code",null,"@vuepress/client",-1),u=o(`import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +const pluginOrTheme = { + clientConfigFile: path.resolve(__dirname, './path/to/clientConfig.ts'), +} +
import { defineClientConfig } from '@vuepress/client' + +export default defineClientConfig({ + enhance({ app, router, siteData }) {}, + setup() {}, + layouts: {}, + rootComponents: [], +}) +
# enhance
`,3),v=n("code",null,"app",-1),m={href:"https://staging-cn.vuejs.org/api/application.html#create-app",target:"_blank",rel:"noopener noreferrer"},h=n("code",null,"router",-1),b={href:"https://router.vuejs.org/zh/api/index.html#createrouter",target:"_blank",rel:"noopener noreferrer"},f=n("code",null,"siteData",-1),E=n("p",null,[n("code",null,"enhance"),s(" 函数会在客户端应用创建后被调用,你可以对 Vue 应用添加各种能力。")],-1),_=n("h3",{id:"注册-vue-组件",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#注册-vue-组件","aria-hidden":"true"},"#"),s(" 注册 Vue 组件")],-1),g={href:"https://staging-cn.vuejs.org/api/application.html#app-component",target:"_blank",rel:"noopener noreferrer"},A=o(`
enhance
函数既可以是同步的,也可以是异步的。它接收一个 Context 参数,包含以下属性:import { defineClientConfig } from '@vuepress/client' +import MyComponent from './MyComponent.vue' + +export default defineClientConfig({ + enhance({ app }) { + app.component('MyComponent', MyComponent) + }, +}) +
# 使用不支持 SSR 的功能
VuePress 会在构建过程中生成一个 SSR 应用,用以对页面进行预渲染。一般而言,如果一段代码在客户端应用 Mount 之前就使用了浏览器或 DOM API ,我们就认为其对 SSR 不友好,即不支持 SSR 。
`,3),F=n("code",null,"enhance",-1),x=n("code",null,"__VUEPRESS_SSR__",-1),k=o(`import { defineClientConfig } from '@vuepress/client' + +export default defineClientConfig({ + async enhance() { + if (!__VUEPRESS_SSR__) { + const nonSsrFriendlyModule = await import('non-ssr-friendly-module') + // ... + } + }, +}) +
# 使用 Router 方法
`,2),S={href:"https://router.vuejs.org/zh/api/index.html#router-%E6%96%B9%E6%B3%95",target:"_blank",rel:"noopener noreferrer"},R=o(`import { defineClientConfig } from '@vuepress/client' + +export default defineClientConfig({ + enhance({ router }) { + router.beforeEach((to) => { + console.log('before navigation') + }) + + router.afterEach((to) => { + console.log('after navigation') + }) + }, +}) +
注意
我们不推荐使用
addRoute
方法来添加动态路由,因为这些路由记录 不会 在构建模式中被预渲染出来。当然,如果你了解了这种用法的缺点,你还是可以这样使用。
# setup
`,3),z=n("code",null,"setup",-1),M={href:"https://staging-cn.vuejs.org/api/composition-api-setup.html",target:"_blank",rel:"noopener noreferrer"},V=n("h3",{id:"使用组合式-api",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#使用组合式-api","aria-hidden":"true"},"#"),s(" 使用组合式 API")],-1),B=n("code",null,"setup",-1),P={href:"https://staging-cn.vuejs.org/api/composition-api-setup.html",target:"_blank",rel:"noopener noreferrer"},j=o(`import { defineClientConfig } from '@vuepress/client' +import { provide, ref } from 'vue' +import { useRoute, useRouter } from 'vue-router' + +export default defineClientConfig({ + setup() { + // 获取当前的路由位置 + const route = useRoute() + // 或者 vue-router 实例 + const router = useRouter() + // 供给一个值,可以被布局、页面和其他组件注入 + const count = ref(0) + provide('count', count) + }, +}) +
# 使用不支持 SSR 的功能
`,2),I=n("code",null,"setup",-1),L=n("code",null,"__VUEPRESS_SSR__",-1),O={href:"https://staging-cn.vuejs.org/api/composition-api-lifecycle.html#onmounted",target:"_blank",rel:"noopener noreferrer"},w=o(`import { defineClientConfig } from '@vuepress/client' +import { onMounted } from 'vue' + +export default defineClientConfig({ + setup() { + onMounted(() => { + // 在 mounted 之后使用 DOM API + document.querySelector('#app') + }) + }, +}) +
# layouts
`,2),H=n("code",null,"layouts",-1),N=o(`import { defineClientConfig } from '@vuepress/client' +import MyLayout from './layouts/MyLayout.vue' + +export default defineClientConfig({ + layouts: { + MyLayout, + }, +}) +
# rootComponents
rootComponents
是一个组件数组,它们将会直接被放置在客户端 Vue 应用的根节点下。该选项的典型使用方式就是放置一些全局的 UI 组件,比如全局弹窗等:
`,5);function U(G,T){const l=t("RouterLink"),p=t("ExternalLinkIcon");return c(),i("div",null,[d,n("p",null,[s("你可以直接在你的项目中使用 "),a(l,{to:"/zh/guide/configuration.html#%E5%AE%A2%E6%88%B7%E7%AB%AF%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"},{default:e(()=>[s("客户端配置文件")]),_:1}),s(" 。或者,在你的插件或者主题中,使用 "),a(l,{to:"/zh/reference/plugin-api.html#clientconfigfile"},{default:e(()=>[s("clientConfigFile")]),_:1}),s(" Hook 来指定客户端配置文件的路径:")]),y,n("p",null,[s("在客户端配置文件中,"),C,s(" 包提供了一个 "),a(l,{to:"/zh/reference/client-api.html#defineclientconfig"},{default:e(()=>[s("defineClientConfig")]),_:1}),s(" 函数来帮助你定义客户端配置:")]),u,n("ul",null,[n("li",null,[v,s(" 是由 "),n("a",m,[s("createApp"),a(p)]),s(" 创建的 Vue 应用实例。")]),n("li",null,[h,s(" 是由 "),n("a",b,[s("createRouter"),a(p)]),s(" 创建的路由实例。")]),n("li",null,[f,s(" 是一个根据用户配置生成的 Ref 对象,包含 "),a(l,{to:"/zh/reference/config.html#base"},{default:e(()=>[s("base")]),_:1}),s(", "),a(l,{to:"/zh/reference/config.html#lang"},{default:e(()=>[s("lang")]),_:1}),s(", "),a(l,{to:"/zh/reference/config.html#title"},{default:e(()=>[s("title")]),_:1}),s(", "),a(l,{to:"/zh/reference/config.html#description"},{default:e(()=>[s("description")]),_:1}),s(", "),a(l,{to:"/zh/reference/config.html#head"},{default:e(()=>[s("head")]),_:1}),s(" 和 "),a(l,{to:"/zh/reference/config.html#locales"},{default:e(()=>[s("locales")]),_:1}),s("。")])]),E,_,n("p",null,[s("你可以通过 "),n("a",g,[s("app.component"),a(p)]),s(" 方法来注册 Vue 全局组件:")]),A,n("p",null,[s("我们已经提供了一个 "),a(l,{to:"/zh/reference/components.html#clientonly"},{default:e(()=>[s("ClientOnly")]),_:1}),s(" 组件来包裹不支持 SSR 的内容。")]),n("p",null,[s("在 "),F,s(" 函数中,你可以使用 "),a(l,{to:"/zh/reference/client-api.html#ssr"},{default:e(()=>[x]),_:1}),s(" 标记来处理这种情况。")]),k,n("p",null,[s("你可以使用 vue-router 提供的 "),n("a",S,[s("Router 方法"),a(p)]),s(" 。例如,添加导航钩子:")]),R,n("p",null,[z,s(" 函数会在客户端 Vue 应用的 "),n("a",M,[s("setup"),a(p)]),s(" Hook 中被调用。")]),V,n("p",null,[s("你可以把 "),B,s(" 函数当作根组件的 "),n("a",P,[s("setup"),a(p)]),s(" Hook 中的一部分。因此,所有的组合式 API 都可以在这里使用。")]),j,n("p",null,[s("在 "),I,s(" 函数中,"),a(l,{to:"/zh/reference/client-api.html#ssr"},{default:e(()=>[L]),_:1}),s(" 标记同样可用。")]),n("p",null,[s("使用不支持 SSR 的功能的另一种方式就是将他们放在 "),n("a",O,[s("onMounted"),a(p)]),s(" Hook 中:")]),w,n("p",null,[H,s(" 配置项用于设置布局组件。你在此处注册布局后,用户就可以通过 "),a(l,{to:"/zh/reference/frontmatter.html#layout"},{default:e(()=>[s("layout")]),_:1}),s(" frontmatter 来使用它们。")]),N])}const J=r(D,[["render",U],["__file","usage-of-client-config.html.vue"]]);export{J as default}; diff --git a/assets/usage-of-client-config.html-sg8S__SR.js b/assets/usage-of-client-config.html-sg8S__SR.js new file mode 100644 index 000000000..fa0c5575c --- /dev/null +++ b/assets/usage-of-client-config.html-sg8S__SR.js @@ -0,0 +1,87 @@ +import{_ as r,r as t,o as c,c as i,a as n,b as s,d as a,w as l,e as o}from"./app-eU2v8o1B.js";const D={},d=n("h1",{id:"usage-of-client-config",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#usage-of-client-config","aria-hidden":"true"},"#"),s(" Usage of Client Config")],-1),y=o(`import { defineClientConfig } from '@vuepress/client' +import GlobalPopup from './components/GlobalPopup.vue' + +export default defineClientConfig({ + rootComponents: [GlobalPopup], +}) +
`,1),u=n("code",null,"@vuepress/client",-1),C=o(`import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +const pluginOrTheme = { + clientConfigFile: path.resolve(__dirname, './path/to/clientConfig.ts'), +} +
import { defineClientConfig } from '@vuepress/client' + +export default defineClientConfig({ + enhance({ app, router, siteData }) {}, + setup() {}, + layouts: {}, + rootComponents: [], +}) +
# enhance
The
`,3),v=n("code",null,"app",-1),m={href:"https://vuejs.org/api/application.html#createapp",target:"_blank",rel:"noopener noreferrer"},h=n("code",null,"router",-1),f={href:"https://router.vuejs.org/api/#createrouter",target:"_blank",rel:"noopener noreferrer"},b=n("code",null,"siteData",-1),g=n("p",null,[s("The "),n("code",null,"enhance"),s(" function will be invoked after the client app is created. It's possible to implement any enhancements to the Vue application.")],-1),_=n("h3",{id:"register-vue-components",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#register-vue-components","aria-hidden":"true"},"#"),s(" Register Vue Components")],-1),E={href:"https://vuejs.org/api/application.html#app-component",target:"_blank",rel:"noopener noreferrer"},F=o(`enhance
function could be either synchronous or asynchronous. It accepts a context param with following properties:import { defineClientConfig } from '@vuepress/client' +import MyComponent from './MyComponent.vue' + +export default defineClientConfig({ + enhance({ app }) { + app.component('MyComponent', MyComponent) + }, +}) +
# Use Non-SSR-Friendly Features
VuePress will generate a SSR application to pre-render pages during build. Generally speaking, if a code snippet is using Browser / DOM APIs before client app is mounted, we call it non-SSR-friendly.
`,3),A=n("code",null,"enhance",-1),k=n("code",null,"__VUEPRESS_SSR__",-1),x=o(`import { defineClientConfig } from '@vuepress/client' + +export default defineClientConfig({ + async enhance() { + if (!__VUEPRESS_SSR__) { + const nonSsrFriendlyModule = await import('non-ssr-friendly-module') + // ... + } + }, +}) +
# Use Router Methods
`,2),S={href:"https://router.vuejs.org/api/#router-methods",target:"_blank",rel:"noopener noreferrer"},R=o(`import { defineClientConfig } from '@vuepress/client' + +export default defineClientConfig({ + enhance({ router }) { + router.beforeEach((to) => { + console.log('before navigation') + }) + + router.afterEach((to) => { + console.log('after navigation') + }) + }, +}) +
WARNING
It's not recommended to use
addRoute
method to add dynamic routes here, because those routes will NOT be pre-rendered in build mode.But you can still do that if you understand the drawback.
# setup
`,3),w=n("code",null,"setup",-1),M={href:"https://vuejs.org/api/composition-api-setup.html",target:"_blank",rel:"noopener noreferrer"},I=n("h3",{id:"use-composition-api",tabindex:"-1"},[n("a",{class:"header-anchor",href:"#use-composition-api","aria-hidden":"true"},"#"),s(" Use Composition API")],-1),V=n("code",null,"setup",-1),P={href:"https://vuejs.org/api/composition-api-setup.html",target:"_blank",rel:"noopener noreferrer"},j=o(`import { defineClientConfig } from '@vuepress/client' +import { provide, ref } from 'vue' +import { useRoute, useRouter } from 'vue-router' + +export default defineClientConfig({ + setup() { + // get the current route location + const route = useRoute() + // get the vue-router instance + const router = useRouter() + // provide a value that can be injected by layouts, pages and other components + const count = ref(0) + provide('count', count) + }, +}) +
# Use Non-SSR-Friendly Features
`,2),T=n("code",null,"setup",-1),N=n("code",null,"__VUEPRESS_SSR__",-1),U={href:"https://vuejs.org/api/composition-api-lifecycle.html#onmounted",target:"_blank",rel:"noopener noreferrer"},L=o(`import { defineClientConfig } from '@vuepress/client' +import { onMounted } from 'vue' + +export default defineClientConfig({ + setup() { + onMounted(() => { + // use DOM API after mounted + document.querySelector('#app') + }) + }, +}) +
# layouts
`,2),B=n("code",null,"layouts",-1),O=o(`import { defineClientConfig } from '@vuepress/client' +import MyLayout from './layouts/MyLayout.vue' + +export default defineClientConfig({ + layouts: { + MyLayout, + }, +}) +
# rootComponents
The
rootComponents
is a components array to be placed directly into the root node of the client vue app.Typical usage of this option is to put some global UI components, like global popup or so:
`,5);function G(Y,W){const e=t("RouterLink"),p=t("ExternalLinkIcon");return c(),i("div",null,[d,n("p",null,[s("You can make use of the "),a(e,{to:"/guide/configuration.html#client-config-file"},{default:l(()=>[s("client config file")]),_:1}),s(" directly in your project, or specify the file path in your plugin or theme via "),a(e,{to:"/reference/plugin-api.html#clientconfigfile"},{default:l(()=>[s("clientConfigFile")]),_:1}),s(" hook:")]),y,n("p",null,[s("Inside the client config file, "),u,s(" package provides a helper function "),a(e,{to:"/reference/client-api.html#defineclientconfig"},{default:l(()=>[s("defineClientConfig")]),_:1}),s(" to help you define the client config:")]),C,n("ul",null,[n("li",null,[v,s(" is the Vue application instance that created by "),n("a",m,[s("createApp"),a(p)]),s(".")]),n("li",null,[h,s(" is the Vue Router instance that created by "),n("a",f,[s("createRouter"),a(p)]),s(".")]),n("li",null,[b,s(" is a ref of an object that generated from user config, including "),a(e,{to:"/reference/config.html#base"},{default:l(()=>[s("base")]),_:1}),s(", "),a(e,{to:"/reference/config.html#lang"},{default:l(()=>[s("lang")]),_:1}),s(", "),a(e,{to:"/reference/config.html#title"},{default:l(()=>[s("title")]),_:1}),s(", "),a(e,{to:"/reference/config.html#description"},{default:l(()=>[s("description")]),_:1}),s(", "),a(e,{to:"/reference/config.html#head"},{default:l(()=>[s("head")]),_:1}),s(" and "),a(e,{to:"/reference/config.html#locales"},{default:l(()=>[s("locales")]),_:1}),s(".")])]),g,_,n("p",null,[s("You can register global Vue components via the "),n("a",E,[s("app.component"),a(p)]),s(" method:")]),F,n("p",null,[s("We already provides a "),a(e,{to:"/reference/components.html#clientonly"},{default:l(()=>[s("ClientOnly")]),_:1}),s(" component to wrap non-SSR-friendly content.")]),n("p",null,[s("In the "),A,s(" function, you can make use of the "),a(e,{to:"/reference/client-api.html#ssr"},{default:l(()=>[k]),_:1}),s(" flag for that purpose.")]),x,n("p",null,[s("You can make use of the "),n("a",S,[s("Router Methods"),a(p)]),s(" that provided by vue-router. For example, add navigation guard:")]),R,n("p",null,[s("The "),w,s(" function would be invoked inside the "),n("a",M,[s("setup"),a(p)]),s(" hook of the client vue app.")]),I,n("p",null,[s("You can take the "),V,s(" function as part of the "),n("a",P,[s("setup"),a(p)]),s(" hook of the root component. Thus, all composition APIs are available here.")]),j,n("p",null,[s("In the "),T,s(" function, the "),a(e,{to:"/reference/client-api.html#ssr"},{default:l(()=>[N]),_:1}),s(" flag is also available.")]),n("p",null,[s("Another way to use non-ssr-friendly features is to put them inside the "),n("a",U,[s("onMounted"),a(p)]),s(" hook:")]),L,n("p",null,[s("The "),B,s(" options is to set layout components. After layout components are registered here, users can use it via "),a(e,{to:"/reference/frontmatter.html#layout"},{default:l(()=>[s("layout")]),_:1}),s(" frontmatter.")]),O])}const z=r(D,[["render",G],["__file","usage-of-client-config.html.vue"]]);export{z as default}; diff --git a/assets/vite.html-ATywsxtj.js b/assets/vite.html-ATywsxtj.js new file mode 100644 index 000000000..cb5e7f7d0 --- /dev/null +++ b/assets/vite.html-ATywsxtj.js @@ -0,0 +1,11 @@ +import{_ as p,r as a,o as r,c as t,d as n,a as s,b as e,e as i}from"./app-eU2v8o1B.js";const c={},d=s("h1",{id:"vite",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#vite","aria-hidden":"true"},"#"),e(" Vite")],-1),u={href:"https://www.npmjs.com/package/@vuepress/bundler-vite",target:"_blank",rel:"noopener noreferrer"},D={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},v=i(`import { defineClientConfig } from '@vuepress/client' +import GlobalPopup from './components/GlobalPopup.vue' + +export default defineClientConfig({ + rootComponents: [GlobalPopup], +}) +
npm i -D @vuepress/bundler-vite@next +
# 配置项
Vite 打包工具的配置项:
import { viteBundler } from '@vuepress/bundler-vite' +import { defineUserConfig } from '@vuepress/cli' + +export default defineUserConfig({ + bundler: viteBundler({ + viteOptions: {}, + vuePluginOptions: {}, + }), +}) +
# viteOptions
`,5),h=s("li",null,[s("p",null,"详情:"),s("p",null,"接收 Vite 的所有配置项。")],-1),_=s("p",null,"参考:",-1),y={href:"https://cn.vitejs.dev/config/",target:"_blank",rel:"noopener noreferrer"},m=s("h3",{id:"vuepluginoptions",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#vuepluginoptions","aria-hidden":"true"},"#"),e(" vuePluginOptions")],-1),C=s("p",null,"详情:",-1),b={href:"https://www.npmjs.com/package/@vitejs/plugin-vue",target:"_blank",rel:"noopener noreferrer"},f=s("p",null,"参考:",-1),g={href:"https://cn.vitejs.dev/plugins/#vitejsplugin-vue",target:"_blank",rel:"noopener noreferrer"};function k(E,x){const o=a("NpmBadge"),l=a("ExternalLinkIcon");return r(),t("div",null,[d,n(o,{package:"@vuepress/bundler-vite"}),s("p",null,[e("Vite 打包工具是由 "),s("a",u,[e("@vuepress/bundler-vite"),n(l)]),e(" 包提供的。它是 "),s("a",D,[e("vuepress"),n(l)]),e(" 包的依赖之一,当然你也可以单独安装它:")]),v,s("ul",null,[h,s("li",null,[_,s("ul",null,[s("li",null,[s("a",y,[e("Vite > Config"),n(l)])])])])]),m,s("ul",null,[s("li",null,[C,s("p",null,[e("接收 "),s("a",b,[e("@vitejs/plugin-vue"),n(l)]),e(" 的所有配置项。")])]),s("li",null,[f,s("ul",null,[s("li",null,[s("a",g,[e("Vite > 插件 > 官方插件"),n(l)])])])])])])}const w=p(c,[["render",k],["__file","vite.html.vue"]]);export{w as default}; diff --git a/assets/vite.html-GESTQK3l.js b/assets/vite.html-GESTQK3l.js new file mode 100644 index 000000000..c6509511b --- /dev/null +++ b/assets/vite.html-GESTQK3l.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-cf5a290e","path":"/reference/bundler/vite.html","title":"Vite","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"viteOptions","slug":"viteoptions","link":"#viteoptions","children":[]},{"level":3,"title":"vuePluginOptions","slug":"vuepluginoptions","link":"#vuepluginoptions","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/bundler/vite.md"}');export{e as data}; diff --git a/assets/vite.html-MchlPc-W.js b/assets/vite.html-MchlPc-W.js new file mode 100644 index 000000000..331c09db1 --- /dev/null +++ b/assets/vite.html-MchlPc-W.js @@ -0,0 +1,11 @@ +import{_ as p,r as a,o as t,c as i,d as n,a as s,b as e,e as r}from"./app-eU2v8o1B.js";const c={},d=s("h1",{id:"vite",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#vite","aria-hidden":"true"},"#"),e(" Vite")],-1),u={href:"https://www.npmjs.com/package/@vuepress/bundler-vite",target:"_blank",rel:"noopener noreferrer"},D={href:"https://www.npmjs.com/package/vuepress",target:"_blank",rel:"noopener noreferrer"},v=r(`npm i -D @vuepress/bundler-vite@next +
# Options
Reference of vite bundler options:
import { viteBundler } from '@vuepress/bundler-vite' +import { defineUserConfig } from '@vuepress/cli' + +export default defineUserConfig({ + bundler: viteBundler({ + viteOptions: {}, + vuePluginOptions: {}, + }), +}) +
# viteOptions
`,5),h=s("li",null,[s("p",null,"Details:"),s("p",null,"Accepts all options of Vite.")],-1),y=s("p",null,"Also see:",-1),_={href:"https://vitejs.dev/config/",target:"_blank",rel:"noopener noreferrer"},b=s("h3",{id:"vuepluginoptions",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#vuepluginoptions","aria-hidden":"true"},"#"),e(" vuePluginOptions")],-1),m=s("p",null,"Details:",-1),f={href:"https://www.npmjs.com/package/@vitejs/plugin-vue",target:"_blank",rel:"noopener noreferrer"},C=s("p",null,"Also see:",-1),g={href:"https://vitejs.dev/plugins/#vitejs-plugin-vue",target:"_blank",rel:"noopener noreferrer"};function k(E,x){const o=a("NpmBadge"),l=a("ExternalLinkIcon");return t(),i("div",null,[d,n(o,{package:"@vuepress/bundler-vite"}),s("p",null,[e("Vite bundler is provided by "),s("a",u,[e("@vuepress/bundler-vite"),n(l)]),e(" package. It is a dependency of the "),s("a",D,[e("vuepress"),n(l)]),e(" package, and you can also install it separately.")]),v,s("ul",null,[h,s("li",null,[y,s("ul",null,[s("li",null,[s("a",_,[e("Vite > Config"),n(l)])])])])]),b,s("ul",null,[s("li",null,[m,s("p",null,[e("Accepts all options of "),s("a",f,[e("@vitejs/plugin-vue"),n(l)]),e(".")])]),s("li",null,[C,s("ul",null,[s("li",null,[s("a",g,[e("Vite > Plugins > Official Plugins"),n(l)])])])])])])}const w=p(c,[["render",k],["__file","vite.html.vue"]]);export{w as default}; diff --git a/assets/vite.html-UcIosjal.js b/assets/vite.html-UcIosjal.js new file mode 100644 index 000000000..4ea0ed972 --- /dev/null +++ b/assets/vite.html-UcIosjal.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-6ff623ea","path":"/zh/reference/bundler/vite.html","title":"Vite","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"viteOptions","slug":"viteoptions","link":"#viteoptions","children":[]},{"level":3,"title":"vuePluginOptions","slug":"vuepluginoptions","link":"#vuepluginoptions","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/bundler/vite.md"}');export{e as data}; diff --git a/assets/vuepress-core-process-9C1P9KT4.js b/assets/vuepress-core-process-9C1P9KT4.js new file mode 100644 index 000000000..948e92ec3 --- /dev/null +++ b/assets/vuepress-core-process-9C1P9KT4.js @@ -0,0 +1 @@ +const e="/images/guide/vuepress-architecture-overview.png",s="/images/guide/vuepress-core-process.png";export{e as _,s as a}; diff --git a/assets/webpack.html--2xfMMIX.js b/assets/webpack.html--2xfMMIX.js new file mode 100644 index 000000000..96493b5a2 --- /dev/null +++ b/assets/webpack.html--2xfMMIX.js @@ -0,0 +1,11 @@ +import{_ as i,r as a,o as c,c as p,d as l,a as e,b as s,w as d,e as o}from"./app-eU2v8o1B.js";const u={},h=e("h1",{id:"webpack",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#webpack","aria-hidden":"true"},"#"),s(" Webpack")],-1),_={href:"https://www.npmjs.com/package/@vuepress/bundler-webpack",target:"_blank",rel:"noopener noreferrer"},b={href:"https://www.npmjs.com/package/vuepress-webpack",target:"_blank",rel:"noopener noreferrer"},v=o(`npm i -D @vuepress/bundler-webpack@next +
# 配置项
Webpack 打包工具的配置项:
import { webpackBundler } from '@vuepress/bundler-webpack' +import { defineUserConfig } from '@vuepress/cli' + +export default defineUserConfig({ + bundler: webpackBundler({ + postcss: {}, + vue: {}, + }), +}) +
# configureWebpack
类型:
(config: WebpackConfiguration, isServer: boolean, isBuild: boolean) => WebpackConfiguration | void
详情:
用于修改内部的 Webpack 配置。
该配置项接收一个函数,该函数的第一个参数是 Webpack 配置对象,第二个参数是
isServer
标志位,第三个参数是isBuild
标志位。# chainWebpack
`,7),D=e("li",null,[e("p",null,[s("类型: "),e("code",null,"(config: WebpackChainConfig, isServer: boolean, isBuild: boolean) => void")])],-1),k=e("p",null,"详情:",-1),f={href:"https://github.com/mozilla-neutrino/webpack-chain",target:"_blank",rel:"noopener noreferrer"},m=e("p",null,[s("该配置项接收一个函数,该函数的第一个参数是由 "),e("code",null,"webpack-chain"),s(" 提供的 "),e("code",null,"Config"),s(" 实例,第二个参数是 "),e("code",null,"isServer"),s(" 标志位,第三个参数是 "),e("code",null,"isBuild"),s(" 标志位。")],-1),g=e("h3",{id:"devserversetupmiddlewares",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#devserversetupmiddlewares","aria-hidden":"true"},"#"),s(" devServerSetupMiddlewares")],-1),y=e("li",null,[e("p",null,[s("类型: "),e("code",null,"(middlewares: Middleware[], devServer: Server) => Middleware[]")])],-1),w=e("li",null,[e("p",null,"详情:"),e("p",null,[s("在 Webpack 的 "),e("code",null,"devServer.setupMiddlewares"),s(" 中调用的 Hook 。")]),e("p",null,[s("函数的参数即是 "),e("code",null,"devServer.setupMiddlewares"),s(" 的参数。")])],-1),C=e("p",null,"参考:",-1),x={href:"https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares",target:"_blank",rel:"noopener noreferrer"},S=e("h3",{id:"vue",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#vue","aria-hidden":"true"},"#"),s(" vue")],-1),E=e("li",null,[e("p",null,[s("类型: "),e("code",null,"VueLoaderOptions")])],-1),W=e("li",null,[e("p",null,"详情:"),e("p",null,[e("code",null,"vue-loader"),s(" 的配置项。")])],-1),B=e("p",null,"参考:",-1),L={href:"https://vue-loader.vuejs.org/zh/options.html",target:"_blank",rel:"noopener noreferrer"},O=e("h3",{id:"postcss",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#postcss","aria-hidden":"true"},"#"),s(" postcss")],-1),A=e("li",null,[e("p",null,[s("类型: "),e("code",null,"PostcssLoaderOptions")])],-1),M=e("li",null,[e("p",null,"详情:"),e("p",null,[e("code",null,"postcss-loader"),s(" 的配置项。")])],-1),N=e("p",null,"参考:",-1),V={href:"https://github.com/webpack-contrib/postcss-loader#options",target:"_blank",rel:"noopener noreferrer"},j=e("h3",{id:"stylus",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#stylus","aria-hidden":"true"},"#"),s(" stylus")],-1),F=e("li",null,[e("p",null,[s("类型: "),e("code",null,"StylusLoaderOptions")])],-1),P=e("li",null,[e("p",null,"详情:"),e("p",null,[e("code",null,"stylus-loader"),s(" 的配置项。")])],-1),z=e("p",null,"参考:",-1),H={href:"https://github.com/webpack-contrib/stylus-loader#options",target:"_blank",rel:"noopener noreferrer"},I=e("h3",{id:"scss",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#scss","aria-hidden":"true"},"#"),s(" scss")],-1),R=e("li",null,[e("p",null,[s("类型: "),e("code",null,"SassLoaderOptions")])],-1),U=e("li",null,[e("p",null,"详情:"),e("p",null,[s("针对 "),e("code",null,".scss"),s(" 文件的 "),e("code",null,"sass-loader"),s(" 的配置项。")])],-1),T=e("p",null,"参考:",-1),q={href:"https://github.com/webpack-contrib/sass-loader#options",target:"_blank",rel:"noopener noreferrer"},G=e("h3",{id:"sass",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#sass","aria-hidden":"true"},"#"),s(" sass")],-1),J=e("li",null,[e("p",null,[s("类型: "),e("code",null,"SassLoaderOptions")])],-1),K=e("li",null,[e("p",null,"详情:"),e("p",null,[s("针对 "),e("code",null,".sass"),s(" 文件的 "),e("code",null,"sass-loader"),s(" 的配置项。")])],-1),Q=e("p",null,"参考:",-1),X={href:"https://github.com/webpack-contrib/sass-loader#options",target:"_blank",rel:"noopener noreferrer"},Y=e("h3",{id:"less",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#less","aria-hidden":"true"},"#"),s(" less")],-1),Z=e("li",null,[e("p",null,[s("类型: "),e("code",null,"LessLoaderOptions")])],-1),$=e("li",null,[e("p",null,"详情:"),e("p",null,[e("code",null,"less-loader"),s(" 的配置项。")])],-1),ee=e("p",null,"参考:",-1),se={href:"https://github.com/webpack-contrib/less-loader#options",target:"_blank",rel:"noopener noreferrer"},le=o('# evergreen
类型:
boolean
默认值:
true
详情:
如果你的对象只有那些 “常青树” 浏览器,你可以将其设置成
true
。这将会禁用一些转译过程和 Polyfills ,带来更快的构建速度和更小的文件体积。# 常见问题
# 在修改
',4),ne=e("code",null,"base",-1),ae=e("code",null,"base",-1),oe=e("h3",{id:"使用默认主题",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#使用默认主题","aria-hidden":"true"},"#"),s(" 使用默认主题")],-1),re={href:"https://sass-lang.com/",target:"_blank",rel:"noopener noreferrer"},te={href:"https://pnpm.io/",target:"_blank",rel:"noopener noreferrer"},ie={href:"https://www.npmjs.com/package/sass-loader",target:"_blank",rel:"noopener noreferrer"};function ce(pe,de){const r=a("NpmBadge"),n=a("ExternalLinkIcon"),t=a("RouterLink");return c(),p("div",null,[h,l(r,{package:"@vuepress/bundler-webpack"}),e("p",null,[s("Webpack 打包工具是由 "),e("a",_,[s("@vuepress/bundler-webpack"),l(n)]),s(" 包提供的。它是 "),e("a",b,[s("vuepress-webpack"),l(n)]),s(" 包的依赖之一,当然你也可以单独安装它:")]),v,e("ul",null,[D,e("li",null,[k,e("p",null,[s("通过 "),e("a",f,[s("webpack-chain"),l(n)]),s(" 来修改内部的 Webpack 配置。")]),m])]),g,e("ul",null,[y,w,e("li",null,[C,e("ul",null,[e("li",null,[e("a",x,[s("Webpack > Configuration > DevServer > devServer.setupMiddlewares"),l(n)])])])])]),S,e("ul",null,[E,W,e("li",null,[B,e("ul",null,[e("li",null,[e("a",L,[s("vue-loader > 选项参考"),l(n)])])])])]),O,e("ul",null,[A,M,e("li",null,[N,e("ul",null,[e("li",null,[e("a",V,[s("postcss-loader > Options"),l(n)])])])])]),j,e("ul",null,[F,P,e("li",null,[z,e("ul",null,[e("li",null,[e("a",H,[s("stylus-loader > Options"),l(n)])])])])]),I,e("ul",null,[R,U,e("li",null,[T,e("ul",null,[e("li",null,[e("a",q,[s("sass-loader > Options"),l(n)])])])])]),G,e("ul",null,[J,K,e("li",null,[Q,e("ul",null,[e("li",null,[e("a",X,[s("sass-loader > Options"),l(n)])])])])]),Y,e("ul",null,[Z,$,e("li",null,[ee,e("ul",null,[e("li",null,[e("a",se,[s("less-loader > Options"),l(n)])])])])]),le,e("p",null,[s("与 Vite 不同, Webpack 不会为 Public 文件自动处理 "),ne,s("。因此如果你修改了网站的 "),ae,s(",建议你在引用 Public 图片文件时使用 "),l(t,{to:"/zh/guide/assets.html#base-helper"},{default:d(()=>[s("Base Helper")]),_:1}),s("。")]),oe,e("p",null,[s("默认主题使用 "),e("a",re,[s("SASS"),l(n)]),s(" 作为 CSS 预处理器,因此你在使用 Webpack 时(特别是在使用 "),e("a",te,[s("pnpm"),l(n)]),s(" 时)可能需要手动安装 "),e("a",ie,[s("sass-loader"),l(n)]),s(" 来确保其正常工作。")])])}const he=i(u,[["render",ce],["__file","webpack.html.vue"]]);export{he as default}; diff --git a/assets/webpack.html-0Bcnkx8B.js b/assets/webpack.html-0Bcnkx8B.js new file mode 100644 index 000000000..f59d6b4d3 --- /dev/null +++ b/assets/webpack.html-0Bcnkx8B.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-d4319af0","path":"/reference/bundler/webpack.html","title":"Webpack","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Options","slug":"options","link":"#options","children":[{"level":3,"title":"configureWebpack","slug":"configurewebpack","link":"#configurewebpack","children":[]},{"level":3,"title":"chainWebpack","slug":"chainwebpack","link":"#chainwebpack","children":[]},{"level":3,"title":"devServerSetupMiddlewares","slug":"devserversetupmiddlewares","link":"#devserversetupmiddlewares","children":[]},{"level":3,"title":"vue","slug":"vue","link":"#vue","children":[]},{"level":3,"title":"postcss","slug":"postcss","link":"#postcss","children":[]},{"level":3,"title":"stylus","slug":"stylus","link":"#stylus","children":[]},{"level":3,"title":"scss","slug":"scss","link":"#scss","children":[]},{"level":3,"title":"sass","slug":"sass","link":"#sass","children":[]},{"level":3,"title":"less","slug":"less","link":"#less","children":[]},{"level":3,"title":"evergreen","slug":"evergreen","link":"#evergreen","children":[]}]},{"level":2,"title":"FAQ","slug":"faq","link":"#faq","children":[{"level":3,"title":"Referencing Public Files after Changing base","slug":"referencing-public-files-after-changing-base","link":"#referencing-public-files-after-changing-base","children":[]},{"level":3,"title":"Using with Default Theme","slug":"using-with-default-theme","link":"#using-with-default-theme","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/bundler/webpack.md"}');export{e as data}; diff --git a/assets/webpack.html-Ynkv9VBN.js b/assets/webpack.html-Ynkv9VBN.js new file mode 100644 index 000000000..6d6e01f65 --- /dev/null +++ b/assets/webpack.html-Ynkv9VBN.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-dde74f12","path":"/zh/reference/bundler/webpack.html","title":"Webpack","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"configureWebpack","slug":"configurewebpack","link":"#configurewebpack","children":[]},{"level":3,"title":"chainWebpack","slug":"chainwebpack","link":"#chainwebpack","children":[]},{"level":3,"title":"devServerSetupMiddlewares","slug":"devserversetupmiddlewares","link":"#devserversetupmiddlewares","children":[]},{"level":3,"title":"vue","slug":"vue","link":"#vue","children":[]},{"level":3,"title":"postcss","slug":"postcss","link":"#postcss","children":[]},{"level":3,"title":"stylus","slug":"stylus","link":"#stylus","children":[]},{"level":3,"title":"scss","slug":"scss","link":"#scss","children":[]},{"level":3,"title":"sass","slug":"sass","link":"#sass","children":[]},{"level":3,"title":"less","slug":"less","link":"#less","children":[]},{"level":3,"title":"evergreen","slug":"evergreen","link":"#evergreen","children":[]}]},{"level":2,"title":"常见问题","slug":"常见问题","link":"#常见问题","children":[{"level":3,"title":"在修改 base 后引用 Public 文件","slug":"在修改-base-后引用-public-文件","link":"#在修改-base-后引用-public-文件","children":[]},{"level":3,"title":"使用默认主题","slug":"使用默认主题","link":"#使用默认主题","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/bundler/webpack.md"}');export{e as data}; diff --git a/assets/webpack.html-jpspO8kF.js b/assets/webpack.html-jpspO8kF.js new file mode 100644 index 000000000..a7daaec9f --- /dev/null +++ b/assets/webpack.html-jpspO8kF.js @@ -0,0 +1,11 @@ +import{_ as i,r as a,o as c,c as p,d as n,a as e,b as s,w as d,e as o}from"./app-eU2v8o1B.js";const u={},h=e("h1",{id:"webpack",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#webpack","aria-hidden":"true"},"#"),s(" Webpack")],-1),_={href:"https://www.npmjs.com/package/@vuepress/bundler-webpack",target:"_blank",rel:"noopener noreferrer"},b={href:"https://www.npmjs.com/package/vuepress-webpack",target:"_blank",rel:"noopener noreferrer"},f=o(`base
后引用 Public 文件npm i -D @vuepress/bundler-webpack@next +
# Options
Reference of webpack bundler options:
import { webpackBundler } from '@vuepress/bundler-webpack' +import { defineUserConfig } from '@vuepress/cli' + +export default defineUserConfig({ + bundler: webpackBundler({ + postcss: {}, + vue: {}, + }), +}) +
# configureWebpack
`,5),g=e("li",null,[e("p",null,[s("Type: "),e("code",null,"(config: WebpackConfiguration, isServer: boolean, isBuild: boolean) => WebpackConfiguration | void")])],-1),D=e("p",null,"Details:",-1),v=e("p",null,"Edit the internal webpack config.",-1),k=e("code",null,"isServer",-1),y=e("code",null,"isBuild",-1),m={href:"https://github.com/survivejs/webpack-merge",target:"_blank",rel:"noopener noreferrer"},w=e("h3",{id:"chainwebpack",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#chainwebpack","aria-hidden":"true"},"#"),s(" chainWebpack")],-1),C=e("li",null,[e("p",null,[s("Type: "),e("code",null,"(config: WebpackChainConfig, isServer: boolean, isBuild: boolean) => void")])],-1),x=e("p",null,"Details:",-1),S={href:"https://github.com/mozilla-neutrino/webpack-chain",target:"_blank",rel:"noopener noreferrer"},E=e("p",null,[s("This option accepts a function that will receive a "),e("code",null,"Config"),s(" instance that provided by "),e("code",null,"webpack-chain"),s(" as the 1st argument an "),e("code",null,"isServer"),s(" flag as the 2nd argument and an "),e("code",null,"isBuild"),s(" flag as the 3rd argument.")],-1),O=e("h3",{id:"devserversetupmiddlewares",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#devserversetupmiddlewares","aria-hidden":"true"},"#"),s(" devServerSetupMiddlewares")],-1),A=e("li",null,[e("p",null,[s("Type: "),e("code",null,"(middlewares: Middleware[], devServer: Server) => Middleware[]")])],-1),T=e("li",null,[e("p",null,"Details:"),e("p",null,[s("A hook to be called in "),e("code",null,"devServer.setupMiddlewares"),s(" of webpack.")]),e("p",null,[s("The arguments of the function are those of "),e("code",null,"devServer.setupMiddlewares"),s(".")])],-1),B=e("p",null,"Also see:",-1),L={href:"https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares",target:"_blank",rel:"noopener noreferrer"},W=e("h3",{id:"vue",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#vue","aria-hidden":"true"},"#"),s(" vue")],-1),j=e("li",null,[e("p",null,[s("Type: "),e("code",null,"VueLoaderOptions")])],-1),F=e("li",null,[e("p",null,"Details:"),e("p",null,[s("Options for "),e("code",null,"vue-loader"),s(".")])],-1),M=e("p",null,"Also see:",-1),N={href:"https://vue-loader.vuejs.org/options.html",target:"_blank",rel:"noopener noreferrer"},V=e("h3",{id:"postcss",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#postcss","aria-hidden":"true"},"#"),s(" postcss")],-1),R=e("li",null,[e("p",null,[s("Type: "),e("code",null,"PostcssLoaderOptions")])],-1),U=e("li",null,[e("p",null,"Details:"),e("p",null,[s("Options for "),e("code",null,"postcss-loader"),s(".")])],-1),I=e("p",null,"Also see:",-1),q={href:"https://github.com/webpack-contrib/postcss-loader#options",target:"_blank",rel:"noopener noreferrer"},P=e("h3",{id:"stylus",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#stylus","aria-hidden":"true"},"#"),s(" stylus")],-1),z=e("li",null,[e("p",null,[s("Type: "),e("code",null,"StylusLoaderOptions")])],-1),H=e("li",null,[e("p",null,"Details:"),e("p",null,[s("Options for "),e("code",null,"stylus-loader"),s(".")])],-1),Q=e("p",null,"Also see:",-1),Y={href:"https://github.com/webpack-contrib/stylus-loader#options",target:"_blank",rel:"noopener noreferrer"},G=e("h3",{id:"scss",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#scss","aria-hidden":"true"},"#"),s(" scss")],-1),J=e("li",null,[e("p",null,[s("Type: "),e("code",null,"SassLoaderOptions")])],-1),K=e("li",null,[e("p",null,"Details:"),e("p",null,[s("Options for "),e("code",null,"sass-loader"),s(" for "),e("code",null,".scss"),s(" files.")])],-1),X=e("p",null,"Also see:",-1),Z={href:"https://github.com/webpack-contrib/sass-loader#options",target:"_blank",rel:"noopener noreferrer"},$=e("h3",{id:"sass",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#sass","aria-hidden":"true"},"#"),s(" sass")],-1),ee=e("li",null,[e("p",null,[s("Type: "),e("code",null,"SassLoaderOptions")])],-1),se=e("li",null,[e("p",null,"Details:"),e("p",null,[s("Options for "),e("code",null,"sass-loader"),s(" for "),e("code",null,".sass"),s(" files.")])],-1),ne=e("p",null,"Also see:",-1),le={href:"https://github.com/webpack-contrib/sass-loader#options",target:"_blank",rel:"noopener noreferrer"},ae=e("h3",{id:"less",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#less","aria-hidden":"true"},"#"),s(" less")],-1),oe=e("li",null,[e("p",null,[s("Type: "),e("code",null,"LessLoaderOptions")])],-1),te=e("li",null,[e("p",null,"Details:"),e("p",null,[s("Options for "),e("code",null,"less-loader"),s(".")])],-1),re=e("p",null,"Also see:",-1),ie={href:"https://github.com/webpack-contrib/less-loader#options",target:"_blank",rel:"noopener noreferrer"},ce=o('# evergreen
Type:
boolean
Default:
true
Details:
Set to
true
if you are only targeting evergreen browsers. This will disable some transpilation and polyfills, and result in faster builds and smaller files.# FAQ
# Referencing Public Files after Changing
',4),pe=e("code",null,"base",-1),de=e("code",null,"base",-1),ue=e("h3",{id:"using-with-default-theme",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#using-with-default-theme","aria-hidden":"true"},"#"),s(" Using with Default Theme")],-1),he={href:"https://sass-lang.com/",target:"_blank",rel:"noopener noreferrer"},_e={href:"https://www.npmjs.com/package/sass-loader",target:"_blank",rel:"noopener noreferrer"},be={href:"https://pnpm.io/",target:"_blank",rel:"noopener noreferrer"};function fe(ge,De){const t=a("NpmBadge"),l=a("ExternalLinkIcon"),r=a("RouterLink");return c(),p("div",null,[h,n(t,{package:"@vuepress/bundler-webpack"}),e("p",null,[s("Webpack bundler is provided by "),e("a",_,[s("@vuepress/bundler-webpack"),n(l)]),s(" package. It is a dependency of the "),e("a",b,[s("vuepress-webpack"),n(l)]),s(" package, and you can also install it separately.")]),f,e("ul",null,[g,e("li",null,[D,v,e("p",null,[s("This option accepts a function that will receive a webpack config object as the 1st argument, an "),k,s(" flag as the 2nd argument and an "),y,s(" flag as the 3rd argument. You can either mutate the config directly, or return an object to be merged by "),e("a",m,[s("webpack-merge"),n(l)]),s(".")])])]),w,e("ul",null,[C,e("li",null,[x,e("p",null,[s("Edit the internal webpack config with "),e("a",S,[s("webpack-chain"),n(l)]),s(".")]),E])]),O,e("ul",null,[A,T,e("li",null,[B,e("ul",null,[e("li",null,[e("a",L,[s("Webpack > Configuration > DevServer > devServer.setupMiddlewares"),n(l)])])])])]),W,e("ul",null,[j,F,e("li",null,[M,e("ul",null,[e("li",null,[e("a",N,[s("vue-loader > Options Reference"),n(l)])])])])]),V,e("ul",null,[R,U,e("li",null,[I,e("ul",null,[e("li",null,[e("a",q,[s("postcss-loader > Options"),n(l)])])])])]),P,e("ul",null,[z,H,e("li",null,[Q,e("ul",null,[e("li",null,[e("a",Y,[s("stylus-loader > Options"),n(l)])])])])]),G,e("ul",null,[J,K,e("li",null,[X,e("ul",null,[e("li",null,[e("a",Z,[s("sass-loader > Options"),n(l)])])])])]),$,e("ul",null,[ee,se,e("li",null,[ne,e("ul",null,[e("li",null,[e("a",le,[s("sass-loader > Options"),n(l)])])])])]),ae,e("ul",null,[oe,te,e("li",null,[re,e("ul",null,[e("li",null,[e("a",ie,[s("less-loader > Options"),n(l)])])])])]),ce,e("p",null,[s("Unlike Vite, Webpack won't handle "),pe,s(" for public files automatically. So if you change the "),de,s(" of your site, you'd better to use "),n(r,{to:"/guide/assets.html#base-helper"},{default:d(()=>[s("Base Helper")]),_:1}),s(" when referencing an public image file.")]),ue,e("p",null,[s("Default theme is using "),e("a",he,[s("SASS"),n(l)]),s(" as CSS pre-processor, so you might need to install "),e("a",_e,[s("sass-loader"),n(l)]),s(" as a peer dependency to make it work with Webpack, especially when you are using "),e("a",be,[s("pnpm"),n(l)]),s(".")])])}const ke=i(u,[["render",fe],["__file","webpack.html.vue"]]);export{ke as default}; diff --git a/browserconfig.xml b/browserconfig.xml new file mode 100644 index 000000000..5bdd109f9 --- /dev/null +++ b/browserconfig.xml @@ -0,0 +1,9 @@ + +base
+ diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..e481e5dda71327b885d4797cac93939d8030d0d6 GIT binary patch literal 15086 zcmeI2eQZ@{9mk)p&@xv73ES+pKU&Nj`(tm3yDbc8dlLg#kyS!60xPsw=$J()2(q=% z7I4!)=9Vqd$jpq6Z5S8ljJg)1>7of@jEQy$(Jb1SAc>OL1f~QT$ItiNb8gQ)J?A;+ z-WIq^xXHKA+wbN3yqu@!`JKm@3R7twddQI0o8zA}rok9fU++ ++ ++ #ffffff +fPVnx#Y&*8zb;h7=gpX*+s%ffoqr}ysN=657puJaxcSs4LI*%O}X<8 z@`LjN@GIbWP<}yBrkwL|?E#lP?&^c`J>|^V=LXNa!D--+y`QSCtp5YS? tOI|v@*2rH z`(9Y?;xKuuY|d8QwdeypD!>sdANUTu+2U+{ywQd7Df%Fr6<50t_{e}WR{p$u?iyU` zZ2C;bh4M-Ap3ThF E61yaP0klFb8UrOu{;nkDW8gAA9$JKZ8Qf!7}{6 z{Pktdrq eZWp7cmY_sAN)bH)3u>7dh7#pAQ{P~=!1M# zPPY%(XafJT@_#4m?Cc9Yvp(l=$~uzlVRWoEb3U7R&9>)zV=4U6y%YS- zYM-&+_u_JA^Xl~6{pVUb(oHc3;&5lNeL$xV#GeV_KKP>+XIp2?ei<5bpLafG9Z6R< z68azxeZ}xc{sAx!;^!CsyN^u1 $t#T4kF9+UJ828+X0GJax3m>3Gz>U-Epu(Y3yDj-b4azii27igzP%<4a}qkG5`L zJrfT7q{Z3(#A5q?*_t`q`DjC?rj$;A~tUw4chRY}>}p MwPCu3=l4 zyI)qDWMcKPEgwldJg)BgB>yq+npKB&)BnA|nQ$s^w@-}k$d+}DvCo& ?MuUv7|9Oz zeYa`2qpe|>wKI(0D4bwihuA9 |a{7vH9UD#;ppUkzia?pEV>KXGcEdOFrd0j+a-TI9~p UvN9|dvmqH3F6qWMHMY_9~iGql=PCK@V10K182U}Q8d*0X2{u3Z)EZUdJ* zA93Taddb9|HA?Z1y?XE`Q0SNQL(KcUWa~@u71qIy&XCVU`R+f~>
U^6ZN64&Ak& z@C?SB7sNL?n_A+P(p_810HAjp_%)ca=5~LT?>V8fs_J6afo$AXEC+OY!G{I@>HC4# zBjSsUfg3NRErNq=^cLeE`9 ;7d>e_455hrhG2c&QYf%~w$mzS(i(%hxeD7uA zdu=iCJ^ZWfDP&^SqHHFf1(9h1=feKo_}q5;_Y61QhD=PnO*UI>V?evU3+bI|%9`8z z4W74z_?p(FWF#B04rEidW54^*)(-SeHR+!<=iZr!ijTEs&TuY1Q}8S>4{p3G`fi16 zw?~Zu^>=~a7x?ygxbdyf^M=pM>^)x+lrP|btR-G0A9sa0P KX&EV#1};IO$h z^KNHb!vaD10{@JGZS{2=%{m>hTV?wy0)$oSHE;-+oB4dwBFKFpy9-I%)x z^7WwfNfl@LPT04eq5a>CzB9lYJ4VbczppE=x&r@<74a0;M$GdlpYr_}D14{V9{(2K z{JSE)VX@wbS5CRlqPnQHC>ydB@jS? ;j;z)2tQJ;@!Xll18%eG1|fb$hpOT{7ja zwCdD`{HdUhY{-^u`u4q4KIMC^2R-{ajAUz=yPC&8{csJof|$!($G+dH4f(l29ogvV zeWZr|PukD VqYH_@u;uH!?)PsDSVituWe$1QR5lep8Ls$QET8eO)7e!C! zf?s-2SBm c(K$}db~138V^*8;k}4b>%%B{GY_S?LeG-Qq%d zuWqr812Q** S$9-!I(#p1ilud?1-9ed=!qzX9$Y z(4O7i{?7jl wpt!u-R&b}OHS;`s@AKGj?>VW>)7N}RN4l%QIn^ILUT~-A zH2=dtA)tR+-?7}gM96qH&Uw18kiJLV81prToW8k@@xOPg-$&(Dr#8t**3}u#O1D;E zd~5liP}{yDQ;Y1!*`KTO`s7uoHpxiV*Yjh!R}@nPmz#;95 + + + + + + + + Assets | VuePress + + + + + ++ + + diff --git a/guide/bundler.html b/guide/bundler.html new file mode 100644 index 000000000..b6df58eb5 --- /dev/null +++ b/guide/bundler.html @@ -0,0 +1,54 @@ + + + + + + + + +VuePress Assets
Relative URLs
You can reference any assets using relative URLs in your Markdown content:
![An image](./image.png) +
or
![An image](image.png) +
This is generally the suggested way to import images, as users usually place images near the Markdown file that references them.
Public Files
You can put some static assets inside public directory, and they will be copied to the root of the generated directory.
The default public directory is
.vuepress/public
, which can be changed by public option.It would be useful in some cases:
- You may need to provide static assets that are not directly referenced in any of your Markdown files, for example, favicon and PWA icons.
- You may need to serve some shared static assets, which may even be referenced outside your site, for example, logo images.
- You may want to reference images using absolute URLs in your Markdown content.
Take our documentation source files as an example, we are putting the logo of VuePress inside the public directory:
└─ docs + ├─ .vuepress + | └─ public + | └─ images + | └─ hero.png # <- Logo file + └─ guide + └─ assets.md # <- Here we are +
We can reference our logo in current page like this:
Input
![VuePress Logo](/images/hero.png) +
Output
Base Helper
If your site is deployed to a non-root URL, for example,
https://foo.github.io/bar/
, then the base should be set to'/bar/'
. Obviously, your public files would be served likehttps://foo.github.io/bar/images/hero.png
after deployment.In most cases, you don't need to worry about the reference path of those public files, as VuePress will automatically handle
base
for you:<!-- you don't need to prepend `/bar/` to `/images/hero.png` manually --> + +![VuePress Logo](/images/hero.png) +
TIP
When using webpack bundler, you need to set markdown.assets.absolutePathPrependBase to
true
to automatically prepend base to markdown images.However, sometimes you may have some dynamical links referencing public files, especially when you are authoring a custom theme. In such case, the
base
could not be handled automatically. To help with that, VuePress provides a withBase helper to prependbase
for you:<template> + <img :src="withBase(logoPath)" /> +</template> + +<script setup> +import { ref } from 'vue' +import { withBase } from '@vuepress/client' + +const logoPath = ref('/images/hero.png') +</script> +
You can also access the helper by
$withBase
directly:<img :src="$withBase('/images/hero.png')" alt="VuePress Logo"> +
Packages and Path Aliases
Although it is not a common usage, you can reference images from dependent packages:
npm install -D package-name +
Since markdown image syntax regards image links as relative paths by default, you need to use
<img>
tag:<img src="package-name/image.png" alt="Image from dependency"> +
The path aliases that set in config file are also supported:
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + alias: { + '@alias': path.resolve(__dirname, './path/to/some/dir'), + }, +} +
<img src="@alias/image.png" alt="Image from path alias"> +
TIP
Config reference: alias
Bundler | VuePress + + + + + ++ + + diff --git a/guide/configuration.html b/guide/configuration.html new file mode 100644 index 000000000..5fdaa2796 --- /dev/null +++ b/guide/configuration.html @@ -0,0 +1,62 @@ + + + + + + + + +VuePress Bundler
VuePress has been using Webpack as the bundler to dev and build sites. Since VuePress v2, other bundlers are also supported, and now we are using Vite as the default bundler. Of course, you can still choose to use Webpack.
Choose a Bundler
When using the vuepress package, Vite bundler is installed and used automatically.
If you want to use Webpack bundler instead, you can remove it and install the vuepress-webpack package instead:
pnpm remove vuepress +pnpm add -D vuepress-webpack@next +
yarn remove vuepress +yarn add -D vuepress-webpack@next +
npm uninstall vuepress +npm install -D vuepress-webpack@next +
TIP
In fact, the vuepress package is just a wrapper of the vuepress-vite package.
Configure Bundler
Generally, you could use a bundler without extra configuration, because we have already configured them properly to work with VuePress.
You can configure bundler for advanced usage via the bundler option:
import { viteBundler } from 'vuepress' +// import { webpackBundler } from 'vuepress-webpack' + +export default { + bundler: viteBundler({ + vuePluginOptions: { + template: { + compilerOptions: { + isCustomElement: (tag) => tag === 'center', + }, + }, + }, + }), +} +
You can refer to Bundlers > Vite and Bundlers > Webpack to check out all options of the corresponding bundler.
Configuration | VuePress + + + + + ++ + + diff --git a/guide/deployment.html b/guide/deployment.html new file mode 100644 index 000000000..024baeecb --- /dev/null +++ b/guide/deployment.html @@ -0,0 +1,134 @@ + + + + + + + + +VuePress Configuration
Config File
Without any configuration, the VuePress site is pretty minimal. To customize your site, let’s first create a
.vuepress
directory inside your docs directory. This is where all VuePress-specific files will be placed. Your project structure is probably like this:├─ docs +│ ├─ .vuepress +│ │ └─ config.js +│ └─ README.md +├─ .gitignore +└─ package.json +
The essential file for configuring a VuePress site is
.vuepress/config.js
, while TypeScript config file is also supported. You can use.vuepress/config.ts
instead to get better types hint for VuePress config.To be more specific, we have a convention for config file paths (in order of precedence):
- In current working directory
cwd
:
vuepress.config.ts
vuepress.config.js
vuepress.config.mjs
- In source directory
sourceDir
:
.vuepress/config.ts
.vuepress/config.js
.vuepress/config.mjs
You can also specify the config file via
--config
option of CLI:vuepress dev docs --config my-config.js +
A basic config file looks like this:
import { defineUserConfig } from 'vuepress' + +export default defineUserConfig({ + lang: 'en-US', + title: 'Hello VuePress', + description: 'Just playing around', +}) +
TIP
Check out the Config Reference for a full list of VuePress config.
Client Config File
In most cases, the config file is sufficient to configure your VuePress site. However, sometimes users may want to add some client-side code directly. To help with this, VuePress also supports a client config file:
├─ docs +│ ├─ .vuepress +│ │ ├─ client.js <--- client config file +│ │ └─ config.js <--- config file +│ └─ README.md +├─ .gitignore +└─ package.json +
Similarly, we also have a convention for client config file paths (in order of precedence):
- In current working directory
cwd
:
vuepress.client.ts
vuepress.client.js
vuepress.client.mjs
- In source directory
sourceDir
:
.vuepress/client.ts
.vuepress/client.js
.vuepress/client.mjs
A basic client config file looks like this:
import { defineClientConfig } from '@vuepress/client' + +export default defineClientConfig({ + enhance({ app, router, siteData }) {}, + setup() {}, + rootComponents: [], +}) +
TIP
Unlike config file, client config file could not be specified via CLI options.
To learn more about client config file, see Advanced > Cookbook > Usage of Client Config
Deployment | VuePress + + + + + ++ + + diff --git a/guide/getting-started.html b/guide/getting-started.html new file mode 100644 index 000000000..22f75ee46 --- /dev/null +++ b/guide/getting-started.html @@ -0,0 +1,59 @@ + + + + + + + + +VuePress Deployment
The following guides are based on some shared assumptions:
- You are placing your Markdown source files inside the
docs
directory of your project;- You are using the default build output location (
.vuepress/dist
);- You are using pnpm as package manager, while npm and yarn are also supported;
- VuePress is installed as a local dependency in your project, and you have setup the following script in
package.json
:{ + "scripts": { + "docs:build": "vuepress build docs" + } +} +
GitHub Pages
Set the correct base config.
If you are deploying to
https://<USERNAME>.github.io/
, you can omit this step asbase
defaults to"/"
.If you are deploying to
https://<USERNAME>.github.io/<REPO>/
, for example your repository is athttps://github.com/<USERNAME>/<REPO>
, then setbase
to"/<REPO>/"
.Choose your preferred CI tools. Here we take GitHub Actions as an example.
Create
.github/workflows/docs.yml
to set up the workflow.Click to expand sample config
name: docs + +on: + # trigger deployment on every push to main branch + push: + branches: [main] + # trigger deployment manually + workflow_dispatch: + +jobs: + docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + # fetch all commits to get last updated time or other git log info + fetch-depth: 0 + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + # choose pnpm version to use + version: 8 + # install deps with pnpm + run_install: true + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + # choose node.js version to use + node-version: 18 + # cache deps for pnpm + cache: pnpm + + # run build script + - name: Build VuePress site + run: pnpm docs:build + + # please check out the docs of the workflow for more details + # @see https://github.com/crazy-max/ghaction-github-pages + - name: Deploy to GitHub Pages + uses: crazy-max/ghaction-github-pages@v4 + with: + # deploy to gh-pages branch + target_branch: gh-pages + # deploy the default output dir of VuePress + build_dir: docs/.vuepress/dist + env: + # @see https://docs.github.com/en/actions/reference/authentication-in-a-workflow#about-the-github_token-secret + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +
TIP
Please refer to GitHub Pages official guide for more details.
GitLab Pages
Set the correct base config.
If you are deploying to
https://<USERNAME>.gitlab.io/
, you can omitbase
as it defaults to"/"
.If you are deploying to
https://<USERNAME>.gitlab.io/<REPO>/
, for example your repository is athttps://gitlab.com/<USERNAME>/<REPO>
, then setbase
to"/<REPO>/"
.Create
.gitlab-ci.yml
to set up GitLab CI workflow.Click to expand sample config
# choose a docker image to use +image: node:18-buster + +pages: + # trigger deployment on every push to main branch + only: + - main + + # cache node_modules + cache: + key: + files: + - pnpm-lock.yaml + paths: + - .pnpm-store + + # Install pnpm + before_script: + - curl -fsSL https://get.pnpm.io/install.sh | sh - + - pnpm config set store-dir .pnpm-store + + # install dependencies and run build script + script: + - pnpm i --frozen-lockfile + - pnpm docs:build --dest public + + artifacts: + paths: + - public +
TIP
Please refer to GitLab Pages official guide for more details.
Google Firebase
Make sure you have firebase-tools installed.
Create
firebase.json
and.firebaserc
at the root of your project with the following content:
firebase.json
:{ + "hosting": { + "public": "./docs/.vuepress/dist", + "ignore": [] + } +} +
.firebaserc
:{ + "projects": { + "default": "<YOUR_FIREBASE_ID>" + } +} +
- After running
pnpm docs:build
, deploy using the commandfirebase deploy
.TIP
Please refer to Firebase CLI official guide for more details.
Heroku
Install Heroku CLI.
Create a Heroku account by signing up.
Run
heroku login
and fill in your Heroku credentials:heroku login +
- Create a file called
static.json
in the root of your project with the below content:
static.json
:{ + "root": "./docs/.vuepress/dist" +} +
This is the configuration of your site; read more at heroku-buildpack-static.
Kinsta
See Set Up VuePress on Kinsta.
Edgio
See Edgio Documentation > Framework Guides > VuePress.
Netlify
On Netlify, set up a new project from GitHub with the following settings:
- Build Command:
pnpm docs:build
- Publish directory:
docs/.vuepress/dist
Set Environment variables to choose node version:
NODE_VERSION
: 18Hit the deploy button.
Vercel
Go to Vercel, set up a new project from GitHub with the following settings:
- FRAMEWORK PRESET:
Other
- BUILD COMMAND:
pnpm docs:build
- OUTPUT DIRECTORY:
docs/.vuepress/dist
Hit the deploy button.
Getting Started | VuePress + + + + + ++ + + diff --git a/guide/i18n.html b/guide/i18n.html new file mode 100644 index 000000000..9fde7d4ce --- /dev/null +++ b/guide/i18n.html @@ -0,0 +1,74 @@ + + + + + + + + +VuePress Getting Started
WARNING
VuePress v2 is currently in RC (Release Candidate) stage. It's ready to be used for building your site, but the config and API are not stable enough, which is possibly to have minor breaking changes. So make sure to read the changelog carefully each time you upgrade a RC version.
Prerequisites
- Node.js v18.16.0+
- Package manager like pnpm, yarn, npm, etc.
TIP
- When using pnpm, you need to install
vue
and@vuepress/client
as peer-dependencies.- When using yarn 2+, you need to set
nodeLinker: 'node-modules'
in your.yarnrc.yml
file.Manual Installation
This section will help you build a basic VuePress documentation site from ground up. If you already have an existing project and would like to keep documentation inside the project, start from Step 3.
- Step 1: Create and change into a new directory
mkdir vuepress-starter +cd vuepress-starter +
- Step 2: Initialize your project
git init +pnpm init +
git init +yarn init +
git init +npm init +
- Step 3: Install VuePress locally
pnpm add -D vuepress@next @vuepress/client@next vue +
yarn add -D vuepress@next +
npm install -D vuepress@next +
- Step 4: Add some scripts to
package.json
{ + "scripts": { + "docs:dev": "vuepress dev docs", + "docs:build": "vuepress build docs" + } +} +
- Step 5: Add the default temp and cache directory to
.gitignore
fileecho 'node_modules' >> .gitignore +echo '.temp' >> .gitignore +echo '.cache' >> .gitignore +
- Step 6: Create your first document
mkdir docs +echo '# Hello VuePress' > docs/README.md +
- Step 7: Serve the documentation site in the local server
pnpm docs:dev +
yarn docs:dev +
npm run docs:dev +
VuePress will start a hot-reloading development server at http://localhost:8080. When you modify your markdown files, the content in the browser will be auto updated.
By now, you should have a basic but functional VuePress documentation site. Next, learn about the basics of configuration in VuePress.
I18n | VuePress + + + + + ++ + + diff --git a/guide/index.html b/guide/index.html new file mode 100644 index 000000000..1b007ec31 --- /dev/null +++ b/guide/index.html @@ -0,0 +1,34 @@ + + + + + + + + +VuePress I18n
Site I18n Config
To take advantage of multi-language support in VuePress, you first need to use the following file and directory structure:
docs +├─ README.md +├─ foo.md +├─ nested +│ └─ README.md +└─ zh + ├─ README.md + ├─ foo.md + └─ nested + └─ README.md +
Then, specify the
locales
option in your config file:export default { + locales: { + // The key is the path for the locale to be nested under. + // As a special case, the default locale can use '/' as its path. + '/': { + lang: 'en-US', + title: 'VuePress', + description: 'Vue-powered Static Site Generator', + }, + '/zh/': { + lang: 'zh-CN', + title: 'VuePress', + description: 'Vue 驱动的静态网站生成器', + }, + }, +} +
If a locale does not have a
lang
,title
,description
orhead
, VuePress will fallback to the root-level values. You can omit the root level config as long as they are provided in each locale.TIP
Config reference: locales
Theme I18n Config
VuePress does not restrict how themes provide multi-language support, so each theme may have different way to handle i18n, and some themes may not provide multi-language support at all. You'd better refer to the theme documentation for detailed guide.
If you are using default theme, the multi-language support is the same as above:
import { defaultTheme } from 'vuepress' + +export default { + theme: defaultTheme({ + locales: { + '/': { + selectLanguageName: 'English', + }, + '/zh/': { + selectLanguageName: '简体中文', + }, + }, + }), +} +
TIP
Config reference: Default Theme > locales
Introduction | VuePress + + + + + ++ + + diff --git a/guide/markdown.html b/guide/markdown.html new file mode 100644 index 000000000..fcc46e1ac --- /dev/null +++ b/guide/markdown.html @@ -0,0 +1,163 @@ + + + + + + + + +VuePress Introduction
VuePress is a markdown-centered static site generator. You can write your content (documentations, blogs, etc.) in Markdown, then VuePress will help you to generate a static site to host them.
The purpose of creating VuePress was to support the documentation of Vue.js and its sub-projects, but now it has been helping a large amount of users to build their documentation, blogs, and other static sites.
How It Works
A VuePress site is in fact a single-page application (SPA) powered by Vue and Vue Router.
Routes are generated according to the relative path of your markdown files. Each Markdown file is compiled into HTML with markdown-it and then processed as the template of a Vue component. This allows you to directly use Vue inside your Markdown files and is great when you need to embed dynamic content.
During development, we start a normal dev-server, and serve the VuePress site as a normal SPA. If you’ve used Vue before, you will notice the familiar development experience when you are writing and developing with VuePress.
During build, we create a server-rendered version of the VuePress site and render the corresponding HTML by virtually visiting each route. This approach is inspired by Nuxt's
nuxt generate
command and other projects like Gatsby.Why Not ...?
Nuxt
Nuxt is an outstanding Vue SSR framework, and it is capable of doing what VuePress does. But Nuxt is designed for building applications, while VuePress is more lightweight and focused on content-centric static sites.
VitePress
VitePress is the little brother of VuePress. It's also created and maintained by our Vue.js team. It's even more lightweight and faster than VuePress. However, as a tradeoff, it's more opinionated and less configurable. For example, it does not support plugins. But VitePress is powerful enough to make your content online if you don't need advanced customizations.
It might not be an appropriate comparison, but you can take VuePress and VitePress as Laravel and Lumen.
Docsify / Docute
Both are great projects and also Vue-powered. Except they are both fully runtime-driven and therefore not SEO-friendly. If you don’t care for SEO and don’t want to mess with installing dependencies, these are still great choices.
Hexo
Hexo has been serving the Vue 2.x docs well. The biggest problem is that its theming system is static and string-based - we want to take advantage of Vue for both the layout and the interactivity. Also, Hexo’s Markdown rendering isn’t the most flexible to configure.
GitBook
We’ve been using GitBook for most of our sub project docs. The primary problem with GitBook is that its development reload performance is intolerable with a large amount of files. The default theme also has a pretty limiting navigation structure, and the theming system is, again, not Vue based. The team behind GitBook is also more focused on turning it into a commercial product rather than an open-source tool.
Markdown | VuePress + + + + + ++ + + diff --git a/guide/migration.html b/guide/migration.html new file mode 100644 index 000000000..8bdd0c1b6 --- /dev/null +++ b/guide/migration.html @@ -0,0 +1,130 @@ + + + + + + + + +VuePress Markdown
Make sure you already know Markdown well before reading this section. If not, please learn some Markdown tutorials first.
Syntax Extensions
The Markdown content in VuePress will be parsed by markdown-it, which supports syntax extensions via markdown-it plugins.
This section will introduce built-in Markdown syntax extensions of VuePress.
You can also configure those built-in extensions, load more markdown-it plugins and implement your own extensions via markdown option and extendsMarkdown option.
Embedded
Embedded by markdown-it:
- Tables (GFM)
- Strikethrough (GFM)
Header Anchors
You might have noticed that, a
#
anchor is displayed when you hover the mouse on the headers of each section. By clicking the#
anchor, you can jump to the section directly.TIP
This header anchors extension is supported by markdown-it-anchor.
Config reference: markdown.anchor
Links
When using Markdown link syntax, VuePress will implement some conversions for you.
Take our documentation source files as an example:
└─ docs + ├─ guide + │ ├─ getting-started.md + │ ├─ markdown.md # <- Here we are + │ └─ README.md + ├─ reference + │ └─ config.md + └─ README.md +
Raw Markdown
<!-- relative path --> + +[Home](../README.md) +[Config Reference](../reference/config.md) +[Getting Started](./getting-started.md) + +<!-- absolute path --> + +[Guide](/guide/README.md) +[Config Reference > markdown.links](/reference/config.md#links) + +<!-- URL --> + +[GitHub](https://github.com) +
Converted to
<template> + <RouterLink to="/">Home</RouterLink> + <RouterLink to="/reference/config.html">Config Reference</RouterLink> + <RouterLink to="/guide/getting-started.html">Getting Started</RouterLink> + <RouterLink to="/guide/">Guide</RouterLink> + <RouterLink to="/reference/config.html#links"> + Config Reference > markdown.links + </RouterLink> + <a href="https://github.com" target="_blank" rel="noopener noreferrer"> + GitHub + </a> +</template> +
Rendered as
Home
Config Reference
Getting Started
Guide
Config Reference > markdown.links
GitHubExplanation
- Internal links will be converted to
<RouterLink>
for SPA navigation.- Internal links to
.md
files will be converted to the page route path, and both absolute path and relative path are supported.- External links will get
target="_blank" rel="noopener noreferrer"
attrs.Suggestion
Try to use relative paths instead of absolute paths for internal links to markdown files.
- Relative paths are a valid links to the target files, and they can navigate correctly when browsing the source files in your editor or repository.
- Relative paths are consistent in different locales, so you don't need to change the locale path when translating your content.
Emoji 🎉
You can add emoji to your Markdown content by typing
:EMOJICODE:
.For a full list of available emoji and codes, check out emoji-cheat-sheet.
Input
VuePress 2 is out :tada: ! +
Output
VuePress 2 is out 🎉 !
Table of Contents
If you want to put the table of contents (TOC) of your current page inside your Markdown content, you can use the
[[toc]]
syntax.Input
[[toc]] +
Output
The headers in TOC will link to the corresponding header anchors, so TOC won't work well if you disable header anchors.
Code Blocks
Following code blocks extensions are implemented during markdown parsing in Node side. That means, the code blocks won't be processed in client side.
Line Highlighting
You can highlight specified lines of your code blocks by adding line ranges mark in your fenced code blocks:
Input
```ts{1,6-8} +import { defaultTheme, defineUserConfig } from 'vuepress' + +export default defineUserConfig({ + title: 'Hello, VuePress', + + theme: defaultTheme({ + logo: 'https://vuejs.org/images/logo.png', + }), +}) +``` +
Output
import { defaultTheme, defineUserConfig } from 'vuepress' + +export default defineUserConfig({ + title: 'Hello, VuePress', + + theme: defaultTheme({ + logo: 'https://vuejs.org/images/logo.png', + }), +}) +
Examples for line ranges mark:
- Line ranges:
{5-8}
- Multiple single lines:
{4,7,9}
- Combined:
{4,7-13,16,23-27,40}
TIP
This line highlighting extension is supported by our built-in plugin, which is forked and modified from markdown-it-highlight-lines.
Config reference: markdown.code.highlightLines
Line Numbers
You must have noticed that the number of lines is displayed on the left side of code blocks. This is enabled by default and you can disable it in config.
You can add
:line-numbers
/:no-line-numbers
mark in your fenced code blocks to override the value set in config.Input
```ts +// line-numbers is enabled by default +const line2 = 'This is line 2' +const line3 = 'This is line 3' +``` + +```ts:no-line-numbers +// line-numbers is disabled +const line2 = 'This is line 2' +const line3 = 'This is line 3' +``` +
Output
// line-numbers is enabled by default +const line2 = 'This is line 2' +const line3 = 'This is line 3' +
// line-numbers is disabled +const line2 = 'This is line 2' +const line3 = 'This is line 3' +
TIP
This line numbers extension is supported by our built-in plugin.
Config reference: markdown.code.lineNumbers
Wrap with v-pre
As template syntax is allowed in Markdown, it would also work in code blocks, too.
To avoid your code blocks being compiled by Vue, VuePress will add v-pre directive to your code blocks by default, which can be disabled in config.
You can add
:v-pre
/:no-v-pre
mark in your fenced code blocks to override the value set in config.WARNING
The template syntax characters, for example, the "Mustache" syntax (double curly braces) might be parsed by the syntax highlighter. Thus, as the following example,
:no-v-pre
might not work well in some languages.If you want to make Vue syntax work in those languages anyway, try to disable the default syntax highlighting and implement your own syntax highlighting in client side.
Input
```md +<!-- This will be kept as is by default --> + +1 + 2 + 3 = {{ 1 + 2 + 3 }} +``` + +```md:no-v-pre +<!-- This will be compiled by Vue --> + +1 + 2 + 3 = {{ 1 + 2 + 3 }} +``` + +```js:no-v-pre +// This won't be compiled correctly because of js syntax highlighting +const onePlusTwoPlusThree = {{ 1 + 2 + 3 }} +``` +
Output
<!-- This will be kept as is --> + +1 + 2 + 3 = {{ 1 + 2 + 3 }} +
<!-- This will be compiled by Vue --> + +1 + 2 + 3 = 6 +
// This won't be compiled correctly because of js syntax highlighting +const onePlusTwoPlusThree = {{ 1 + 2 + 3 }} +
TIP
This v-pre extension is supported by our built-in plugin.
Config reference: markdown.code.vPre.block
Import Code Blocks
You can import code blocks from files with following syntax:
<!-- minimal syntax --> + +@[code](../foo.js) +
If you want to partially import the file:
<!-- partial import, from line 1 to line 10 --> + +@[code{1-10}](../foo.js) +
The code language is inferred from the file extension, while it is recommended to specify it explicitly:
<!-- specify the code language --> + +@[code js](../foo.js) +
In fact, the second part inside the
[]
will be treated as the mark of the code fence, so it supports all the syntax mentioned in the above Code Blocks section:<!-- line highlighting --> + +@[code js{2,4-5}](../foo.js) +
Here is a complex example:
- import line 3 to line 10 of the
'../foo.js'
file- specify the language as
'js'
- highlight line 3 of the imported code, i.e. line 5 of the
'../foo.js'
file- disable line numbers
@[code{3-10} js{3}:no-line-numbers](../foo.js) +
Notice that path aliases are not available in import code syntax. You can use following config to handle path alias yourself:
import { getDirname, path } from '@vuepress/utils' + +const __dirname = getDirname(import.meta.url) + +export default { + markdown: { + importCode: { + handleImportPath: (str) => + str.replace(/^@src/, path.resolve(__dirname, 'path/to/src')), + }, + }, +} +
<!-- it will be resolved to 'path/to/src/foo.js' --> + +@[code](@src/foo.js) +
TIP
This import code extension is supported by our built-in plugin.
Config reference: markdown.importCode
Using Vue in Markdown
This section will introduce some basic usage of Vue in Markdown.
Check out Cookbook > Markdown and Vue SFC for more details.
Template Syntax
As we know:
- HTML is allowed in Markdown.
- Vue template syntax is compatible with HTML.
That means, Vue template syntax is allowed in Markdown.
Input
One plus one equals: {{ 1 + 1 }} + +<span v-for="i in 3"> span: {{ i }} </span> +
Output
One plus one equals: 2
span: 1 span: 2 span: 3
Components
You can use Vue components directly in Markdown.
Input
This is default theme built-in `<Badge />` component <Badge text="demo" /> +
Output
This is default theme built-in
<Badge />
component demoTIP
Check out the Built-in Components for a full list of built-in components.
Check out the Default Theme > Built-in Components for a full list of default theme built-in components.
Cautions
Non-Standard HTML Tags
Non-standard HTML tags would not be recognized as native HTML tags by Vue template compiler. Instead, Vue will try to resolve those tags as Vue components, and obviously these components usually don't exist. For example:
- Deprecated HTML tags such as <center> and <font>.
- MathML tags, which might be used by some markdown-it LaTeX plugin.
If you want to use those tags anyway, try either of the following workarounds:
- Adding a v-pre directive to skip the compilation of the element and its children. Notice that the template syntax would also be invalid.
- Using compilerOptions.isCustomElement to tell Vue template compiler not try to resolve them as components.
- For
@bundler-webpack
, set vue.compilerOptions- For
@bundler-vite
, set vuePluginOptions.template.compilerOptionsMigrating from v1 | VuePress + + + + + ++ + + diff --git a/guide/page.html b/guide/page.html new file mode 100644 index 000000000..da12fbd50 --- /dev/null +++ b/guide/page.html @@ -0,0 +1,45 @@ + + + + + + + + +VuePress Migrating from v1
WARNING
Plugins and themes of VuePress v1 are not compatible with VuePress v2. You need to update them to corresponding v2 version.
Some major changes and enhancements of VuePress v2:
- VuePress v2 is now using Vue 3, so make sure your components and other client files are compatible with Vue 3.
- VuePress v2 is developed with TypeScript, so it provides better TS support now. It's highly recommended to use TypeScript to develop plugins and themes. VuePress config file also supports TypeScript, and you can use
.vuepress/config.ts
directly.- VuePress v2 supports both Webpack and Vite as bundler. Now Vite is the default bundler, while you can still choose to use Webpack. You can even use Vite in dev mode to get better development experience, and use Webpack in build mode to get better browser compatibility.
- VuePress v2 is now released as pure ESM packages, and CommonJS config files are no longer supported.
Core ideas and processes of VuePress v2 are the same with v1, while v2 API has been re-designed and becomes more normalized. So you might encounter breaking changes when migrating an existing v1 project to v2. This guide is here to help you migrating v1 sites / plugins / themes to v2.
- If you are a common user, you need to read the guide for users.
- If you are a plugin author, you need to read the guide for plugin authors.
- If you are a theme author, you need to read the guide for theme authors.
For Users
User Config Change
Config file should be in ESM format, and CommonJS format config file is no longer supported.
// .vuepress/config.js + +- module.exports = { +- // user config +- } + ++ export default { ++ // user config ++ } +
theme
Using a theme via string is not supported. Import the theme directly.
- module.exports = { +- theme: '@vuepress/theme-default', +- themeConfig: { +- // default theme config +- }, +- } + ++ import { defaultTheme } from 'vuepress' ++ export default { ++ theme: defaultTheme({ ++ // default theme config ++ }) ++ } +
themeConfig
Removed. Set config to the theme directly.
plugins
Using a plugin via string is not supported. Import the plugin directly.
- module.exports = { +- plugins: [ +- [ +- '@vuepress/plugin-google-analytics', +- { +- id: 'G-XXXXXXXXXX', +- }, +- ], +- ], +- } + ++ import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics' ++ export default { ++ plugins: [ ++ googleAnalyticsPlugin({ ++ id: 'G-XXXXXXXXXX', ++ }), ++ ], ++ } +
shouldPrefetch
Default value is changed from
() => true
totrue
.extraWatchFiles
Removed.
You can watch files manually in onWatched hook.
patterns
Renamed to
pagePatterns
markdown.lineNumbers
Moved to markdown.code.lineNumbers.
Default value is changed from
false
totrue
.markdown.pageSuffix
Removed.
markdown.externalLinks
Moved to markdown.links.externalAttrs.
markdown.toc
Changed.
markdown.plugins
Removed.
Use markdown-it plugins in extendsMarkdown hook.
markdown.extendMarkdown
Removed.
Use extendsMarkdown hook.
markdown.extractHeaders
Moved to markdown.headers.
Webpack Related Configs
All webpack related configs are moved to options of
@vuepress/bundler-webpack
, including:
postcss
stylus
scss
sass
less
chainWebpack
configureWebpack
evergreen
: default value is changed fromfalse
totrue
- module.exports = { +- sass: { /* ... */ }, +- } + ++ import { webpackBundler } from '@vuepress/bundler-webpack' ++ export default { ++ bundler: webpackBundler({ ++ sass: { /* ... */ }, ++ }), ++ } +
Please refer to Guide > Bundler.
Frontmatter Change
meta
Removed.
Use head instead. For example:
head: + - - meta + - name: foo + content: bar + - - link + - rel: canonical + href: foobar + - - script + - {} + - console.log('hello from frontmatter'); +
Has the same structure with:
// .vuepress/config.ts +export default { + // ... + head: [ + ['meta', { name: 'foo', content: 'bar' }], + ['link', { rel: 'canonical', href: 'foobar' }], + ['script', {}, `console.log('hello from frontmatter');`], + ], + // ... +} +
Permalink Patterns Change
:i_month
: removed:i_day
: removed:minutes
: removed (undocumented in v1):seconds
: removed (undocumented in v1):regular
: renamed to:raw
See Frontmatter > permalinkPattern.
Palette System Change
The stylus palette system of VuePress v1 (i.e.
styles/palette.styl
andstyles/index.styl
) is no longer provided by VuePress Core.The palette system is extracted to @vuepress/plugin-palette.
Theme authors can use their own way to allow users to customize styles, and not be limited with stylus.
If you are using default theme, the palette system is still available but migrated to SASS, while most variables have been migrated to CSS variables. See Default Theme > Styles.
Conventional Files Change
.vuepress/enhanceApp.js
Renamed to
.vuepress/client.{js,ts}
, and the usage has been changed, too.See Advanced > Cookbook > Usage of Client Config.
.vuepress/components/
Files in this directory will not be registered as Vue components automatically.
You need to use @vuepress/plugin-register-components, or register your components manually in
.vuepress/client.{js,ts}
..vuepress/theme/
This directory will not be used as local theme implicitly if it is existed.
You need to import and set your local theme via theme option.
Markdown Change
- Markdown slot is no longer supported.
- Markdown image syntax does not support webpack aliases anymore. Links without
./
prefix are also treated as relative links, which is aligned with the behavior of the native markdown image syntax. If you want to use aliases in image paths, or use images from external packages, you should use<img>
tag instead.- ![](@alias/foo.png) +- ![](package-name/bar.png) + ++ <img src="@alias/foo.png"> ++ <img src="package-name/bar.png"> +
CLI Change
eject command
Removed.
cache options
-c, --cache [cache]
: changed to--cache <cache>
, which means that the shorthand-c
is not forcache
option, and the value ofcache
option is not optional.--no-cache
: renamed to--clean-cache
.Default Theme Change
Built-in Components
<CodeGroup />
and<CodeBlock />
renamed to<CodeGroup />
and<CodeGroupItem />
<Badge />
$badgeErrorColor
palette variable renamed to$badgeDangerColor
type
prop only acceptstip
,warning
anddanger
nowPalette System
The palette system of default theme has migrated to SASS and CSS variables.
Theme Config
Default theme config has been changed a lot. You'd better check the config reference of v2 default theme to migrate it properly.
Here we list some notable changes:
Sidebar Config
- sidebar: { +- title: 'Foo Bar', +- path: '/foo/bar.html', +- collapsable: true, +- children: [ +- ['/baz', 'Baz'], +- ], +- } + ++ sidebar: { ++ text: 'Foo Bar', ++ link: '/foo/bar.html', ++ collapsible: true, ++ children: [ ++ { ++ text: 'Baz', ++ link: '/baz', ++ } ++ ], ++ } +
Official Plugins Change
Check the v2 docs of official plugins.
Community Themes and Plugins
Themes and plugins of v1 are not compatible with v2.
Please make sure that those themes and plugins you are using have supported v2, and refer to their own documentation for migration guide.
For Plugin Authors
Some major breaking changes:
- You cannot use other plugins in your plugin anymore, which avoids lots of potential issues caused by plugin nesting. If your plugin depends on other plugins, you could list them in the docs to ask users import them manually. Alternatively, you can provide users with an array of plugins for convenience.
- Most of the v1 hooks have equivalents in v2. The only exception is
extendsCli
, which has been removed.- Webpack related hooks are removed, because VuePress Core has decoupled with webpack. You can try to use extendsBundlerOptions hook for similar purpose, and make sure to work with all bundlers.
For more detailed guide about how to write a plugin in v2, see Advanced > Writing a Plugin.
Plugin API Change
plugins
: removedready
: renamed toonPrepared
updated
: renamed toonWatched
generated
: renamed toonGenerated
additionalPages
: removed, useapp.pages.push(createPage())
inonInitialized
hookclientDynamicModules
: removed, useapp.writeTemp()
inonPrepared
hookenhanceAppFiles
: removed, useclientConfigFile
hookglobalUIComponents
: removed, useclientConfigFile
hookclientRootMixin
: removed, useclientConfigFile
hookextendMarkdown
: renamed toextendsMarkdown
chainMarkdown
: removedextendPageData
: renamed toextendsPage
extendsCli
: removedconfigureWebpack
: removedchainWebpack
: removedbeforeDevServer
: removedafterDevServer
: removedSee Plugin API.
For Theme Authors
Although we do not allow using other plugins in a plugin anymore, you can still use plugins in your theme.
Some major breaking changes:
- There is no conventional theme directory structure anymore.
- The file
theme/enhanceApp.js
will not be used as client app enhance file implicitly. You need to specify it explicitly inclientConfigFile
hook.- Files in
theme/global-components/
directory will not be registered as Vue components automatically. You need to use @vuepress/plugin-register-components, or register components manually inclientConfigFile
.- Files in
theme/layouts/
directory will not be registered as layout components automatically. You need to specify it explicitly inlayouts
option inclientConfigFile
.- Files in
theme/templates/
directory will not be used as dev / ssr template automatically. You need to specify theme explicitly intemplateBuild
andtemplateDev
option.- Always provide a valid js entry file, and do not use
"main": "layouts/Layout.vue"
as the theme entry anymore.themeConfig
is removed from user config and site data. To access thethemeConfig
as you would viathis.$site.themeConfig
in v1, we now recommend using the @vuepress/plugin-theme-data plugin and itsuseThemeData
composition API.- Stylus is no longer the default CSS pre-processor, and the stylus palette system is not embedded. If you still want to use similar palette system as v1, @vuepress/plugin-palette may help.
- Markdown code blocks syntax highlighting by Prism.js is not embedded by default. You can use either @vuepress/plugin-prismjs or @vuepress/plugin-shiki, or implement syntax highlighting in your own way.
- For scalability concerns,
this.$site.pages
is not available any more.For more detailed guide about how to write a theme in v2, see Advanced > Writing a Theme.
Theme API Change
layouts
Removed.
Now you need to specify layout component in the client config file of your theme.
See Advanced > Writing a theme.
extend
Renamed to
extends
.You can still inherit a parent theme with
extends: parentTheme()
, which will extends the plugins, layouts, etc.You can refer to Default Theme > Extending for how to extend default theme.
The
@theme
and@parent-theme
aliases are removed by default, but you can still make a extendable theme with similar approach, see Advanced > Cookbook > Making a Theme Extendable.Page | VuePress + + + + + ++ + + diff --git a/guide/plugin.html b/guide/plugin.html new file mode 100644 index 000000000..375381be9 --- /dev/null +++ b/guide/plugin.html @@ -0,0 +1,48 @@ + + + + + + + + +VuePress Page
VuePress is markdown-centered. Each markdown file inside your project is a standalone page.
Routing
By default, the route path of a page is determined by the relative path of your markdown file.
Assuming this is the directory structure of your markdown files:
└─ docs + ├─ guide + │ ├─ getting-started.md + │ └─ README.md + ├─ contributing.md + └─ README.md +
Take the
docs
directory as your sourceDir, e.g. you are runningvuepress dev docs
command. Then the route paths of your markdown files would be:
Relative Path Route Path /README.md
/
/index.md
/
/contributing.md
/contributing.html
/guide/README.md
/guide/
/guide/getting-started.md
/guide/getting-started.html
TIP
By default, both
README.md
andindex.md
would be converted toindex.html
and generate a slash-ending route path. However, it might cause conflicts if you want to keep both of the two files.In such case, you can set the pagePatterns to avoid one of them being processed by VuePress, e.g. use
['**/*.md', '!**/README.md', '!.vuepress', '!node_modules']
to exclude allREADME.md
files.Also, some symbols like
:
and+
may have special meanings for vue-router, so you should avoid using them, see vue-router docs for more details.Frontmatter
A markdown file could contain a YAML frontmatter. The frontmatter must be at the top of the Markdown file and must be wrapped with a couple of triple-dashed lines. Here is a basic example:
--- +lang: en-US +title: Title of this page +description: Description of this page +--- +
You must have noticed that those fields are similar with the Site Config in the Config File. You can override
lang
,title
,description
, etc., of current page via frontmatter. So you can take frontmatter as page scope config.Also, VuePress has built-in support for some frontmatter fields, and your theme may have its own special frontmatter, too.
TIP
Check out the Frontmatter Reference for a full list of VuePress built-in frontmatter.
Check out the Default Theme > Frontmatter Reference for the frontmatter of default theme.
Content
The main content of your page is written in Markdown. VuePress will firstly transform your Markdown to HTML code, then treat the HTML code as
<template>
of Vue SFC.With the power of markdown-it and Vue template syntax, the basic Markdown can be extended a lot. Next, check out the Markdown guide for all the extensions of Markdown in VuePress.
Plugin | VuePress + + + + + ++ + + diff --git a/guide/theme.html b/guide/theme.html new file mode 100644 index 000000000..752c20fa3 --- /dev/null +++ b/guide/theme.html @@ -0,0 +1,47 @@ + + + + + + + + +VuePress Plugin
With the help of Plugin API, VuePress plugin can provide different features for you.
Community Plugin
Community users have created lots of plugins and published them to NPM. VuePress team also maintains some official plugins under the @vuepress scope. You should check the plugin's own documentation for detailed guide.
In general, you need to import the plugin and use it in your config file via the plugins option. For example, use the @vuepress/plugin-google-analytics to integrate Google Analytics:
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics' + +export default { + plugins: [ + googleAnalyticsPlugin({ + id: 'G-XXXXXXXXXX', + }), + ], +} +
TIP
Most plugins can only be used once. If the same plugin is used multiple times, only the last one will take effect.
However, some plugins can be used multiple times (e.g. @vuepress/plugin-container), and you should check the documentation of the plugin itself for detailed guide.
Local Plugin
If you want to use your own plugin but don't want to publish it, you can create a local plugin.
It is recommended to use the Config File directly as a plugin, because almost all of the Plugin APIs are available, which would be more convenient in most cases.
But if you have too many things to do in your config file, you can consider to extract them into separate plugins, and use them in your config file:
import myPlugin from './path/to/my-plugin.js' + +export default { + plugins: [myPlugin()], +} +
You can refer to Advanced > Writing a Plugin for how to write your own plugin.
Theme | VuePress + + + + + ++ + + diff --git a/images/cookbook/extending-a-theme-01.png b/images/cookbook/extending-a-theme-01.png new file mode 100644 index 0000000000000000000000000000000000000000..9ba6d7e8129b49670cc946ea237163cfc0a431a2 GIT binary patch literal 13453 zcmeIZ_g7P0)HR9)P!M@kicVuePress Theme
VuePress theme can provide layouts, styles and many other features for you, helping you to focus on writing Markdown content.
Default Theme
VuePress has a default theme out of the box, which is applied to our documentation site you are currently browsing.
If you don't specify the theme to use, the default theme will be used automatically.
To configure the default theme, you need to import and use it in your config file via the theme option:
import { defaultTheme } from 'vuepress' + +export default { + theme: defaultTheme({ + // default theme config + navbar: [ + { + text: 'Home', + link: '/', + }, + ], + }), +} +
The default theme provides basic but useful features for documentation site, you can check out Default Theme Config Reference for a full list of config.
However, you might think it is not good enough. Or, you want to build a different type of site, for example, a blog, instead of a documentation. Then, you can try to use a community theme or create a local theme.
Community Theme
Community users have created lots of theme and published them to NPM. You should check the theme's own documentation for detailed guide.
Local Theme
If you want to use your own custom theme but don't want to publish it, you can create a local theme. Refer to Advanced > Writing a Theme for how to write your own theme.
RVfmV` zY?2A4K2RHj+O(6l7u%BgNq8&XDs5`S0B%V%OG?#3Cz#ww9M>%Lx|t|+U$EmJn ~r2SYR!O+F?Kf%KtH6%DxdU)0eU({cU3 zs518d{6JCjhq24FElzYNLNLMC<=t1Gw)m;=uxC7%e^O@mjrfJ?UC+$FS;VYy-Q@qj`2s7cn`y(pWe-=<3oC9rm;k1Q0g1^ f*>n3`W!O8v??9$A6$N@=H1 zY8coFxUM|AG%BAID~sx0V0sp&9X!4k7E*?gU>0nXdv+PvWr! mY-rCE<8h1lhJ1q`&{BX7=xHHVLu z&OJk4@_AJJGH%V_aQyiDx8mRK?vjRvhTo13OC5I}{~ByhlkkLJoD-QFK3@$7jlO>S zIT?);u_tx?7VqafEEOpn(tQIbzCghf09-?<8}E{TT|BcZiWV78m24T1Vpi* wOE_R?zYxq9) zUj=WN)kTk%`HZY=>!fF|wVaet(T_6=_+oNC=N=cgK%UOYx~2_Kf}9dR_A}lR+QGY> zdv*clwSt^nzBOD4C7#L=UprxYt+2qh`8Ll|8+olsbge8(vYYMjfOfPfcz5)hH55A| z(@$4ZsuRIAD07-2YH!itbJ13Yts;xF;|rZ?ueGcBepKbsuS4%^J#cKoe JBO zF09uM{s<*!D~k2I6SXD!+T%9VGSXSX*4FCM6@1bM4C9bqb`YCnP;o>br5k<)#hhJr zbQk_@xZJfhP^404DvxF{?6Q@=(z@`)WurX974}Ozzsvp+k5I97sdC>}GVhun(7zap zceWjLkvr<^G(#;dyO&LLYqG^1S(OhSbt~-g+DK^1p=?8UA2y7*Jx7i+U(Tf^X{Vl` zY&72kA;NQD|5z2Tu`0#9oK`(SP*~ZiqCGRsM0;os{gz7CbeHixW6C1P829ko5hJT| zLjN77vdKxHeqzvX?z9<20Rdf~-;AlUf(y<8A6lco#!X$%TL!G{7F1dTkfEpzJJ-(A z0s2*0@CV-%yG2L)y-8nRgtL-;v#(t#!=PDV@_lT=p2LpP2!YDYr}_?n8&YU0rDezG zuq#8b4X%8>yYB6bav<~>uOL*|Y7jiIY785)AlWgjEJEhZ8pd6rB4x{5%r-OxU-NIe zn&FBOaiEg<_ga|rVx@FC2hIBXOrsG%IijAvA6cX!XnRS8i(NfCC7M;jB5_p=>7S^K z0U#Lvv5?Q2TDS4lBpJ40REv+eGxXjqb3hp4&8XKlx-;aE*Q>9z%bxf3U7QRw@N1B> zN5~B8s>|ot^!&~5TziN0@aaCWIb9E6YvCp8w7Pk6-qXO(UXJ-rpHyb*#g2icYup3V z7JUsXlXCh%y|cpdR3HE8V(ZA#Ng8B=i+GC+0HXY}OM6~Q@GY`9+-&FPR&%Xw>e(S3 z4cc14km`XkdJHI%kd>JKE8!M++d+F{zA<@SvrWCToP{s5cQo3R5B7BLgHc#o&J&Ko z1^U3~^T&Ng&*JZ@oEA&)jPCGT6Sz%qw3_C7O?cVAs?2y(r%BI0UPEW)tGkz9-O4jt z-%^8xTi6!OYbcE5_*BtRrL~U--Y?T ^YJ-Ki23JPR!dt$(T%VQNm_&Zo#BSZedBu^qi8`}D%Sf3Z_=vGi{RdWOXS z;`>x=9YhmTock8<42b;EMY;V6qUiRDoZit1-;&r}C0Y1uBy_Zh4KdJT1Fv{RewC38 zilFBYe@L7^uQ_T{jrRgm`?}mYjdbp>e3KR7q$B6q_?OK ~$jxWrRBQnmkqz=T-)c- UCxTbjr`FB;;93C}7aGZqOK9sUnh3Xrbel<{+JiBz z3aOOb`JV Kr%OtP^CeQe@j2q1Clq~#R_vlpmu<5u zUQs3KE}T=k#YZME`~I#e?x$T`Dt%ld5egf5^)NL!lj;K }#T-r6 7YF1^J0uPzdfGYUw^JiWH zOGU}P|J=C$qE~%%$GCk8Soe`r4z;>hTB(s%eBAyhdWg69*GJuv1^*e^BY5;C#{5Lu zeHQVrpmw8iEMNMgasfl_#W21X+Oxk}43(D+6-s;-dS$%O2k{fjECyF8^4fh|nGMG} z^C2@f|FFsw?0@sga@Z}w2t_#-KP#tykFg#Sz2M=q8X3|yurd0<5W-rRa!(Ar683Uy zUF15d>4qIQDC*o$ZHcq4y%=zTWH8uA2mZX+TegDiPCHga^Rk=l*DekT&Rqh|8vs;p zs|lE@JLj80zOy67o$G{X^UbF3UH #xiB!TZELa>ibkfu~2{Jm-_XIL`jquT#W2lNji~&^m $k%lYEonNTfWd3*myKps zQ~n2@_jA82c+~kot*Z6D4v$>!X^bu^EVu?g^09=v6fTs>WHEb;Nh0&udgyQjo1u#h zBYQTfN7g*Lx^N>-2lL(r`H_2JfEgvHN73iI9mRi77Trgqh$W_;mqtVJ-smiAmW_zg zYWG!(_m-@Be^*uhL&EWDI`%t62pwMOnV?>-l_2ohnQgh``9 z&AgFt3UW99h@rPzs1jppK45?Csu2sB6jO}ZEf0Ab_A~4yU*P74Xl$Je`cU-beUS6< z8f8hAZf+9xe*0)_!~ymQXE;*F`DP)*k^QKnwKdYpvN`xro?J!@KXZchoHF1QV3v4d z*UQhew&}eTrta#DyN3D$g}0`Gn_T~;rxTy}z}IS*){c9cm!oh-c>T9*y7a7k(dGBV zWgW`gYyVgDjd0PTjImyRL=nySK4p+oSE+g8Zo-0Hh5q|o*t1Au;~;H(%Z3V#x iA)kFPYTG%vMg=~f@Y39!pB0}4<%~J;d*LP;`fNq3 z94&1GF=BReV$u8lHFCyT?U%n=T3k0N7JVxn=9l=`fyJBCFHr0v%x;hx5&N^?o5hZN zc`Q=F^l3jJXZQ1R=7~&0X;Lcp++C~|{V<+APH=FWk6 #yH8ye&iVnn56!&*5oCdLITT zoENe@$9t^>PejGWnf+6J_ZwPnd=foaM!I@fq^-VvNR+`v5`?QO69qS{zs`Y>u4{6@ zEwDNQVN-USIu$s+&jsN=UAAKKNSb$kswUDfR%1>pCxw49^vEEFY~+!YY6$&{cMZ=1 zaJ(`b=KkY@kUhQE{t&m)f8;JF{h5}wZ}EzH>s!}brAnL&;LDV+g#9~Wb0E$E8B05L zF5(#B1q4E$s9w< nNcb$fJ zW7|J^CN%r(H|TbdbKi)ts_p)*-4a)%*qgDdhm$dk+Fqk66*8wbYRMzt^}rtSDm>0_ znRV?i+D1(jk>9+!XOjFQxhQv5W~->MnC^jTME{IuR`^(HVzOdTr0dGQ6?Vfr=;}U6 zh|qhEtAMOB_QjPAK}Pn${y#tBe}n&@(eMCUeh}e2LY#vw|4UIvU_aD7ty|!?>FWQm z>A&Ztr;#}DUu2?U{XZVe|DC~dcycK$Yk2g-ln5POpMzo5x@o12_}V)-PTc0n6-`xi z(xI9F)vXIL!ZtPskjA*q*-t#sZ^eVEv2hXs*S054ngERA_1yv;jl6;fV&LB1#8hRM zDfb&|$Z2xv9(QDmP7OAeQA(B0YfH`FbLTn2FPk+mF`)Ug zNyyMkxgezxil*)n!#PH%GyEP7mL}aK@pI-FzThe9NR*g$YSD0I%9jF#Fy)In&RsoQ z@;WuRjGIf>RsVi%KPY>lHHYK}ZQSA0F z&TCA5eT|6Yit3CB;idEiL4&vsMGn5+GZiRH?^MJX>Rr5z$Paoh1-$pkpZcSx<(PTy z2olXYBJzclbq_RPEq_8*%X3&Mws*BGC#x()ijRx1p(pCh;}=LTlvFxY6d6P2f7{P& zp(SRQSz6;r%t9S)n21UD4Qbbrx_+fM$prpUg}qp|(|PhzJ4$ Ct#_{aS~(SwOE1FEiiK!xD(R%THQQW9CC zEFP#KW(_;}t*s3>qNH)(OGjjh9d srKcW~AJib3eM zd0b z$B+5;5MP!Y#MqQcXr)64&zz=S5eIsghy#@LCB7{$oz3Op%_$1bdEWEx@~@UL>yS`) zO7vKp9BSJt$q(7LZH1GrH~+eTJgiD$l`pxTw>33#6d)H0`gPq6v1N}S2JocT21Q~L z&za^L<(5J;J=o9o!5Lqp1%>- n@!=XD9r zvLOPiU=?c(Bxgezk?0wv|ANs=^l^N$JP R=QUQOrD5Mx!$J^> znr2zqvKwzhU$iY9@X^^*^ES-XO<|pK3qxBC4)8)ut^ruZ`Ab+z`w55jNPAu!ue@hk z_0Y{akZa*j1 0X;h&zyH5K76QjEeV)+4*9-_mm>rQ7C zbmm=C$f3}AOS`zg-)a b 9PQKw2Hmr6U@ETPQX z!C)v?GJku|DTLs>>y}hCbm+HA`4Y`2q$P4H9i;K=`#k%7cZKwMXhvbZmNLV+=mnFA znW<8n448c(*3I_Zfyw*isT>>n;aq_vfVn+xy!OUP^yv$&dl?@3FB|EpYt?Vmx)s?f z&_3gHIj7=R_+D-=BSJSLzbOhN9kGyY W`xUM(k_U~(8s|%=LgS3JCeka`#X`PTx5tmmnX2TSAa1%#k1L<2 z0>|c+AX^@JujC$c{#Bb$o`{UA2o0z`U*zr&0J&KJDYeGa+v42W-Xco&7|@BcMz6tG z7~1+n<}R@;l0sVSkz6?5Z!b!8viPWD_j9s;Se-ZMLL+yKtwED@dvurw3B5V=0-cQ| z{Ao^2$S8-&$Q!QF9~Eoku%+ 0}M!IMw{X+TK3zD{SQgsv;~5TktRWFEczPYV?v4sn07WoeB z b;yai#=9A!(#76VPkpOiG4V z1s|`JSv`FmggXEV%DC65^@?1-SqMy93t06;rr9-n@Iw;4Ef?@>Vl8RcrSW (uev`1b(FOO;Y<@FvT;PYveqPU~3?_7(Xj&rJ*}oT@O6wQ0uDpKloI zE3=W`!g@Pe1n`T9n$6r~E+)E{!?WnJtg09lL3Pa~6T9oGVjf4&!9l*%a*Vv*R!1h1 zge(bBA3^}@cmTM`U6UWdRL05ttO()kf$S=XX@}O&RKwt6+40Z;R>Juu47luazl@EQ zw{UNV@i|6A3U7}cDir{U1pWfd*=Q*LJeh-QQ(_eA?qQnX=C4Nwfrxj+(l2$L^f>nk z5{*D5$9d%a@;j&Rd;=TG{u%wPeG0?w>XT4v5IU|Cs_4UE!P{#gNZT7?T7v}F3J&Xk z^5t21#WPw2cXQ>Nt6{~}Dll^#7Ey^gn;bi?856T)wPTz{KDgEm^NM&JKDHo)Q3#v%tXv!Lney}YOd%tO~@KRd=*=mg(9w9s;L{tnBI#5n6ved5r} z7Oc6>Y4<~lnFVBgczkkTgAbh)xlI!$APK!eooOsrLO&t0BgbGBqGK!$4b1R;GvVOx z+KUhavBKPf94J&|^-oBuW9j$(QQnRQwqfJ3ukN$I Bg8<@SAhysmjq{LXAEPuxc*^rx)rEC-*#CtLIi0&{upbw0s-*~+c% zbXTiK%|MrbI|h!{ZB48;KvKD?Ey5S5U(V*$zA+nCZhSOr*XDJk%O4dk%g^RPpkAxJ z5zKpdpL@2x$0~_;GQ<+_DTA~u+~F17Dh<Ic2WIwROO(;&Mjc32EJ{%Y0fA((Wg# z y&aJNa(Tp+uNkbeV8ivN+`gxW`NnRR>sA|N0#CYWcOkoKco z>b7@(Ku~NaOUny1BW`>8Es&B>eWY{i7W~6A!r|Tpmu?_eJxOh(wOyK&^15|sCrdGH zGyC4JCE8s?JThw&`O8_Jc6u|Q#^01zdcVqQX6G=*^={pd%1-eM#lXfl1LY?tb!^Gg zxS@r5MO|b@sLfy}^W}LlJQbRTpZL(hRC86nlA%7P5a-20_ax*#8ZrW$*MYU*nsj>{$(zp=u_(7Dy zR2jR)>;r|6vid *grS=V1jM |U4E$DvHKGJ4DpR_Ma)KJA(k!B<*ebxXG(aXO5yxt_iFz>+1Z-kA}+ zNmphsGY%tmxPXt>^n2)}$ooCu`alT{xKDCG=+WcVp0VSPvz7_jMB5*3TVebHI?3Ym zlN(NN8l8$%lkcT|uThP^G|PrH=hg-QYxGa{1Tcl%5FcRer2sMag*q7-o!V6|fUDsw zi~Fp7i!&&SR7PNRZ8C6{7ppAgv%BSSn)ZBA?!21y) ~+Ug68vP8@dA1HHwSuh z8A-Xd;}#?VmYzB)Hr3~9BH>TVoI`{QP6hwvNj?302U)x2J~T5GyX{f)WU&f`32Ld& za;0!o@ydUOd0Q -DKp1Bhz%GJ zNBTF$u^S@AEhkm!amD&FkaIG*&@FNB;?Ht$iZ0VP)Lf>}gJY+V_ yCw |KCZG zWKV&;Ot* &Tj;Ih0A4O1l!z~XtTs#h`IG!I@PCY>rSzpdQvDJ=I9;fz zO3gAM+f?jZLq>y^)B^&xCVEj_5z(E@|5+O!>|?90ewK{vIY;IH2LB&GD2m`um9hT( ztbCwYYU==FcDB!LdE}N($k=tD{j)u@7(3qk*W7Q%4|kpE_jf =(@r(h{Rr*R ?fiRS46~(UG_wD@9U-wgMXYiZ{R6F{_RSnHhp2Pp7EqjL((!I} z1qM|){Yr|ZanE+YPNu^q$3V7peX3gj*Ke7`R!>6f!Qyvo%L$1x4>>xofB}uEaVQlX z*2I=^?fSRmJik?KJ8LD1MXK7>sMnnSOz;oLn`GIt-6kZa7163jCrnM-lN|GV|Bxv^MKjPtco6`EN*urV@G2Bq0OF!x%G7L z%Bp@!aBTu2$%zBw2TCw6I`qeh5-N1NiMmY(VGG83A5%I48^3RG;10)zt7YTQg|tCn z)CAnPF5@jf=nwZmjkmNx7hCaT%NL%*lWIKyZvMxJ27MYm-<_CI2*OZ!-`?K;UBU@Y zLKMGTRac!t6xm5pjytb{&}Os@zi+i1S+IxlAzEn9E!qT#3;1A7kjOCVS7zwBq2prH zR=4!}%c!{XM$d%2=lY`V&bb6upy~4axcf=+(1RnXsdo{$$`BAO5xi; eZiSOVJ v%v2vax5J2$ezu{jT@+(kb=-Ul{67B zgL9GbJe9XuAUz)l#R4+;r||0pM}C=PD`EW&7&L6|Ie(l{SV039nSeOI(JdT%XrAxL z&SOxD8sV;ntp!f~quC&7g kWQ>uLRu2EyhJ1Ev789 R7ap3zbYh%GKP#c9{U{5#FBIoIE6s0l78wajtKb}a zFj*RSJ_#6#hS| =#oT-o{wEBhhLinLjKM?rbI zSm0 ?HR%6VxjS1Uv zvvq2wCv@(zO2?NytLXC F8l|wjb^tgjSC+X~E@r z*y%vHevGiOw)prkw`FsC2%IOTJAv>JRw-K0B%F|+B=FF@FTlb8#A31iZ{s1%99)YF z^P16eK544N)O*hnn(XQ&3J>pbv@bsF*(w@PEtu(cR9UDOc;nx a1*b@;PzqxV6Ybxh)CHZ$a z<8UW}%x`GnwH$HMK`&+k--)4w+7#0A*q(=JP2n31upqwrdEIW{-+~HZh0JwqhJQ%A zt8~;gvZCwpq%GfNkMO+-XR|?W)wF) mFE`(^ z+gKGc5*;v4 t=c`Ei z=0Y7-m3Ut%M-1_(1A}5@C2FTLT $|)T5$U&ATw?l)>L6LFNsWcmPfD^^2r#c zmEFDWzp)D3!YNct9_M(g*arX7WmKBH)XOp}2RT8 x7h$GcazDHnIj|pB23se zuH;OIb3;CZ&O|xt6^!kG!ZTaw;L@j|gMaPMS)j+B<1i7>&x@L)U)6Pcg6&pTh3>N9 zU%vJ8wWJK3_;8Qhu~^%TAgXLeyg_&&;w +{{4RxXC2iGm}9UAQDVT`v~tq+*t zY~*JuQrf^bH*4Y>70{bm2r7*m8v?%W#q~Y>>p%nFysLZ)3~7m@2{HKOGPQJAX%&^Y zzay>US l0aYyUqbkPGp*PZE>5ls>|k_*QoApAem!AT_}SSz^@B**}+z z_&y->diR7RBb|i!n^j!;v%p~wR`9>q0#gZCX-k|0q?5qJ18u6LU6HhO4eOnB+A{#v zc3b8FO5TmC__nSubYCv=IB(=pL4E#t8MSr?`TQP=z$sCKtvJ>M`JskrUE&V*;sHYw z(~h}#L@21AhQcHz2?HLf=i ju&fvyHRQ zJx<&3dwi!G*5~#oJJ@&zQUBY#l1zQKw^GIpD}XC8ys}NU3i2t~TetL&3rZBqL3SQ; z^8Szux&_$EM%-$UuU93;y_Ge2-Kx%4c%DON8MO74w4v5Kw7o{=wce=3xXGB4Mq~~H zZWIlR%uYF48Hr*_E|gjlY6J4xPQ|snRX9BV7>X^@dp=?-9vh;jKPO1rH|~D&m9BXg zXcwbLNC0HAvFAZ89yG5_>^9v(Hc)J}H_0+si(1xL@NzXQTI0tV_>Zk)1|~mM4_Q@N zYgUEtH5eHi)$8M3n&nTr*V&phlrZlk4x8{1QRk@nvozn%|_48}o@iN+*UOrK$F` zgwtgv&W5 2i7IK(`Dx=RS$+9!Yu3oyEQ#pP-Ca}wIuY8>@v|5w)c$P~Kx~L3qTsF%J zH1)S%Q^N;2!q!780j;|k7R}f8QjaEn3f?vPz2-!d_N|EL=x&{YYM3=dKAvxM^b$1c zq{Bor@Z}x)GHfj99rma6;dCo{YE~YzGM8&TU;Gxb)W 1)4asq z;MdR2jP+^~3HAPVT51xr7z}6)W6qr`Q&heaqtkr1OVsfc$Rr+I=y4{cr+r?RHBlS+ zbvAJ7X89w_K30NAVX4` -M@5Zdj z66*7&S9x|!`i~KpJ!w%%=rkkrN`te$ c!F4LFu~e zBir2>_V{;N)G1BgpY(#>PNkcd?2+q9(MD+h%ApMXRqV)q)_R| }h?G0bwI&(e&LlZ${MhRXHvu4ylr#)nju*iy2!NjmAcc>>?T(H&^7<>`{n zW$OGjT7!DbS7aoFmYsB{_>uHifu-2(QO6Hwxd`X=pM3srcU^$WUsOiYp_DEU_xIm! z*qcV(nwRnVURX{$nS~x5niKI0PikQ;Babn18H*WlUA$L}D(FNjti2-7db=iJf?G(i z3fclGD;%}Ni5=-(j_Kn^s@TkGpDplIT8qbl4rdi&BW*pZ%D02n7S)D`*7>J0wBb%` zM;q<=F0%uCVq4~UZIN<0uegA=`);6FZ*cCSRe9s(1BjCFz=IMQ_Fyf~h5ID|G^c~0 z%4hNlrj&UA#Gqpxv%hVESS=(o2&F6MWjJF(mI>n8?AjV1tVcMddf$D2>OUo?JqS-v zdJ%mRqS44A*Zjztk=*qHx##*(H#sU+8a)+OnHl6Ao5~M>{1xD=oQhf`26>N3w^~m| z&Ddt63NEPHJ$|w6xN;UPjmjEmD~}i-M~$K4jG-4@bofrM)%Ssh&sACDG@z7@Tg7rU zqG1G_+3c(&7l76Fa%rVAItbdzpei_?YrNrHHRGG(&m3{MQ#y7;;3y)MITDO1zFOi} zb(v)S8sGX%l&EGr8rl9DF4=ayq~3GhZ(dTyL__>-C4ScF)@^9~=&?41YafKBUX#@2 zYkXCmzqBNkXrJ)AOd!>vPvR@j{X&|53|`}_pyt`;Avt~j)vPaB&mYz+s>4`n?>T0b zh4C943hpx9zxT%a7TJfOj)$b<;Yk&bmZXcN0(h{(C~i-Uwnex);FEan*beb5@La68 zwPK6jA*-p%33|a=uM(p$q8rtzkMH>?FSbrH3S6!_AwJAHnH51DMkb8QZ-|`=3T_pb zwzybPf=ldsgib(>Dg#!Qki#46_krX`m|~twV(ji6+WdOb2=Sl)*KHu>i5TYc{`bc% T8@2H(qeWd=>ve^qb@=}Sfyh#R literal 0 HcmV?d00001 diff --git a/images/guide/vuepress-architecture-overview.png b/images/guide/vuepress-architecture-overview.png new file mode 100644 index 0000000000000000000000000000000000000000..4e64bee976b5dcf7e37aa88f2ad63357ec69bd02 GIT binary patch literal 50904 zcma%iby(DI_a-gfDLF&8v@{IeDTpAT3?WE&cgY|_cXtSgq@;*2gmkBL2}n!thwuBo zzuo;^yL;_l#`T%!IZvH)pZnY=T3b^I5Bn)L5)u-gin6>e5)uj&2?@Ci69f1kTsOBl z;16V1T_p%o^)SsY5)uQFioC48m+9|ztTg?p2I1Qa2?Ngwb$;Pfi9tdI3?0JBs1NbD z!(Se(tH+o`_(TFaF9lkdL<&W=a5z}7d!yEn@EM*XeZUMsND%zQT@sWWnL3xW6S;BP zb9<5fbXdy0!Zv$*b*y^c_n={=LF=e#=9TXOQ(WIVvNQ~du?zDV%CJJ-dm-({l1~BQ zdO_Xg_R`xIpVFR5eR}@Kr`B4sSrH}M5%=a&nV6)m_VfD3e}42b2FX54W79scoZbuj z`JY_-zP-x_)Vmzp8__1mA7RJuegx0Rxy{JIJDJnq=vbs87HE{niZWCvtfmf2g8Ltl zybFT{o4g2^C1@%a@U@otI_dZwcx&JI@pvJ;B-zXes&zUfp=U}4uYz}L2w0#cgwCjn zK}6 HIOrO&BUts%Yp;ebiN!X7Q7M4ke^ zDD=}gNs7Ix7c$eod !;nBSMO7!%=0oB#2D~iLHje-LEii-=G0Ja{ zYl6^A3g916W@tM#Z?Ruc-gA6h!8#oRK4c(8OM{1pkT+RAPRU?`*3t1 !L#cihQjE9{lKI{23u0;^@3clH@|seH!*J}2k<>*%R+&f(Tah@YYRy;XR>7a z`}dq){0acJ+nf=FwsmW5oPBB3@#Pb0rOo^{!aOJDaPCqXgN(_QW=j!UGk=0Z66+s- zROZr^sVASXzZL_t3xvjY13M>0_-9h2%fA9m!x#UXo-yyMBDejp-$!O~XJesLZ&>uG zc4|jnY=^Q!l?am7_l5eLZ?zSuH(gFA#_Y^NUrAed!ZgQ!1PavYPHBWO3joLebT32U zLy$Vz^A{%JjJ|`~ug7LFvJd@F_^ebt&wg76^mEJE@u6&h3Tu13=qV(O1@)JFD|K%6 zZXi$Zl5@QepimR3dGIb*1d%c>+S88NkZXcz+vQEbq{yoM(u&O64@CxZ0+Qc|>SA+g zzW2t(`LHKtq=bwax+&DihVLv&8fMpVr31GVqWEj**fw6XcJnmR#^GdmGt23P7A$j` z5t_dEtp#(Z|K&v%6(U1msb!$f3MPZgpnbW;G1<|gYg3Vw)PM87lt!2pO3ytPDQT?Q z_KVtIK?Ih*h?i8_P4Ia8D1yJvv-q`dp*8vibgT8t7K*R#8DEPVI!|-ips}eNows(z zT!>!&l-;U#L|;m!=0|}A1)}XqUl9x8ER*7yNVh9#{B>E^&wC%+yfW^n8~DN-)u5w; zf)piQEBD(0-|@UDf_Dh|_&XU~khYFNoI5?uxBR7T!B4HEn{RqQq5k6dwOByOZ%O@P zFz{MDUZ6MU^UFr?{-HivQ7O!206XAPZ+~j>jxleK+I%$kj-*Z`cjcqrkL3AZg)AOF z$YxB-3N6}Ix#EGXdN1?qlmLG{)1B45XeeBi09N}3N(Vtlam%RNqIZnR`h069S@9M# zr5}??0)?#8PjMq@bJ0I>d?Hm!@^OpeB#mEb?T!j;Mo3Xg<*Rj5ha;P#tsw^=P;0*V zStmEIj}dzqRq04YNT8?IEQ*K)U&bG~q6Bsu<+8q~KuOv$yZc=^@bKrI9HQfTgHm{h z_-{IF&eDZ0lBkvdnUS435IDGP`9L9zyzaOc#=(<*430^b7TRMor*Xq1#oX8w687mP z ?mY^Y$0AsRwE;l z0_3~>gZ5Q6pX#s9i$>Y^l#f2l0!_-xGA?CD%YDG1&GRMAh_I@jo;(6t9#gen!f^9s zM(Lf41Q#Qm5_9tYRC2PtQ}G=ZZY*2}{hsV$z7phn6UVzbkre%T*eeAKhLqi5au)gX zDT+X+2%PiUxSdX)s1C 15eHNI6pZeQYJ|(gcCL1HPR}AW=^Y Bfak%`WNEDsnHWQq$+4c&PYgx z_MQ<+-`+y++u^|N%6B+Gm*(U?Ql_5v1aR5GI}Ej}g@u3jCM@3m`IhR@`$FV0<|Fv{ zIY&6t#Vw{&EDFZMTpbn10t43s9Gws4I5ep4^5+i7_qbCy PY$ZeArNgQtcxpvL&^APsV2?MTUDq z?Te0Gthuk7k& }+4YL8RR_kMRAM>35>0WU=7PrXEB_s=iFD_Qswzs|>)isTuCPiUu%v)OI^7tdiBAQ_ z(XIcJJ-f^wSjJ-S_Ipa}s^|tym%~>{c)lS9TMIsai}f^H4xdos O6P@= zV_%*u3Lh_V6MU4>%xT!)8T!n@<^PWL!*$blp%q$6F*iE%^SV$rapRbM2YMK6XmZq2 ze%9hh#QO7I>>Wh)fr!@mr%8t ~~n$%egB=7-)$L2 U&U4(mt>T|emEhF?hqwzpN&6^CK6t;1Jj%a?*RA*(z><}<2 z{UXpCUBmbie6)SZ*kGpRwYR5pwLmeZYw+>5lup(qA1~)Dg )kO!r$39;iV&%H_~*;P zKKfC?%NhfEITsgVY;jAA3rV>`2sX;6cJihtxjd3Vr_AnuFS6yr0utca9M$qx9vlwM zu54oNBle8F$6>fgQ)q>m{A}gR^q=*w9O$H9e)POw_R)J1&bdp#5RerUG=LW(+*%>s z0ZTdk ?eRG!$}Y9R=uP)Vm6Mjwi^N`Nz4T7%dJJMY~XQC{;L zxIq*}o{xr~R`(sD5m_F*^C;Y!y43DG!8z7ZO~qF}n4--g7s h&0{GQG6PM6B|wgU;p1{XS2|21kNoJFU$d7Ba0@XMI0&PR7NKPcP|d zxrHq@ _ ;X3PhNF{;CTWXbsDdUA_AjB1+gU!JSQvA4+ z<#yE!n8A=t10+X9gbfVvVrVKwC>i%>jSvcPOPXc9h|QYAZ@>7m$LzGlj~_x6J-h3v zZ;)- EG>I z7Lk&7o%i@F?@o3cK-nfmAA|(`j`8X`{F&=IJwL5uQL)d~dXQ9@`F%P6*v}`IbjMK_ z4!_%^$o1X8rMo(pw@l>2#_zp3{}K7)ug`(AdTR@Pgvq=SqfN(&+wImLuPFKC^_b)z zY@$YtkdH~yf_o>`l=q)_OqqBoAuN6QCXJa#^dFNZp|V`NRNh7ueiz@~5Y7L7mBcC` zI$8aBITnwe9({8Mo*H`%Z;Eqi5Hne$t^UN}*p*uOaqZWzE}`ONit@hYgl~awE=nwP zRN}&(6Mff2$KXj^q|4&?XrNc$sLLXc7w6@B(HNr@`Y<)0=0AXg7@OSb)wsl`ST(wH zb=nq{owW*ZBwW;R2 kC=IctInpsPk3Rgxib_D9%5ix?*8g;7|yjrW7yqefqHq`*)|8+v8 zV0tl0+HM|Kcr$X-V|I>n{X4K~BBJ*6GI-Bh;YC0QA^(ZNB#>O3b4rn{@?yU$x!8;N zeKZW2*S=n_K9@`tRX%%YxeR>be&h#>h+PP>64CwYAwQfg^5Ft+zf*Q;pYxZLF^kIt zf2mnSRc48us7?afnBwnu?}03(p$+M1oB_+ORzk4l{JO{FBl_0>Rjy ztC>IgGbr!M9}^By>1H~1$yTrO30)t$21h?kY|(MQGJ9JcL+Faw1deo|-JG6r ?NQ9t_TS_!2^k) z`I(f$D+CtNT1i&TP %wBDJQD>Qj+xSOT5ARD*+5`mK-_FEKoGcaO<6Ua $d7&V zb%~qpcN%w;j*nHvA16YcJgDP|pZ2g(Djm<{l+b!lKKAj=Zbjw|4p@$0SKhw-OlJGA z1!0#OJ)glcmXfo(LKPJ7eLhq qlsdGm Bo+4(snY Ae$S-irA$}yy zERETzhRczVDdAbWt)?_C<=AI3G1|j0icj=DHazleY$I@de?(CL*pn#}0rhamz$_hq zO62NjOVs22JL%BA4eo~6`u@Y0Z}(a%WMkn9;0=O2Pzd?Ks4qGLv49j5B)Sql3GxqO zX`0QG#EV7T5930Yo@v1O?d5pcL;tFcqmFfKnuH@p3U2G`-`tJ;-83k|-;F7%uQw2N zKR3;xRzZyS;gP6p_h*YUG+0vz9!Z0hO>B=2o$mhfOcc4k2pjUhpsCp64!Tii*A*iJ zHw5z5>(Au9n~`N=W(IA4Ggg3zNxoXBbBV`E9{)_pojg^*Em{3= )aA`{u~~<+sv-a%u`>CjrMnUCc?WWi pASvkfaB=rl+rxl^?10T-(fXE9-|=R}Ta8A) zcQ$nL?|le(dXm4~U?*H`xh^Ppd0#Ba$(Lyk?*l$DZ$lr?YM6FM!Q{3*$ap5V+xm$1 z1pH&1daByOAaf%?1%Zf>rz?N6&O_u{&=PQcfebIz(5h8A0&XID3sb@LeZn-2f{K(~ zWrq4GDzm6#nXAQc==XNb`KMS^;q$Llw8IT|#wkFF{v$bM7a2IaN|f3i40mfuS0*lZ z(dQN7lb~(Le#^rjoUkF(D&sL9rHxvwRKWTA!(D>i5_sHRP;I`a!eWWlunW~}OK3{C zH-E-hnSbjdWH%T#gq#1YBhC||_$0^FpPrOwu !4m6my=bwL zX Mx(OkJC_}xF Vx;(p4ZMiF~5@reTc-H9N zp)BG2DICw$BoMRTzMSJd7sU{}ns;{s6m1h^=TW$qu8^k<@@}rH&Mol9T
2p6_ub2-XfcZYXB&&@DgR=7JEk>?M* zE|zPkSt?aS2g%vGyle^lM#w+@1t2bETuLDucW0*D53u*LrqW_l>5|r86-iaB)~`P) z?=F7h4BL}()%3a=9sQ+HeY*+oR~gSJH) %$I{s z>FSdyxrwDRxkL0EAjX;jz;#4vXe9c73)yJ#IlVeqgXS=W1`n7jf1kLKvQcMM&tB4c zU+bdBD{8dFLS*Vtbs%niGZdV--Vd+3P1l@_zw9w%(@MYr R%fW zo>hS;Vm NtrDRt04Tm7mAvk5wl&aHq0NBY#fFb1c>=hhO#A1V=Z}`a>$eN)y%@w zw@`_XkCO}8B*RbOkz=MlLz^Z=kuZr?(re}?K{YPiPdu_v xJoLsWJ6fG zvlB9kyt%)Bc6{y+aFC%HD!I>Dq2s7>F_K69k#Lh={(nC}oHo88vV^cioBVIyQttiY z+W?$PQS8$q 5khc=0QQ!dpsWDi$?@#;)B6a<)c+*s)h z;{r8*G74(s(5%9$oKH2KIi8;mU?D(j6~CebAsAh$tm+QG=UR46=`yr2(-+G|XlfvF z0qFKTYNaIMefW*jv-#uH8!cG+7hpyKg$@7szG_#`)UDlwb^YWSi(ynoL0+2v A;i-6^`s)C3>2scIum2wFvQ$%;PZ`Lle$s3%dm z3eTW#!qT zZFDF{XGjo-9hg-8v-Q`_hC6jFpNlnU`Hggctdze}nT;AE!QeDq2rYavfI1u=#SzX` zJj~ACzcbd97n@pH-H6qPpVX9tEi}1yD#D81X)zxKg_Iy|K5rQuH`DEGTrDjLf#~(p z *mS(#OBe6Sv@V$BdSaK8h;t%(hDPq zC&gB>(!5DwApH3xF8`zn=hbOh-4}U?l=tSi62Wx0U$B8y-n_ZK+DF>~kf;h4i1CPJ zE^!Mk+$NpyI)dN8K_tUN+o4A3)CUXF=&VEy(R9U)gkPP!dUeObiUvw#ra%-v+YVj@ z&l&qrm+3Zl$h>