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 @@ + + + + + + + + + VuePress + + + + + +

404

How did we get here?
Take me home
+ + + diff --git a/advanced/architecture.html b/advanced/architecture.html new file mode 100644 index 000000000..9de2ef658 --- /dev/null +++ b/advanced/architecture.html @@ -0,0 +1,34 @@ + + + + + + + + + Architecture | VuePress + + + + + +

Architecture

Overview

vuepress-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

vuepress-core-process

The above figure shows the core process of VuePress Node App and the hooks of Plugin API:

  • In the init stage:
    • Theme and plugins will be loaded. That means all the plugins should be used before initialization.
    • As we are using markdown-it to parse the markdown file, so we need to create markdown-it instance before loading pages:
    • Page files will be loaded:
  • In the prepare stage:
    • Temp files will be generated, so all hooks related to client files will be processed here.
  • In the dev / build stage:
    • Bundler will be resolved:
      • extendsBundlerOptions hook will be processed to create bundler configuration.
      • alias hook and define hook would be used in bundler configuration, so they will be processed here.
+ + + diff --git a/advanced/cookbook/adding-extra-pages.html b/advanced/cookbook/adding-extra-pages.html new file mode 100644 index 000000000..a5f0dd105 --- /dev/null +++ b/advanced/cookbook/adding-extra-pages.html @@ -0,0 +1,60 @@ + + + + + + + + + Adding Extra Pages | VuePress + + + + + +

Adding Extra Pages

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.

Add a Default Homepage

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)
+    }
+  },
+}
+
+ + + diff --git a/advanced/cookbook/index.html b/advanced/cookbook/index.html new file mode 100644 index 000000000..95a26cc79 --- /dev/null +++ b/advanced/cookbook/index.html @@ -0,0 +1,34 @@ + + + + + + + + + Introduction | VuePress + + + + + +

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.

+ + + diff --git a/advanced/cookbook/making-a-theme-extendable.html b/advanced/cookbook/making-a-theme-extendable.html new file mode 100644 index 000000000..7b6cf4bc4 --- /dev/null +++ b/advanced/cookbook/making-a-theme-extendable.html @@ -0,0 +1,68 @@ + + + + + + + + + Making a Theme Extendable | VuePress + + + + + +

Making a Theme Extendable

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.

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 alias when extending or using your theme.

+ + + diff --git a/advanced/cookbook/markdown-and-vue-sfc.html b/advanced/cookbook/markdown-and-vue-sfc.html new file mode 100644 index 000000000..2a33bd8d9 --- /dev/null +++ b/advanced/cookbook/markdown-and-vue-sfc.html @@ -0,0 +1,64 @@ + + + + + + + + + Markdown and Vue SFC | VuePress + + + + + +

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

Hello, Vue in Markdown

Current count is: 0

+ + + diff --git a/advanced/cookbook/passing-data-to-client-code.html b/advanced/cookbook/passing-data-to-client-code.html new file mode 100644 index 000000000..3cfa781af --- /dev/null +++ b/advanced/cookbook/passing-data-to-client-code.html @@ -0,0 +1,59 @@ + + + + + + + + + Passing Data to Client Code | VuePress + + + + + +

Passing Data to Client Code

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.

Use define Hook

Plugin 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 }
+

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.

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
+}
+
+ + + diff --git a/advanced/cookbook/usage-of-client-config.html b/advanced/cookbook/usage-of-client-config.html new file mode 100644 index 000000000..f251a32cb --- /dev/null +++ b/advanced/cookbook/usage-of-client-config.html @@ -0,0 +1,120 @@ + + + + + + + + + Usage of Client Config | VuePress + + + + + +

Usage of Client Config

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: [],
+})
+

enhance

The enhance function could be either synchronous or asynchronous. It accepts a context param with following properties:

The enhance function will be invoked after the client app is created. It's possible to implement any enhancements to the Vue application.

Register Vue Components

You can register global Vue components via the app.componentopen in new window method:

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.

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')
+      // ...
+    }
+  },
+})
+

Use Router Methods

You can make use of the Router Methodsopen in new window 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.

setup

The setup function would be invoked inside the setupopen in new window hook of the client vue app.

Use Composition API

You can take the setup function as part of the setupopen in new window 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)
+  },
+})
+

Use Non-SSR-Friendly Features

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 onMountedopen in new window hook:

import { defineClientConfig } from '@vuepress/client'
+import { onMounted } from 'vue'
+
+export default defineClientConfig({
+  setup() {
+    onMounted(() => {
+      // use DOM API after mounted
+      document.querySelector('#app')
+    })
+  },
+})
+

layouts

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,
+  },
+})
+

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:

import { defineClientConfig } from '@vuepress/client'
+import GlobalPopup from './components/GlobalPopup.vue'
+
+export default defineClientConfig({
+  rootComponents: [GlobalPopup],
+})
+
+ + + diff --git a/advanced/plugin.html b/advanced/plugin.html new file mode 100644 index 000000000..f11d4a835 --- /dev/null +++ b/advanced/plugin.html @@ -0,0 +1,63 @@ + + + + + + + + + Writing a Plugin | VuePress + + + + + +

Writing a Plugin

TIP

Before reading this guide, you'd better learn the VuePress architecture first.

Create a Plugin

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',
+      // ...
+    }
+  }
+}
+

Publish to NPM

After creating a plugin, you should follow some conventions in the package.jsonopen in new window file before publishing it to NPM:

{
+  "name": "vuepress-plugin-foo",
+  "keywords": ["vuepress-plugin"]
+}
+
  • Set 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.
  • Set keywords to include vuepress-plugin, so that users can search your plugin on NPM.
+ + + diff --git a/advanced/theme.html b/advanced/theme.html new file mode 100644 index 000000000..803073059 --- /dev/null +++ b/advanced/theme.html @@ -0,0 +1,91 @@ + + + + + + + + + Writing a Theme | VuePress + + + + + +

Writing a Theme

TIP

Before reading this guide, you'd better learn the guide of Writing a Plugin first.

Create a Theme

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.

Publish to NPM

Also, there are some conventions for theme in package.jsonopen in new window:

{
+  "name": "vuepress-theme-foo",
+  "keywords": ["vuepress-theme"]
+}
+
  • Set 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.
  • Set keywords to include vuepress-theme, so that users can search your theme on NPM.
+ + + diff --git a/assets/404.html-6Yl8cQE3.js b/assets/404.html-6Yl8cQE3.js new file mode 100644 index 000000000..7a25b17a4 --- /dev/null +++ b/assets/404.html-6Yl8cQE3.js @@ -0,0 +1 @@ +const t=JSON.parse('{"key":"v-3706649a","path":"/404.html","title":"","lang":"en-US","frontmatter":{"layout":"NotFound"},"headers":[],"git":{},"filePathRelative":null}');export{t as data}; diff --git a/assets/404.html-VtKSq7T3.js b/assets/404.html-VtKSq7T3.js new file mode 100644 index 000000000..8c876760d --- /dev/null +++ b/assets/404.html-VtKSq7T3.js @@ -0,0 +1 @@ +import{_ as e,o as c,c as t}from"./app-eU2v8o1B.js";const _={};function o(r,n){return c(),t("div")}const a=e(_,[["render",o],["__file","404.html.vue"]]);export{a as default}; diff --git a/assets/NpmBadge--lRFx50g.js b/assets/NpmBadge--lRFx50g.js new file mode 100644 index 000000000..f33a2c708 --- /dev/null +++ b/assets/NpmBadge--lRFx50g.js @@ -0,0 +1 @@ +import{i as r,j as t,o,c as p,a as g,_ as d}from"./app-eU2v8o1B.js";const l=["href","title"],i=["src","alt"],m=r({__name:"NpmBadge",props:{package:{type:String,required:!0},distTag:{type:String,required:!1,default:"next"}},setup(a){const e=a,n=t(()=>`https://www.npmjs.com/package/${e.package}`),c=t(()=>e.distTag?`${e.package}@${e.distTag}`:e.package),s=t(()=>`https://badgen.net/npm/v/${e.package}/${e.distTag}?label=${encodeURIComponent(c.value)}`);return(u,_)=>(o(),p("a",{class:"npm-badge",href:n.value,title:a.package,target:"_blank",rel:"noopener noreferrer"},[g("img",{src:s.value,alt:a.package},null,8,i)],8,l))}}),k=d(m,[["__scopeId","data-v-c758b2a0"],["__file","NpmBadge.vue"]]);export{k as default}; diff --git a/assets/active-header-links.html-Gm5kCTnU.js b/assets/active-header-links.html-Gm5kCTnU.js new file mode 100644 index 000000000..2316b62ce --- /dev/null +++ b/assets/active-header-links.html-Gm5kCTnU.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-3ba02eb8","path":"/reference/plugin/active-header-links.html","title":"active-header-links","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":"headerLinkSelector","slug":"headerlinkselector","link":"#headerlinkselector","children":[]},{"level":3,"title":"headerAnchorSelector","slug":"headeranchorselector","link":"#headeranchorselector","children":[]},{"level":3,"title":"delay","slug":"delay","link":"#delay","children":[]},{"level":3,"title":"offset","slug":"offset","link":"#offset","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"reference/plugin/active-header-links.md"}');export{e as data}; diff --git a/assets/active-header-links.html-NWwmfOvm.js b/assets/active-header-links.html-NWwmfOvm.js new file mode 100644 index 000000000..2451806d4 --- /dev/null +++ b/assets/active-header-links.html-NWwmfOvm.js @@ -0,0 +1,11 @@ +import{_ as d,r as n,o as p,c as t,d as s,a as e,b as a,w as o,e as i}from"./app-eU2v8o1B.js";const h={},u=e("h1",{id:"active-header-links",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#active-header-links","aria-hidden":"true"},"#"),a(" active-header-links")],-1),m=i(`

该插件会监听页面滚动事件。当页面滚动至某个 标题锚点 后,如果存在对应的 标题链接 ,那么该插件会将路由 Hash 更改为该 标题锚点

该插件主要用于开发主题,并且已经集成到默认主题中。大部分情况下你不需要直接使用它。

使用方法

npm i -D @vuepress/plugin-active-header-links@next
+
import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links'
+
+export default {
+  plugins: [
+    activeHeaderLinksPlugin({
+      // 配置项
+    }),
+  ],
+}
+

配置项

headerLinkSelector

headerAnchorSelector

`,9),D=e("li",null,[e("p",null,[a("类型: "),e("code",null,"string")])],-1),v=e("li",null,[e("p",null,[a("默认值: "),e("code",null,"'.header-anchor'")])],-1),_=e("p",null,"详情:",-1),y=e("p",null,[e("em",null,"标题锚点"),a(" 的选择器。")],-1),k={href:"https://github.com/valeriangalliat/markdown-it-anchor#readme",target:"_blank",rel:"noopener noreferrer"},b=e("code",null,"permalinkClass",-1),f=e("p",null,"参考:",-1),C=i('

delay

offset

',4);function g(x,E){const r=n("NpmBadge"),l=n("RouterLink"),c=n("ExternalLinkIcon");return p(),t("div",null,[u,s(r,{package:"@vuepress/plugin-active-header-links"}),m,e("ul",null,[D,v,e("li",null,[_,y,e("p",null,[a("你通常不需要设置该选项,除非你通过 "),s(l,{to:"/zh/reference/config.html#markdown-anchor"},{default:o(()=>[a("markdown.anchor")]),_:1}),a(" 修改了 "),e("a",k,[a("markdown-it-anchor"),s(c)]),a(" 的 "),b,a(" 选项。")])]),e("li",null,[f,e("ul",null,[e("li",null,[s(l,{to:"/zh/guide/markdown.html#%E6%A0%87%E9%A2%98%E9%94%9A%E7%82%B9"},{default:o(()=>[a("指南 > Markdown > 语法扩展 > 标题锚点")]),_:1})])])])]),C])}const w=d(h,[["render",g],["__file","active-header-links.html.vue"]]);export{w as default}; diff --git a/assets/active-header-links.html-fvsIO2KT.js b/assets/active-header-links.html-fvsIO2KT.js new file mode 100644 index 000000000..20fa62d90 --- /dev/null +++ b/assets/active-header-links.html-fvsIO2KT.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-231b4d69","path":"/zh/reference/plugin/active-header-links.html","title":"active-header-links","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"使用方法","slug":"使用方法","link":"#使用方法","children":[]},{"level":2,"title":"配置项","slug":"配置项","link":"#配置项","children":[{"level":3,"title":"headerLinkSelector","slug":"headerlinkselector","link":"#headerlinkselector","children":[]},{"level":3,"title":"headerAnchorSelector","slug":"headeranchorselector","link":"#headeranchorselector","children":[]},{"level":3,"title":"delay","slug":"delay","link":"#delay","children":[]},{"level":3,"title":"offset","slug":"offset","link":"#offset","children":[]}]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/reference/plugin/active-header-links.md"}');export{e as data}; diff --git a/assets/active-header-links.html-sIc4BSCl.js b/assets/active-header-links.html-sIc4BSCl.js new file mode 100644 index 000000000..cf9c5b062 --- /dev/null +++ b/assets/active-header-links.html-sIc4BSCl.js @@ -0,0 +1,11 @@ +import{_ as c,r as s,o as d,c as p,d as n,a as e,b as a,w as o,e as i}from"./app-eU2v8o1B.js";const h={},u=e("h1",{id:"active-header-links",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#active-header-links","aria-hidden":"true"},"#"),a(" active-header-links")],-1),m=i(`

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.

Usage

npm i -D @vuepress/plugin-active-header-links@next
+
import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links'
+
+export default {
+  plugins: [
+    activeHeaderLinksPlugin({
+      // options
+    }),
+  ],
+}
+

Options

headerLinkSelector

headerAnchorSelector

`,9),D=e("li",null,[e("p",null,[a("Type: "),e("code",null,"string")])],-1),v=e("li",null,[e("p",null,[a("Default: "),e("code",null,"'.header-anchor'")])],-1),y=e("p",null,"Details:",-1),f=e("p",null,[a("Selector of "),e("em",null,"header anchor"),a(".")],-1),_=e("code",null,"permalinkClass",-1),g={href:"https://github.com/valeriangalliat/markdown-it-anchor#readme",target:"_blank",rel:"noopener noreferrer"},k=e("p",null,"Also see:",-1),b=i('

delay

offset

',4);function x(C,E){const t=s("NpmBadge"),r=s("ExternalLinkIcon"),l=s("RouterLink");return d(),p("div",null,[u,n(t,{package:"@vuepress/plugin-active-header-links"}),m,e("ul",null,[D,v,e("li",null,[y,f,e("p",null,[a("You don't need to specify this option unless you have changed the "),_,a(" option of "),e("a",g,[a("markdown-it-anchor"),n(r)]),a(" via "),n(l,{to:"/reference/config.html#markdown-anchor"},{default:o(()=>[a("markdown.anchor")]),_:1}),a(".")])]),e("li",null,[k,e("ul",null,[e("li",null,[n(l,{to:"/guide/markdown.html#header-anchors"},{default:o(()=>[a("Guide > Markdown > Syntax Extensions > Header Anchors")]),_:1})])])])]),b])}const T=c(h,[["render",x],["__file","active-header-links.html.vue"]]);export{T as default}; diff --git a/assets/adding-extra-pages.html-1UmMYfeg.js b/assets/adding-extra-pages.html-1UmMYfeg.js new file mode 100644 index 000000000..6e4cf6020 --- /dev/null +++ b/assets/adding-extra-pages.html-1UmMYfeg.js @@ -0,0 +1,27 @@ +import{_ as p,r as o,o as t,c,a,b as s,d as e,w as l,e as r}from"./app-eU2v8o1B.js";const D={},i=a("h1",{id:"adding-extra-pages",tabindex:"-1"},[a("a",{class:"header-anchor",href:"#adding-extra-pages","aria-hidden":"true"},"#"),s(" Adding Extra Pages")],-1),d=a("p",null,"Sometimes you might want to add some extra pages without creating a markdown file in the source directory.",-1),y=r(`

Add a Default Homepage

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)
+    }
+  },
+}
+
`,3);function C(u,v){const n=o("RouterLink");return t(),c("div",null,[i,d,a("p",null,[s("With the help of "),e(n,{to:"/reference/plugin-api.html"},{default:l(()=>[s("Plugin API")]),_:1}),s(" and "),e(n,{to:"/reference/node-api.html"},{default:l(()=>[s("Node API")]),_:1}),s(", we can do that with ease.")]),y])}const h=p(D,[["render",C],["__file","adding-extra-pages.html.vue"]]);export{h as default}; diff --git a/assets/adding-extra-pages.html-8nHB5UGr.js b/assets/adding-extra-pages.html-8nHB5UGr.js new file mode 100644 index 000000000..4946a8308 --- /dev/null +++ b/assets/adding-extra-pages.html-8nHB5UGr.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2a57b498","path":"/advanced/cookbook/adding-extra-pages.html","title":"Adding Extra Pages","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Add a Default Homepage","slug":"add-a-default-homepage","link":"#add-a-default-homepage","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"advanced/cookbook/adding-extra-pages.md"}');export{e as data}; diff --git a/assets/adding-extra-pages.html-gbWcNXLf.js b/assets/adding-extra-pages.html-gbWcNXLf.js new file mode 100644 index 000000000..90f951546 --- /dev/null +++ b/assets/adding-extra-pages.html-gbWcNXLf.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-5b617736","path":"/zh/advanced/cookbook/adding-extra-pages.html","title":"添加额外页面","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"添加默认的主页","slug":"添加默认的主页","link":"#添加默认的主页","children":[]}],"git":{"updatedTime":1701614677000,"contributors":[{"name":"meteorlxy","email":"meteor.lxy@foxmail.com","commits":1}]},"filePathRelative":"zh/advanced/cookbook/adding-extra-pages.md"}');export{e as data}; diff --git a/assets/adding-extra-pages.html-wSdXw6mw.js b/assets/adding-extra-pages.html-wSdXw6mw.js new file mode 100644 index 000000000..68e64c36f --- /dev/null +++ b/assets/adding-extra-pages.html-wSdXw6mw.js @@ -0,0 +1,27 @@ +import{_ as e,r as o,o as c,c as D,a as n,b as s,d as l,w as p,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=n("p",null,"有时你可能希望在不创建 Markdown 文件的情况下添加一些额外的页面。",-1),d=r(`

添加默认的主页

作为一个主题作者,你可能不想要求用户必须创建一个 /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)
+    }
+  },
+}
+
`,3);function C(v,u){const a=o("RouterLink");return c(),D("div",null,[i,y,n("p",null,[s("我们可以借助于 "),l(a,{to:"/zh/reference/plugin-api.html"},{default:p(()=>[s("插件 API")]),_:1}),s(" 和 "),l(a,{to:"/zh/reference/node-api.html"},{default:p(()=>[s("Node API")]),_:1}),s(" 来轻松实现。")]),d])}const b=e(t,[["render",C],["__file","adding-extra-pages.html.vue"]]);export{b as default}; diff --git a/assets/app-eU2v8o1B.js b/assets/app-eU2v8o1B.js new file mode 100644 index 000000000..320608a40 --- /dev/null +++ b/assets/app-eU2v8o1B.js @@ -0,0 +1,16 @@ +function _o(e,t){const n=Object.create(null),r=e.split(",");for(let o=0;o!!n[o.toLowerCase()]:o=>!!n[o]}const Le={},on=[],ut=()=>{},Jl=()=>!1,Ql=/^on[^a-z]/,Nn=e=>Ql.test(e),go=e=>e.startsWith("onUpdate:"),Ce=Object.assign,bo=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Zl=Object.prototype.hasOwnProperty,fe=(e,t)=>Zl.call(e,t),Z=Array.isArray,sn=e=>Ar(e)==="[object Map]",ms=e=>Ar(e)==="[object Set]",se=e=>typeof e=="function",pe=e=>typeof e=="string",wr=e=>typeof e=="symbol",we=e=>e!==null&&typeof e=="object",ps=e=>(we(e)||se(e))&&se(e.then)&&se(e.catch),vs=Object.prototype.toString,Ar=e=>vs.call(e),Xl=e=>Ar(e).slice(8,-1),_s=e=>Ar(e)==="[object Object]",Eo=e=>pe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Pn=_o(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Pr=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},ea=/-(\w)/g,dt=Pr(e=>e.replace(ea,(t,n)=>n?n.toUpperCase():"")),ta=/\B([A-Z])/g,Jt=Pr(e=>e.replace(ta,"-$1").toLowerCase()),Rr=Pr(e=>e.charAt(0).toUpperCase()+e.slice(1)),$r=Pr(e=>e?`on${Rr(e)}`:""),Yt=(e,t)=>!Object.is(e,t),Nr=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},na=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ra=e=>{const t=pe(e)?Number(e):NaN;return isNaN(t)?e:t};let ti;const Xr=()=>ti||(ti=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Hn(e){if(Z(e)){const t={};for(let n=0;n{if(n){const r=n.split(ia);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function We(e){let t="";if(pe(e))t=e;else if(Z(e))for(let n=0;npe(e)?e:e==null?"":Z(e)||we(e)&&(e.toString===vs||!se(e.toString))?JSON.stringify(e,bs,2):String(e),bs=(e,t)=>t&&t.__v_isRef?bs(e,t.value):sn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o])=>(n[`${r} =>`]=o,n),{})}:ms(t)?{[`Set(${t.size})`]:[...t.values()]}:we(t)&&!Z(t)&&!_s(t)?String(t):t;let Je;class ua{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Je,!t&&Je&&(this.index=(Je.scopes||(Je.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=Je;try{return Je=this,t()}finally{Je=n}}}on(){Je=this}off(){Je=this.parent}stop(t){if(this._active){let n,r;for(n=0,r=this.effects.length;n{const t=new Set(e);return t.w=0,t.n=0,t},ys=e=>(e.w&Dt)>0,Ts=e=>(e.n&Dt)>0,ha=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r{(u==="length"||!wr(u)&&u>=l)&&a.push(c)})}else switch(n!==void 0&&a.push(s.get(n)),t){case"add":Z(e)?Eo(n)&&a.push(s.get("length")):(a.push(s.get(Kt)),sn(e)&&a.push(s.get(to)));break;case"delete":Z(e)||(a.push(s.get(Kt)),sn(e)&&a.push(s.get(to)));break;case"set":sn(e)&&a.push(s.get(Kt));break}if(a.length===1)a[0]&&no(a[0]);else{const l=[];for(const c of a)c&&l.push(...c);no(yo(l))}}function no(e,t){const n=Z(e)?e:[...e];for(const r of n)r.computed&&ri(r);for(const r of n)r.computed||ri(r)}function ri(e,t){(e!==rt||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}function pa(e,t){var n;return(n=fr.get(e))==null?void 0:n.get(t)}const va=_o("__proto__,__v_isRef,__isVue"),As=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(wr)),oi=_a();function _a(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=me(this);for(let i=0,s=this.length;i{e[t]=function(...n){_n();const r=me(this)[t].apply(this,n);return gn(),r}}),e}function ga(e){const t=me(this);return Ge(t,"has",e),t.hasOwnProperty(e)}class Ps{constructor(t=!1,n=!1){this._isReadonly=t,this._shallow=n}get(t,n,r){const o=this._isReadonly,i=this._shallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw"&&r===(o?i?xa:ks:i?Is:Os).get(t))return t;const s=Z(t);if(!o){if(s&&fe(oi,n))return Reflect.get(oi,n,r);if(n==="hasOwnProperty")return ga}const a=Reflect.get(t,n,r);return(wr(n)?As.has(n):va(n))||(o||Ge(t,"get",n),i)?a:ze(a)?s&&Eo(n)?a:a.value:we(a)?o?Fn(a):Bn(a):a}}class Rs extends Ps{constructor(t=!1){super(!1,t)}set(t,n,r,o){let i=t[n];if(un(i)&&ze(i)&&!ze(r))return!1;if(!this._shallow&&(!hr(r)&&!un(r)&&(i=me(i),r=me(r)),!Z(t)&&ze(i)&&!ze(r)))return i.value=r,!0;const s=Z(t)&&Eo(n)?Number(n)e,Or=e=>Reflect.getPrototypeOf(e);function Yn(e,t,n=!1,r=!1){e=e.__v_raw;const o=me(e),i=me(t);n||(Yt(t,i)&&Ge(o,"get",t),Ge(o,"get",i));const{has:s}=Or(o),a=r?Lo:n?Po:Cn;if(s.call(o,t))return a(e.get(t));if(s.call(o,i))return a(e.get(i));e!==o&&e.get(t)}function Jn(e,t=!1){const n=this.__v_raw,r=me(n),o=me(e);return t||(Yt(e,o)&&Ge(r,"has",e),Ge(r,"has",o)),e===o?n.has(e):n.has(e)||n.has(o)}function Qn(e,t=!1){return e=e.__v_raw,!t&&Ge(me(e),"iterate",Kt),Reflect.get(e,"size",e)}function ii(e){e=me(e);const t=me(this);return Or(t).has.call(t,e)||(t.add(e),vt(t,"add",e,e)),this}function si(e,t){t=me(t);const n=me(this),{has:r,get:o}=Or(n);let i=r.call(n,e);i||(e=me(e),i=r.call(n,e));const s=o.call(n,e);return n.set(e,t),i?Yt(t,s)&&vt(n,"set",e,t):vt(n,"add",e,t),this}function li(e){const t=me(this),{has:n,get:r}=Or(t);let o=n.call(t,e);o||(e=me(e),o=n.call(t,e)),r&&r.call(t,e);const i=t.delete(e);return o&&vt(t,"delete",e,void 0),i}function ai(){const e=me(this),t=e.size!==0,n=e.clear();return t&&vt(e,"clear",void 0,void 0),n}function Zn(e,t){return function(r,o){const i=this,s=i.__v_raw,a=me(s),l=t?Lo:e?Po:Cn;return!e&&Ge(a,"iterate",Kt),s.forEach((c,u)=>r.call(o,l(c),l(u),i))}}function Xn(e,t,n){return function(...r){const o=this.__v_raw,i=me(o),s=sn(i),a=e==="entries"||e===Symbol.iterator&&s,l=e==="keys"&&s,c=o[e](...r),u=n?Lo:t?Po:Cn;return!t&&Ge(i,"iterate",l?to:Kt),{next(){const{value:d,done:h}=c.next();return h?{value:d,done:h}:{value:a?[u(d[0]),u(d[1])]:u(d),done:h}},[Symbol.iterator](){return this}}}}function wt(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function La(){const e={get(i){return Yn(this,i)},get size(){return Qn(this)},has:Jn,add:ii,set:si,delete:li,clear:ai,forEach:Zn(!1,!1)},t={get(i){return Yn(this,i,!1,!0)},get size(){return Qn(this)},has:Jn,add:ii,set:si,delete:li,clear:ai,forEach:Zn(!1,!0)},n={get(i){return Yn(this,i,!0)},get size(){return Qn(this,!0)},has(i){return Jn.call(this,i,!0)},add:wt("add"),set:wt("set"),delete:wt("delete"),clear:wt("clear"),forEach:Zn(!0,!1)},r={get(i){return Yn(this,i,!0,!0)},get size(){return Qn(this,!0)},has(i){return Jn.call(this,i,!0)},add:wt("add"),set:wt("set"),delete:wt("delete"),clear:wt("clear"),forEach:Zn(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Xn(i,!1,!1),n[i]=Xn(i,!0,!1),t[i]=Xn(i,!1,!0),r[i]=Xn(i,!0,!0)}),[e,n,t,r]}const[wa,Aa,Pa,Ra]=La();function wo(e,t){const n=t?e?Ra:Pa:e?Aa:wa;return(r,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(fe(n,o)&&o in r?n:r,o,i)}const Oa={get:wo(!1,!1)},Ia={get:wo(!1,!0)},ka={get:wo(!0,!1)},Os=new WeakMap,Is=new WeakMap,ks=new WeakMap,xa=new WeakMap;function Ca(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Da(e){return e.__v_skip||!Object.isExtensible(e)?0:Ca(Xl(e))}function Bn(e){return un(e)?e:Ao(e,!1,Ea,Oa,Os)}function xs(e){return Ao(e,!1,Ta,Ia,Is)}function Fn(e){return Ao(e,!0,ya,ka,ks)}function Ao(e,t,n,r,o){if(!we(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=o.get(e);if(i)return i;const s=Da(e);if(s===0)return e;const a=new Proxy(e,s===2?r:n);return o.set(e,a),a}function ln(e){return un(e)?ln(e.__v_raw):!!(e&&e.__v_isReactive)}function un(e){return!!(e&&e.__v_isReadonly)}function hr(e){return!!(e&&e.__v_isShallow)}function Cs(e){return ln(e)||un(e)}function me(e){const t=e&&e.__v_raw;return t?me(t):e}function Ds(e){return dr(e,"__v_skip",!0),e}const Cn=e=>we(e)?Bn(e):e,Po=e=>we(e)?Fn(e):e;function Ro(e){xt&&rt&&(e=me(e),ws(e.dep||(e.dep=yo())))}function Oo(e,t){e=me(e);const n=e.dep;n&&no(n)}function ze(e){return!!(e&&e.__v_isRef===!0)}function Te(e){return Ss(e,!1)}function Io(e){return Ss(e,!0)}function Ss(e,t){return ze(e)?e:new Sa(e,t)}class Sa{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:me(t),this._value=n?t:Cn(t)}get value(){return Ro(this),this._value}set value(t){const n=this.__v_isShallow||hr(t)||un(t);t=n?t:me(t),Yt(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:Cn(t),Oo(this))}}function ne(e){return ze(e)?e.value:e}const za={get:(e,t,n)=>ne(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return ze(o)&&!ze(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function zs(e){return ln(e)?e:new Proxy(e,za)}class Va{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:n,set:r}=t(()=>Ro(this),()=>Oo(this));this._get=n,this._set=r}get value(){return this._get()}set value(t){this._set(t)}}function Ma(e){return new Va(e)}function ko(e){const t=Z(e)?new Array(e.length):{};for(const n in e)t[n]=Na(e,n);return t}class $a{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return pa(me(this._object),this._key)}}function Na(e,t,n){const r=e[t];return ze(r)?r:new $a(e,t,n)}class Ha{constructor(t,n,r,o){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new To(t,()=>{this._dirty||(this._dirty=!0,Oo(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=r}get value(){const t=me(this);return Ro(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function Ba(e,t,n=!1){let r,o;const i=se(e);return i?(r=e,o=ut):(r=e.get,o=e.set),new Ha(r,o,i||!o,n)}function Ct(e,t,n,r){let o;try{o=r?e(...r):e()}catch(i){jn(i,t,n)}return o}function et(e,t,n,r){if(se(e)){const i=Ct(e,t,n,r);return i&&ps(i)&&i.catch(s=>{jn(s,t,n)}),i}const o=[];for(let i=0;i>>1,o=He[r],i=Sn(o);ict&&He.splice(t,1)}function Ka(e){Z(e)?an.push(...e):(!pt||!pt.includes(e,e.allowRecurse?Bt+1:Bt))&&an.push(e),Ms()}function ci(e,t=Dn?ct+1:0){for(;tSn(n)-Sn(r)),Bt=0;Bte.id==null?1/0:e.id,Wa=(e,t)=>{const n=Sn(e)-Sn(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function $s(e){ro=!1,Dn=!0,He.sort(Wa);try{for(ct=0;ctpe(v)?v.trim():v)),d&&(o=n.map(na))}let a,l=r[a=$r(t)]||r[a=$r(dt(t))];!l&&i&&(l=r[a=$r(Jt(t))]),l&&et(l,e,6,o);const c=r[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,et(c,e,6,o)}}function Ns(e,t,n=!1){const r=t.emitsCache,o=r.get(e);if(o!==void 0)return o;const i=e.emits;let s={},a=!1;if(!se(e)){const l=c=>{const u=Ns(c,t,!0);u&&(a=!0,Ce(s,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!i&&!a?(we(e)&&r.set(e,null),null):(Z(i)?i.forEach(l=>s[l]=null):Ce(s,i),we(e)&&r.set(e,s),s)}function kr(e,t){return!e||!Nn(t)?!1:(t=t.slice(2).replace(/Once$/,""),fe(e,t[0].toLowerCase()+t.slice(1))||fe(e,Jt(t))||fe(e,t))}let $e=null,Hs=null;function pr(e){const t=$e;return $e=e,Hs=e&&e.type.__scopeId||null,t}function Me(e,t=$e,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&yi(-1);const i=pr(t);let s;try{s=e(...o)}finally{pr(i),r._d&&yi(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function Hr(e){const{type:t,vnode:n,proxy:r,withProxy:o,props:i,propsOptions:[s],slots:a,attrs:l,emit:c,render:u,renderCache:d,data:h,setupState:v,ctx:E,inheritAttrs:w}=e;let R,I;const k=pr(e);try{if(n.shapeFlag&4){const y=o||r,B=y;R=nt(u.call(B,y,d,i,v,h,E)),I=l}else{const y=t;R=nt(y.length>1?y(i,{attrs:l,slots:a,emit:c}):y(i,null)),I=t.props?l:Ga(l)}}catch(y){In.length=0,jn(y,e,1),R=oe(Qe)}let b=R;if(I&&w!==!1){const y=Object.keys(I),{shapeFlag:B}=b;y.length&&B&7&&(s&&y.some(go)&&(I=Ya(I,s)),b=zt(b,I))}return n.dirs&&(b=zt(b),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&(b.transition=n.transition),R=b,pr(k),R}const Ga=e=>{let t;for(const n in e)(n==="class"||n==="style"||Nn(n))&&((t||(t={}))[n]=e[n]);return t},Ya=(e,t)=>{const n={};for(const r in e)(!go(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Ja(e,t,n){const{props:r,children:o,component:i}=e,{props:s,children:a,patchFlag:l}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?ui(r,s,c):!!s;if(l&8){const u=t.dynamicProps;for(let d=0;de.__isSuspense;function Fs(e,t){t&&t.pendingBranch?Z(e)?t.effects.push(...e):t.effects.push(e):Ka(e)}function js(e,t){return Co(e,null,t)}const er={};function qe(e,t,n){return Co(e,t,n)}function Co(e,t,{immediate:n,deep:r,flush:o,onTrack:i,onTrigger:s}=Le){var a;const l=Es()===((a=ke)==null?void 0:a.scope)?ke:null;let c,u=!1,d=!1;if(ze(e)?(c=()=>e.value,u=hr(e)):ln(e)?(c=()=>e,r=!0):Z(e)?(d=!0,u=e.some(y=>ln(y)||hr(y)),c=()=>e.map(y=>{if(ze(y))return y.value;if(ln(y))return Ut(y);if(se(y))return Ct(y,l,2)})):se(e)?t?c=()=>Ct(e,l,2):c=()=>{if(!(l&&l.isUnmounted))return h&&h(),et(e,l,3,[v])}:c=ut,t&&r){const y=c;c=()=>Ut(y())}let h,v=y=>{h=k.onStop=()=>{Ct(y,l,4),h=k.onStop=void 0}},E;if(hn)if(v=ut,t?n&&et(t,l,3,[c(),d?[]:void 0,v]):c(),o==="sync"){const y=qc();E=y.__watcherHandles||(y.__watcherHandles=[])}else return ut;let w=d?new Array(e.length).fill(er):er;const R=()=>{if(k.active)if(t){const y=k.run();(r||u||(d?y.some((B,J)=>Yt(B,w[J])):Yt(y,w)))&&(h&&h(),et(t,l,3,[y,w===er?void 0:d&&w[0]===er?[]:w,v]),w=y)}else k.run()};R.allowRecurse=!!t;let I;o==="sync"?I=R:o==="post"?I=()=>Ke(R,l&&l.suspense):(R.pre=!0,l&&(R.id=l.uid),I=()=>Ir(R));const k=new To(c,I);t?n?R():w=k.run():o==="post"?Ke(k.run.bind(k),l&&l.suspense):k.run();const b=()=>{k.stop(),l&&l.scope&&bo(l.scope.effects,k)};return E&&E.push(b),b}function tc(e,t,n){const r=this.proxy,o=pe(e)?e.includes(".")?Us(r,e):()=>r[e]:e.bind(r,r);let i;se(t)?i=t:(i=t.handler,n=t);const s=ke;fn(this);const a=Co(o,i.bind(r),n);return s?fn(s):qt(),a}function Us(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o{Ut(n,t)});else if(_s(e))for(const n in e)Ut(e[n],t);return e}function vr(e,t){const n=$e;if(n===null)return e;const r=zr(n)||n.proxy,o=e.dirs||(e.dirs=[]);for(let i=0;i{e.isMounted=!0}),Cr(()=>{e.isUnmounting=!0}),e}const Ze=[Function,Array],Ks={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ze,onEnter:Ze,onAfterEnter:Ze,onEnterCancelled:Ze,onBeforeLeave:Ze,onLeave:Ze,onAfterLeave:Ze,onLeaveCancelled:Ze,onBeforeAppear:Ze,onAppear:Ze,onAfterAppear:Ze,onAppearCancelled:Ze},rc={name:"BaseTransition",props:Ks,setup(e,{slots:t}){const n=Vo(),r=nc();let o;return()=>{const i=t.default&&qs(t.default(),!0);if(!i||!i.length)return;let s=i[0];if(i.length>1){for(const w of i)if(w.type!==Qe){s=w;break}}const a=me(e),{mode:l}=a;if(r.isLeaving)return Br(s);const c=fi(s);if(!c)return Br(s);const u=oo(c,a,r,n);io(c,u);const d=n.subTree,h=d&&fi(d);let v=!1;const{getTransitionKey:E}=c.type;if(E){const w=E();o===void 0?o=w:w!==o&&(o=w,v=!0)}if(h&&h.type!==Qe&&(!Ft(c,h)||v)){const w=oo(h,a,r,n);if(io(h,w),l==="out-in")return r.isLeaving=!0,w.afterLeave=()=>{r.isLeaving=!1,n.update.active!==!1&&n.update()},Br(s);l==="in-out"&&c.type!==Qe&&(w.delayLeave=(R,I,k)=>{const b=Ws(r,h);b[String(h.key)]=h,R[Ot]=()=>{I(),R[Ot]=void 0,delete u.delayedLeave},u.delayedLeave=k})}return s}}},oc=rc;function Ws(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function oo(e,t,n,r){const{appear:o,mode:i,persisted:s=!1,onBeforeEnter:a,onEnter:l,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:h,onAfterLeave:v,onLeaveCancelled:E,onBeforeAppear:w,onAppear:R,onAfterAppear:I,onAppearCancelled:k}=t,b=String(e.key),y=Ws(n,e),B=(g,z)=>{g&&et(g,r,9,z)},J=(g,z)=>{const C=z[1];B(g,z),Z(g)?g.every(q=>q.length<=1)&&C():g.length<=1&&C()},$={mode:i,persisted:s,beforeEnter(g){let z=a;if(!n.isMounted)if(o)z=w||a;else return;g[Ot]&&g[Ot](!0);const C=y[b];C&&Ft(e,C)&&C.el[Ot]&&C.el[Ot](),B(z,[g])},enter(g){let z=l,C=c,q=u;if(!n.isMounted)if(o)z=R||l,C=I||c,q=k||u;else return;let L=!1;const M=g[tr]=re=>{L||(L=!0,re?B(q,[g]):B(C,[g]),$.delayedLeave&&$.delayedLeave(),g[tr]=void 0)};z?J(z,[g,M]):M()},leave(g,z){const C=String(e.key);if(g[tr]&&g[tr](!0),n.isUnmounting)return z();B(d,[g]);let q=!1;const L=g[Ot]=M=>{q||(q=!0,z(),M?B(E,[g]):B(v,[g]),g[Ot]=void 0,y[C]===e&&delete y[C])};y[C]=e,h?J(h,[g,L]):L()},clone(g){return oo(g,t,n,r)}};return $}function Br(e){if(Kn(e))return e=zt(e),e.children=null,e}function fi(e){return Kn(e)?e.children?e.children[0]:void 0:e}function io(e,t){e.shapeFlag&6&&e.component?io(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function qs(e,t=!1,n){let r=[],o=0;for(let i=0;i1)for(let i=0;i!!e.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function A(e){se(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,timeout:i,suspensible:s=!0,onError:a}=e;let l=null,c,u=0;const d=()=>(u++,l=null,h()),h=()=>{let v;return l||(v=l=t().catch(E=>{if(E=E instanceof Error?E:new Error(String(E)),a)return new Promise((w,R)=>{a(E,()=>w(d()),()=>R(E),u+1)});throw E}).then(E=>v!==l&&l?l:(E&&(E.__esModule||E[Symbol.toStringTag]==="Module")&&(E=E.default),c=E,E)))};return ue({name:"AsyncComponentWrapper",__asyncLoader:h,get __asyncResolved(){return c},setup(){const v=ke;if(c)return()=>Fr(c,v);const E=k=>{l=null,jn(k,v,13,!r)};if(s&&v.suspense||hn)return h().then(k=>()=>Fr(k,v)).catch(k=>(E(k),()=>r?oe(r,{error:k}):null));const w=Te(!1),R=Te(),I=Te(!!o);return o&&setTimeout(()=>{I.value=!1},o),i!=null&&setTimeout(()=>{if(!w.value&&!R.value){const k=new Error(`Async component timed out after ${i}ms.`);E(k),R.value=k}},i),h().then(()=>{w.value=!0,v.parent&&Kn(v.parent.vnode)&&Ir(v.parent.update)}).catch(k=>{E(k),R.value=k}),()=>{if(w.value&&c)return Fr(c,v);if(R.value&&r)return oe(r,{error:R.value});if(n&&!I.value)return oe(n)}}})}function Fr(e,t){const{ref:n,props:r,children:o,ce:i}=t.vnode,s=oe(e,r,o);return s.ref=n,s.ce=i,delete t.vnode.ce,s}const Kn=e=>e.type.__isKeepAlive;function ic(e,t){Gs(e,"a",t)}function sc(e,t){Gs(e,"da",t)}function Gs(e,t,n=ke){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(xr(t,r,n),n){let o=n.parent;for(;o&&o.parent;)Kn(o.parent.vnode)&&lc(r,t,n,o),o=o.parent}}function lc(e,t,n,r){const o=xr(t,e,r,!0);Dr(()=>{bo(r[t],o)},n)}function xr(e,t,n=ke,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{if(n.isUnmounted)return;_n(),fn(n);const a=et(t,n,e,s);return qt(),gn(),a});return r?o.unshift(i):o.push(i),i}}const Et=e=>(t,n=ke)=>(!hn||e==="sp")&&xr(e,(...r)=>t(...r),n),ac=Et("bm"),je=Et("m"),cc=Et("bu"),uc=Et("u"),Cr=Et("bum"),Dr=Et("um"),dc=Et("sp"),fc=Et("rtg"),hc=Et("rtc");function mc(e,t=ke){xr("ec",e,t)}function St(e,t,n,r){let o;const i=n&&n[r];if(Z(e)||pe(e)){o=new Array(e.length);for(let s=0,a=e.length;st(s,a,void 0,i&&i[a]));else{const s=Object.keys(e);o=new Array(s.length);for(let a=0,l=s.length;aEr(t)?!(t.type===Qe||t.type===ye&&!Ys(t.children)):!0)?e:null}const so=e=>e?ll(e)?zr(e)||e.proxy:so(e.parent):null,Rn=Ce(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>so(e.parent),$root:e=>so(e.root),$emit:e=>e.emit,$options:e=>Do(e),$forceUpdate:e=>e.f||(e.f=()=>Ir(e.update)),$nextTick:e=>e.n||(e.n=Un.bind(e.proxy)),$watch:e=>tc.bind(e)}),jr=(e,t)=>e!==Le&&!e.__isScriptSetup&&fe(e,t),pc={get({_:e},t){const{ctx:n,setupState:r,data:o,props:i,accessCache:s,type:a,appContext:l}=e;let c;if(t[0]!=="$"){const v=s[t];if(v!==void 0)switch(v){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(jr(r,t))return s[t]=1,r[t];if(o!==Le&&fe(o,t))return s[t]=2,o[t];if((c=e.propsOptions[0])&&fe(c,t))return s[t]=3,i[t];if(n!==Le&&fe(n,t))return s[t]=4,n[t];lo&&(s[t]=0)}}const u=Rn[t];let d,h;if(u)return t==="$attrs"&&Ge(e,"get",t),u(e);if((d=a.__cssModules)&&(d=d[t]))return d;if(n!==Le&&fe(n,t))return s[t]=4,n[t];if(h=l.config.globalProperties,fe(h,t))return h[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:i}=e;return jr(o,t)?(o[t]=n,!0):r!==Le&&fe(r,t)?(r[t]=n,!0):fe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,propsOptions:i}},s){let a;return!!n[s]||e!==Le&&fe(e,s)||jr(t,s)||(a=i[0])&&fe(a,s)||fe(r,s)||fe(Rn,s)||fe(o.config.globalProperties,s)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:fe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function hi(e){return Z(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let lo=!0;function vc(e){const t=Do(e),n=e.proxy,r=e.ctx;lo=!1,t.beforeCreate&&mi(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:s,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:v,updated:E,activated:w,deactivated:R,beforeDestroy:I,beforeUnmount:k,destroyed:b,unmounted:y,render:B,renderTracked:J,renderTriggered:$,errorCaptured:g,serverPrefetch:z,expose:C,inheritAttrs:q,components:L,directives:M,filters:re}=t;if(c&&_c(c,r,null),s)for(const Q in s){const K=s[Q];se(K)&&(r[Q]=K.bind(n))}if(o){const Q=o.call(n,n);we(Q)&&(e.data=Bn(Q))}if(lo=!0,i)for(const Q in i){const K=i[Q],De=se(K)?K.bind(n,n):se(K.get)?K.get.bind(n,n):ut,Ve=!se(K)&&se(K.set)?K.set.bind(n):ut,Ue=W({get:De,set:Ve});Object.defineProperty(r,Q,{enumerable:!0,configurable:!0,get:()=>Ue.value,set:Ne=>Ue.value=Ne})}if(a)for(const Q in a)Js(a[Q],r,n,Q);if(l){const Q=se(l)?l.call(n):l;Reflect.ownKeys(Q).forEach(K=>{Wt(K,Q[K])})}u&&mi(u,e,"c");function S(Q,K){Z(K)?K.forEach(De=>Q(De.bind(n))):K&&Q(K.bind(n))}if(S(ac,d),S(je,h),S(cc,v),S(uc,E),S(ic,w),S(sc,R),S(mc,g),S(hc,J),S(fc,$),S(Cr,k),S(Dr,y),S(dc,z),Z(C))if(C.length){const Q=e.exposed||(e.exposed={});C.forEach(K=>{Object.defineProperty(Q,K,{get:()=>n[K],set:De=>n[K]=De})})}else e.exposed||(e.exposed={});B&&e.render===ut&&(e.render=B),q!=null&&(e.inheritAttrs=q),L&&(e.components=L),M&&(e.directives=M)}function _c(e,t,n=ut){Z(e)&&(e=ao(e));for(const r in e){const o=e[r];let i;we(o)?"default"in o?i=Pe(o.from||r,o.default,!0):i=Pe(o.from||r):i=Pe(o),ze(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:s=>i.value=s}):t[r]=i}}function mi(e,t,n){et(Z(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Js(e,t,n,r){const o=r.includes(".")?Us(n,r):()=>n[r];if(pe(e)){const i=t[e];se(i)&&qe(o,i)}else if(se(e))qe(o,e.bind(n));else if(we(e))if(Z(e))e.forEach(i=>Js(i,t,n,r));else{const i=se(e.handler)?e.handler.bind(n):t[e.handler];se(i)&&qe(o,i,e)}}function Do(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:s}}=e.appContext,a=i.get(t);let l;return a?l=a:!o.length&&!n&&!r?l=t:(l={},o.length&&o.forEach(c=>_r(l,c,s,!0)),_r(l,t,s)),we(t)&&i.set(t,l),l}function _r(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&_r(e,i,n,!0),o&&o.forEach(s=>_r(e,s,n,!0));for(const s in t)if(!(r&&s==="expose")){const a=gc[s]||n&&n[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const gc={data:pi,props:vi,emits:vi,methods:An,computed:An,beforeCreate:Be,created:Be,beforeMount:Be,mounted:Be,beforeUpdate:Be,updated:Be,beforeDestroy:Be,beforeUnmount:Be,destroyed:Be,unmounted:Be,activated:Be,deactivated:Be,errorCaptured:Be,serverPrefetch:Be,components:An,directives:An,watch:Ec,provide:pi,inject:bc};function pi(e,t){return t?e?function(){return Ce(se(e)?e.call(this,this):e,se(t)?t.call(this,this):t)}:t:e}function bc(e,t){return An(ao(e),ao(t))}function ao(e){if(Z(e)){const t={};for(let n=0;n1)return n&&se(t)?t.call(r&&r.proxy):t}}function Lc(e,t,n,r=!1){const o={},i={};dr(i,Sr,1),e.propsDefaults=Object.create(null),Zs(e,t,o,i);for(const s in e.propsOptions[0])s in o||(o[s]=void 0);n?e.props=r?o:xs(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function wc(e,t,n,r){const{props:o,attrs:i,vnode:{patchFlag:s}}=e,a=me(o),[l]=e.propsOptions;let c=!1;if((r||s>0)&&!(s&16)){if(s&8){const u=e.vnode.dynamicProps;for(let d=0;d{l=!0;const[h,v]=Xs(d,t,!0);Ce(s,h),v&&a.push(...v)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!l)return we(e)&&r.set(e,on),on;if(Z(i))for(let u=0;u-1,v[1]=w<0||E-1||fe(v,"default"))&&a.push(d)}}}const c=[s,a];return we(e)&&r.set(e,c),c}function _i(e){return e[0]!=="$"}function gi(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function bi(e,t){return gi(e)===gi(t)}function Ei(e,t){return Z(t)?t.findIndex(n=>bi(n,e)):se(t)&&bi(t,e)?0:-1}const el=e=>e[0]==="_"||e==="$stable",So=e=>Z(e)?e.map(nt):[nt(e)],Ac=(e,t,n)=>{if(t._n)return t;const r=Me((...o)=>So(t(...o)),n);return r._c=!1,r},tl=(e,t,n)=>{const r=e._ctx;for(const o in e){if(el(o))continue;const i=e[o];if(se(i))t[o]=Ac(o,i,r);else if(i!=null){const s=So(i);t[o]=()=>s}}},nl=(e,t)=>{const n=So(t);e.slots.default=()=>n},Pc=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=me(t),dr(t,"_",n)):tl(t,e.slots={})}else e.slots={},t&&nl(e,t);dr(e.slots,Sr,1)},Rc=(e,t,n)=>{const{vnode:r,slots:o}=e;let i=!0,s=Le;if(r.shapeFlag&32){const a=t._;a?n&&a===1?i=!1:(Ce(o,t),!n&&a===1&&delete o._):(i=!t.$stable,tl(t,o)),s=t}else t&&(nl(e,t),s={default:1});if(i)for(const a in o)!el(a)&&s[a]==null&&delete o[a]};function br(e,t,n,r,o=!1){if(Z(e)){e.forEach((h,v)=>br(h,t&&(Z(t)?t[v]:t),n,r,o));return}if(cn(r)&&!o)return;const i=r.shapeFlag&4?zr(r.component)||r.component.proxy:r.el,s=o?null:i,{i:a,r:l}=e,c=t&&t.r,u=a.refs===Le?a.refs={}:a.refs,d=a.setupState;if(c!=null&&c!==l&&(pe(c)?(u[c]=null,fe(d,c)&&(d[c]=null)):ze(c)&&(c.value=null)),se(l))Ct(l,a,12,[s,u]);else{const h=pe(l),v=ze(l);if(h||v){const E=()=>{if(e.f){const w=h?fe(d,l)?d[l]:u[l]:l.value;o?Z(w)&&bo(w,i):Z(w)?w.includes(i)||w.push(i):h?(u[l]=[i],fe(d,l)&&(d[l]=u[l])):(l.value=[i],e.k&&(u[e.k]=l.value))}else h?(u[l]=s,fe(d,l)&&(d[l]=s)):v&&(l.value=s,e.k&&(u[e.k]=s))};s?(E.id=-1,Ke(E,n)):E()}}}let At=!1;const nr=e=>/svg/.test(e.namespaceURI)&&e.tagName!=="foreignObject",rr=e=>e.nodeType===8;function Oc(e){const{mt:t,p:n,o:{patchProp:r,createText:o,nextSibling:i,parentNode:s,remove:a,insert:l,createComment:c}}=e,u=(b,y)=>{if(!y.hasChildNodes()){n(null,b,y),mr(),y._vnode=b;return}At=!1,d(y.firstChild,b,null,null,null),mr(),y._vnode=b,At&&console.error("Hydration completed but contains mismatches.")},d=(b,y,B,J,$,g=!1)=>{const z=rr(b)&&b.data==="[",C=()=>w(b,y,B,J,$,z),{type:q,ref:L,shapeFlag:M,patchFlag:re}=y;let le=b.nodeType;y.el=b,re===-2&&(g=!1,y.dynamicChildren=null);let S=null;switch(q){case dn:le!==3?y.children===""?(l(y.el=o(""),s(b),b),S=b):S=C():(b.data!==y.children&&(At=!0,b.data=y.children),S=i(b));break;case Qe:k(b)?(S=i(b),I(y.el=b.content.firstChild,b,B)):le!==8||z?S=C():S=i(b);break;case On:if(z&&(b=i(b),le=b.nodeType),le===1||le===3){S=b;const Q=!y.children.length;for(let K=0;K{g=g||!!y.dynamicChildren;const{type:z,props:C,patchFlag:q,shapeFlag:L,dirs:M,transition:re}=y,le=z==="input"||z==="option";if(le||q!==-1){if(M&&at(y,null,B,"created"),C)if(le||!g||q&48)for(const K in C)(le&&(K.endsWith("value")||K==="indeterminate")||Nn(K)&&!Pn(K)||K[0]===".")&&r(b,K,null,C[K],!1,void 0,B);else C.onClick&&r(b,"onClick",null,C.onClick,!1,void 0,B);let S;(S=C&&C.onVnodeBeforeMount)&&Xe(S,B,y);let Q=!1;if(k(b)){Q=rl(J,re)&&B&&B.vnode.props&&B.vnode.props.appear;const K=b.content.firstChild;Q&&re.beforeEnter(K),I(K,b,B),y.el=b=K}if(M&&at(y,null,B,"beforeMount"),((S=C&&C.onVnodeMounted)||M||Q)&&Fs(()=>{S&&Xe(S,B,y),Q&&re.enter(b),M&&at(y,null,B,"mounted")},J),L&16&&!(C&&(C.innerHTML||C.textContent))){let K=v(b.firstChild,y,b,B,J,$,g);for(;K;){At=!0;const De=K;K=K.nextSibling,a(De)}}else L&8&&b.textContent!==y.children&&(At=!0,b.textContent=y.children)}return b.nextSibling},v=(b,y,B,J,$,g,z)=>{z=z||!!y.dynamicChildren;const C=y.children,q=C.length;for(let L=0;L{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;eeX?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=ieee)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;GV.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;Ff.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;nke||$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}`: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.lengthki(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;oWr||(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;s1&&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;dt.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(;n0&&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;oi&&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;t1&&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;re0?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)=>en?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();ls+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-architecture-overview

上图展示了 VuePress 的简要架构:

  • Node App 会生成临时文件,包括页面、路由等。
  • Bundler 会将 Client App 和临时文件一起进行打包,就像处理一个普通的 Vue SPA 一样。

作为开发者,你必须要意识到 VuePress 分为两个主要部分: Node AppClient App ,这一点对于开发插件和主题来说都十分重要。

  • 插件或者主题的入口文件会在 Node App 中被加载。
  • 客户端文件会在 Client App 中被加载,也就是会被 Bundler 处理。比如组件、客户端配置文件等。

核心流程与 Hooks

vuepress-core-process

',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

vuepress-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

vuepress-core-process

',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

VuePress Logo

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 前缀:

<!-- 你不需要给 `/images/hero.png` 手动添加 `/bar/` 前缀 -->\n\n![VuePress Logo](/images/hero.png)\n
',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(`
<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'),
+  },
+}
+
<img src="@alias/image.png" alt="来自路径别名的图片">
+
`,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(`

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

VuePress Logo

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:

<!-- you don't need to prepend `/bar/` to `/images/hero.png` manually -->\n\n![VuePress Logo](/images/hero.png)\n
',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(`
<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">
+
`,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(`

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:

:root {
+  --back-to-top-z-index: 5;
+
+  --back-to-top-color: #3eaf7c;
+  --back-to-top-color-hover: #71cda3;
+}
+
`,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(`

该插件会给你的站点添加一个 返回顶部 按钮。当页面向下滚动时,该按钮会显示在页面的右下角,点击它就会滚动到页面顶部。

该插件已经集成到默认主题中。

使用方法

npm i -D @vuepress/plugin-back-to-top@next
+
import { backToTopPlugin } from '@vuepress/plugin-back-to-top'
+
+export default {
+  plugins: [backToTopPlugin()],
+}
+

样式

你可以通过 CSS 变量来自定义 返回顶部 按钮的样式:

:root {
+  --back-to-top-z-index: 5;
+
+  --back-to-top-color: #3eaf7c;
+  --back-to-top-color-hover: #71cda3;
+}
+
`,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(`
import { viteBundler } from 'vuepress'
+// import { webpackBundler } from 'vuepress-webpack'
+
+export default {
+  bundler: viteBundler({
+    vuePluginOptions: {
+      template: {
+        compilerOptions: {
+          isCustomElement: (tag) => tag === 'center',
+        },
+      },
+    },
+  }),
+}
+
`,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(`

Run vuepress --help to get following help messages:

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
+
`,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(`

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 来获取下列帮助信息:

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
+
`,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(`

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 your tsconfig.json:

{
+  "compilerOptions": {
+    "types": ["@vuepress/client/types"]
+  }
+}
+

__VUEPRESS_VERSION__

  • Type: string

  • Details:

    Version of VuePress core package.

__VUEPRESS_BASE__

`,7),B=e("li",null,[e("p",null,[s("Type: "),e("code",null,"string")])],-1),L=e("p",null,"Details:",-1),N=t('

__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}\`
+  },
+})
+

DANGER

resolvers will affect the basic functionality of VuePress. Please make sure you have fully understood its purpose before modifying it.

`,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('

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 的版本号。

__VUEPRESS_BASE__

`,7),w=e("li",null,[e("p",null,[s("类型: "),e("code",null,"string")])],-1),I=e("p",null,"详情:",-1),N=o('

__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}\`
+  },
+})
+

警告

resolvers 会直接影响 VuePress 的基础功能,在修改前请确保你已充分了解其用途。

`,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(`

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() or onMounted() hook.
    • Wrap the component with <ClientOnly>.

Content

  • Props:

    • pageKey
      • Type: string
      • Required: false
  • Usage:

<Content page-key="v-xxxxxx" />
+
`,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(`
  • 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

  • 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
  • 使用:

<Content page-key="v-xxxxxx" />
+
`,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(`
  • 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

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

home

  • 类型: string

  • 默认值: /

  • 详情:

    首页的路径。

    它将被用于:

    • 导航栏中 Logo 的链接
    • 404 页面的 返回首页 链接
  • 类型: 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/',
+          },
+        ],
+      },
+    ],
+  }),
+}
+
  • 类型: null | string

  • 详情:

    Logo 图片的 URL。

    Logo 图片将会显示在导航栏的左端。

    设置为 null 可以禁用 Logo 。

  • 示例:

export default {
+  theme: defaultTheme({
+    // Public 文件路径
+    logo: '/images/hero.png',
+    // URL
+    logo: 'https://vuejs.org/images/logo.png',
+  }),
+}
+
`,12),N=o(`

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: '简体中文',
+      },
+    },
+  }),
+}
+
`,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

如果你想在不同子路径中使用不同的侧边栏,你可以将该配置项设置为 侧边栏对象

  • Key 为路径前缀。
  • Value 为 侧边栏数组
",6),H=s("li",null,[s("p",null,"示例 1:")],-1),W=o(`
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("

详情:

设置根据页面标题自动生成的侧边栏的最大深度。

  • 设为 0 来禁用所有级别的页面标题。
  • 设为 1 来包含 <h2> 标题。
  • 设为 2 来包含 <h2><h3> 标题。
  • ...
",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(`

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

  • 详情:

    设置默认主题使用的插件。

    默认主题使用了一些插件,如果你确实不需要该插件,你可以选择禁用它。在禁用插件之前,请确保你已了解它的用途。

',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 类型为:

  • tip
  • warning
  • danger
  • details
  • codeGroup
  • codeGroupItem
",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('
  • Type: string

  • Default: /

  • 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 set base 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 / .

  • ',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("
  • Type: string

  • Default: en-US

  • 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.

  • ",3),y=e("p",null,"Also see:",-1),k=e("li",null,[e("a",{href:"#locales"},"Config > locales")],-1),w=a('

    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: ''

  • 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 the description field of page frontmatter.

    This can be specified in different locales.

  • ",3),x=e("p",null,"Also see:",-1),C=e("li",null,[e("a",{href:"#locales"},"Config > locales")],-1),T=a(`
    • 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:

    <head>
    +  <link rel="icon" href="/images/logo.png" />
    +</head>
    +
    `,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('
  • Type: { [path: string]: Partial<SiteLocaleData> }

  • Default: {}

  • Details:

    Specify locales for i18n support.

    Acceptable fields:

  • ',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("
  • Type: Bundler

  • Details:

    Set the bundler of your site.

    If this option is not set, the default bundler will be used:

    • With vuepress or vuepress-vite, the default bundler is vite.
    • With vuepress-webpack, the default bundler is webpack.
  • ",2),R=e("p",null,"Also see:",-1),q=a('

    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

  • Details:

    Specify the pattern to generate permalink.

    This will be overrode by the permalinkPattern field of page frontmatter.

  • ",3),ee=e("p",null,"Also see:",-1),le=a('

    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 to true or false 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 to true or false 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:

    const defaultOptions = {
    +  level: [1, 2, 3, 4, 5, 6],
    +  permalink: anchorPlugin.permalink.ariaHidden({
    +    class: 'header-anchor',
    +    symbol: '#',
    +    space: true,
    +    placement: 'before',
    +  }),
    +}
    +
    `,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('

    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

  • 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 to 4, line numbers will only be enabled when your code block has at least 4 lines of code.
  • ",3),Ce=e("p",null,"Also see:",-1),Te=a('

    markdown.code.preWrapper

    • Type: boolean

    • Default: true

    • Details:

      Enable the extra wrapper of the <pre> tag or not.

      The wrapper is required by the highlightLines and lineNumbers. That means, if you disable preWrapper, the line highlighting and line numbers will also be disabled.

    ',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:

    Add v-pre directive to <pre> tag of code block or not.

  • ",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("
  • Type: boolean

  • Default: true

  • Details:

    Add v-pre directive to <code> tag of inline code or not.

  • ",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(`

    DANGER

    You should not configure it unless you understand what it is for.

    markdown.headers

    • Type: HeadersPluginOptions | false

    • Default:

    const defaultOptions = {
    +  level: [2, 3],
    +}
    +
    `,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('

    markdown.importCode.handleImportPath

    • Type: (str: string) => string

    • Default: (str) => str

    • Details:

      A function to handle the import path of the import code syntax.

    ',3),cl=a("
  • Type: LinksPluginOptions | false

  • 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.

  • ",2),ul=e("p",null,"Also see:",-1),hl=a('
    • 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.

    • 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:

    const defaultOptions = {
    +  level: [2, 3],
    +}
    +
    `,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('
  • 类型: string

  • 默认值: /

  • 详情:

    部署站点的基础路径。

    如果你想让你的网站部署到一个子路径下,你将需要设置它。它的值应当总是以斜杠开始,并以斜杠结束。举例来说,如果你想将你的网站部署到 https://foo.github.io/bar/,那么 base 应该被设置成 "/bar/"

    base 将会作为前缀自动地插入到以 / 开始的其他选项的链接中,所以你只需要指定一次。(head 中的属性除外)

    需要注意的是, base 应该是一个以 / 开始和结束的绝对路径名。

  • ',3),D=e("p",null,"参考:",-1),g=s('

    lang

    • 类型: string

    • 默认值: en-US

    • 详情:

      站点的语言。

      它将会在最终渲染出的 HTML 中作为 <html> 标签的 lang 属性。

      它可以设置在不同语言的 locales 中。

    • 参考:

    title

    • 类型: string

    • 默认值: ''

    • 详情:

      站点的标题。

      它将会作为所有页面标题的后缀,并且在默认主题的导航栏中显示。

      它可以设置在不同语言的 locales 中。

    • 参考:

    description

    ',5),b=s("
  • 类型: string

  • 默认值: ''

  • 详情:

    站点的描述。

    它将会在最终渲染出的 HTML 中作为 <meta name="description" /> 标签的 content 属性。它会被每个页面的 Frontmatter 中的 description 字段覆盖。

    它可以设置在不同语言的 locales 中。

  • ",3),k=e("p",null,"参考:",-1),v=e("li",null,[e("a",{href:"#locales"},"配置 > locales")],-1),y=s(`
    • 类型: HeadConfig[]

    • 默认值: []

    • 详情:

      在最终渲染出的 HTML 的 <head> 标签内加入的额外标签。

      你可以通过 [tagName, { attrName: attrValue }, innerHTML?] 的格式来添加标签。

      它可以设置在不同语言的 locales 中。

      需要注意的是,如果 attrValue 是一个 pathname ,它不会被自动添加 base 前缀,所以如果需要的话请记得手动添加前缀。

    • 示例:

      增加一个自定义的 favicon :

    export default {
    +  head: [['link', { rel: 'icon', href: '/images/logo.png' }]],
    +}
    +

    渲染为:

    <head>
    +  <link rel="icon" href="/images/logo.png" />
    +</head>
    +
    `,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('
  • 类型: { [path: string]: Partial<SiteLocaleData> }

  • 默认值: {}

  • 详情:

    多语言支持的各个语言 locales 。

    可以使用的字段有:

  • ',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("
  • 类型: Bundler

  • 详情:

    设置站点要使用的打包工具。

    如果不设置该选项,将会使用默认的打包工具:

    • 使用 vuepressvuepress-vite 时,默认的打包工具是 Vite 。
    • 使用 vuepress-webpack 时,默认的打包工具是 Webpack 。
  • ",2),N=e("p",null,"参考:",-1),O=s('

    通用配置项

    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

  • 详情:

    指定为页面生成永久链接的 Pattern 。

    它会被每个页面的 Frontmatter 中的 permalinkPattern 字段覆盖。

  • ",3),Q=e("p",null,"参考:",-1),X=s('

    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

    • 默认值:

    const defaultOptions = {
    +  level: [1, 2, 3, 4, 5, 6],
    +  permalink: anchorPlugin.permalink.ariaHidden({
    +    class: 'header-anchor',
    +    symbol: '#',
    +    space: true,
    +    placement: 'before',
    +  }),
    +}
    +
    `,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('

    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

  • 详情:

    配置代码块行号。

    • 布尔值 boolean 代表是否启用代码块行号。
    • 数字 number 代表显示行号所需的最少行数。例如,如果你将它设置为 4 ,那么只有在你的代码块包含至少 4 行代码时才会启用行号。
  • ",3),ve=e("p",null,"参考:",-1),ye=s('

    markdown.code.preWrapper

    • 类型: boolean

    • 默认值: true

    • 详情:

      是否在 <pre> 标签外额外包裹一层。

      highlightLineslineNumbers 依赖于这个额外的包裹层。这换句话说,如果你禁用了 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> 标签上添加 v-pre 指令。

  • ",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("
  • 类型: boolean

  • 默认值: true

  • 详情:

    是否在行内代码的 <code> 标签上添加 v-pre 指令。

  • ",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(`

    警告

    除非你了解它的用途,否则你不应该设置该配置项。

    markdown.headers

    • 类型: HeadersPluginOptions | false

    • 默认值:

    const defaultOptions = {
    +  level: [2, 3],
    +}
    +
    `,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('

    markdown.importCode.handleImportPath

    • 类型: (str: string) => string

    • 默认值: (str) => str

    • 详情:

      一个函数,用于处理导入代码语法中的文件导入路径。

    ',3),hl=s("
  • 类型: LinkPluginOptions | false

  • 详情:

    VuePress 内置的 markdown-it 链接插件的配置项。

    它可以把站内链接转换为 <RouterLink> ,并且可以在站外链接上添加额外的属性和图标。

    设置为 false 可以禁用该插件。

  • ",2),ml=e("p",null,"参考:",-1),_l=s('
    • 类型: string

    • 默认值: 'RouterLink'

    • 详情:

      内部链接所使用的标签。

      默认情况下,该插件会把内部链接转换为 <RouterLink> 。你可以把该选项设置为 'a' 来禁用这个功能。

    • 类型: 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

    • 默认值:

    const defaultOptions = {
    +  level: [2, 3],
    +}
    +
    `,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(`
    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

    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
    • 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, a NavbarGroup object, or a string:

      • A NavbarItem object should have a text field and a link field, could have an optional activeMatch field.
      • A NavbarGroup object should have a text field and a children field. The children 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 as text, and the page route path as link.
    • 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/',
    +          },
    +        ],
    +      },
    +    ],
    +  }),
    +}
    +
    • 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:

    export default {
    +  theme: defaultTheme({
    +    // public file path
    +    logo: '/hero.png',
    +    // url
    +    logo: 'https://vuejs.org/images/logo.png',
    +  }),
    +}
    +
    `,12),I=o(`

    logoDark

    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: '简体中文',
    +      },
    +    },
    +  }),
    +}
    +
    `,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 a text field, could have an optional link field, an optional children field and an optional collapsible field. The children field should be a sidebar array. The collapsible 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, whose text is the page title, link is the page route path, and children 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:

    • The key should be the path prefix.
    • The value should be a sidebar array.
    ",6),Y=s("li",null,[s("p",null,"Example 1:")],-1),V=o(`
    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.

    • 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.
    • ...
    ",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(`

    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:

      PatternDescription
      :repoThe docs repo url, i.e. docsRepo
      :branchThe docs repo branch, i.e. docsBranch
      :pathThe 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

    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.

    ',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:

    • tip
    • warning
    • danger
    • details
    • codeGroup
    • codeGroupItem
    ",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(`

    配置

    配置文件

    如果没有任何配置,你的 VuePress 站点仅有一些最基础的功能。为了更好地自定义你的网站,让我们首先在你的文档目录下创建一个 .vuepress 目录,所有 VuePress 相关的文件都将会被放在这里。你的项目结构可能是这样:

    ├─ docs
    +│  ├─ .vuepress
    +│  │  └─ config.js
    +│  └─ README.md
    +├─ .gitignore
    +└─ package.json
    +

    VuePress 站点的基本配置文件是 .vuepress/config.js ,但也同样支持 TypeScript 配置文件。你可以使用 .vuepress/config.ts 来得到更好的类型提示。

    具体而言,我们对于配置文件的路径有着约定(按照优先顺序):

    • 当前工作目录 cwd 下:
      • vuepress.config.ts
      • vuepress.config.js
      • vuepress.config.mjs
    • 源文件目录 sourceDir 下:
      • .vuepress/config.ts
      • .vuepress/config.js
      • .vuepress/config.mjs
    `,7),D=n("code",null,"--config",-1),u=o(`
    vuepress dev docs --config my-config.js
    +

    一个基础的配置文件是这样的:

    import { defineUserConfig } from 'vuepress'
    +
    +export default defineUserConfig({
    +  lang: 'zh-CN',
    +  title: '你好, VuePress !',
    +  description: '这是我的第一个 VuePress 站点',
    +})
    +
    `,3),v={class:"custom-container tip"},y=n("p",{class:"custom-container-title"},"提示",-1),m=o(`

    客户端配置文件

    在大多数情况下,配置文件已经足够帮助你配置好你的 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

    一个基础的客户端配置文件是这样的:

    import { defineClientConfig } from '@vuepress/client'
    +
    +export default defineClientConfig({
    +  enhance({ app, router, siteData }) {},
    +  setup() {},
    +  rootComponents: [],
    +})
    +
    `,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(`

    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
    `,7),D=e("code",null,"--config",-1),u=o(`
    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',
    +})
    +
    `,3),f={class:"custom-container tip"},v=e("p",{class:"custom-container-title"},"TIP",-1),y=o(`

    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: [],
    +})
    +
    `,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(`

    使用方法

    npm i -D @vuepress/plugin-container@next
    +
    import { containerPlugin } from '@vuepress/plugin-container'
    +
    +export default {
    +  plugins: [
    +    containerPlugin({
    +      // 配置项
    +    }),
    +  ],
    +}
    +

    容器语法

    ::: <type> [info]
    +[content]
    +:::
    +
    • type 是必需的,应通过 type 配置项来指定。
    • info 是可选的,其默认值可以通过 localesdefaultInfo 配置项来指定。
    • 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

    • 示例:

    export default {
    +  plugins: [
    +    containerPlugin({
    +      type: 'tip',
    +      locales: {
    +        '/': {
    +          defaultInfo: 'TIP',
    +        },
    +        '/zh/': {
    +          defaultInfo: '提示',
    +        },
    +      },
    +    }),
    +  ],
    +}
    +
    `,3),g=o(`

    before

    • 类型: (info: string) => string

    • 默认值:

    (info: string): string =>
    +  \`<div class="custom-container \${type}">\${info ? \`<p class="custom-container-title">\${info}</p>\` : ''}\\n\`
    +
    • 详情:

      一个用于渲染容器起始标签的函数。

      第一个参数是 容器语法info 部分。

      如果你没有设置 after 配置项,则该配置项也不会生效。

    after

    • 类型: (info: string) => string

    • 默认值:

    (): string => '</div>\\n'
    +
    • 详情:

      一个用于渲染容器结束标签的函数。

      第一个参数是 容器语法info 部分。

      如果你没有设置 before 配置项,则该配置项也不会生效。

    render

    • 类型:
    type MarkdownItContainerRenderFunction = (
    +  tokens: Token[],
    +  index: number,
    +  options: any,
    +  env: MarkdownEnv,
    +  self: Renderer,
    +) => string
    +
    `,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(`

    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 via defaultInfo 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:

    export default {
    +  plugins: [
    +    containerPlugin({
    +      type: 'tip',
    +      locales: {
    +        '/': {
    +          defaultInfo: 'TIP',
    +        },
    +        '/zh/': {
    +          defaultInfo: '提示',
    +        },
    +      },
    +    }),
    +  ],
    +}
    +
    `,3),E=o(`

    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:
    type MarkdownItContainerRenderFunction = (
    +  tokens: Token[],
    +  index: number,
    +  options: any,
    +  env: MarkdownEnv,
    +  self: Renderer,
    +) => string
    +
    `,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(`
    {
    +  "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 as base defaults to "/".

    If you are deploying to https://<USERNAME>.github.io/<REPO>/, for example your repository is at https://github.com/<USERNAME>/<REPO>, then set base to "/<REPO>/".

    ",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(`
    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 }}
    +
    `,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("

    If you are deploying to https://<USERNAME>.gitlab.io/, you can omit base as it defaults to "/".

    If you are deploying to https://<USERNAME>.gitlab.io/<REPO>/, for example your repository is at https://gitlab.com/<USERNAME>/<REPO>, then set base to "/<REPO>/".

    ",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(`
    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
    +
    `,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(`

    firebase.json:

    {
    +  "hosting": {
    +    "public": "./docs/.vuepress/dist",
    +    "ignore": []
    +  }
    +}
    +

    .firebaserc:

    {
    +  "projects": {
    +    "default": "<YOUR_FIREBASE_ID>"
    +  }
    +}
    +
    1. After running pnpm docs:build, deploy using the command firebase deploy.
    `,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(`
    heroku login
    +
    1. Create a file called static.json in the root of your project with the below content:

    static.json:

    {
    +  "root": "./docs/.vuepress/dist"
    +}
    +
    `,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(`
    {
    +  "scripts": {
    +    "docs:build": "vuepress build docs"
    +  }
    +}
    +

    GitHub Pages

    `,2),_=a("

    如果你准备发布到 https://<USERNAME>.github.io/ ,你可以省略这一步,因为 base 默认就是 "/"

    如果你准备发布到 https://<USERNAME>.github.io/<REPO>/ ,也就是说你的仓库地址是 https://github.com/<USERNAME>/<REPO> ,则将 base 设置为 "/<REPO>/"

    ",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(`
    点击展开配置样例
    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 }}
    +
    `,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("

    如果你准备发布到 https://<USERNAME>.gitlab.io/ ,你可以省略这一步,因此 base 默认就是 "/"

    如果你准备发布到 https://<USERNAME>.gitlab.io/<REPO>/ ,也就是说你的仓库地址是 https://gitlab.com/<USERNAME>/<REPO> ,则将 base 设置为 "/<REPO>/"

    ",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(`
    点击展开配置样例
    # 选择你要使用的 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
    +
    `,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(`

    firebase.json:

    {
    +  "hosting": {
    +    "public": "./docs/.vuepress/dist",
    +    "ignore": []
    +  }
    +}
    +

    .firebaserc:

    {
    +  "projects": {
    +    "default": "<YOUR_FIREBASE_ID>"
    +  }
    +}
    +
    1. 在执行了 pnpm docs:build 后, 使用 firebase deploy 指令来部署。
    `,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(`
    heroku login
    +
    1. 在你的项目根目录中,创建一个名为 static.json 的文件,并包含下述内容:

    static.json:

    {
    +  "root": "./docs/.vuepress/dist"
    +}
    +
    `,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(`
    1. 全局安装 CloudBase CLI :
    pnpm install -g @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(`
    cloudbase init --without-template
    +cloudbase framework:deploy
    +

    CloudBase CLI 首先会跳转到控制台进行登录授权,然后将会交互式进行确认。

    确认信息后会立即进行部署,部署完成后,可以获得一个自动 SSL,CDN 加速的网站应用,你也可以搭配使用 GitHub Action 来持续部署 GitHub 上的 VuePress 应用。

    也可以使用 cloudbase init --template vuepress 快速创建和部署一个新的 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(`

    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(`
    Official 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),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,"Partial")])],-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:

    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: '搜索文档',
    +            },
    +          },
    +        },
    +      },
    +    }),
    +  ],
    +}
    +
    `,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('

    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.

    TIP

    This component is mainly used for theme development. You don't need to use it directly in most cases.

    `,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(`

    提示

    当你正确配置该插件后,默认主题会把 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(`
    官方爬虫配置示例
    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),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")])],-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 中进行配置。

    • 示例:

    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: '搜索文档',
    +            },
    +          },
    +        },
    +      },
    +    }),
    +  ],
    +}
    +
    `,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('

    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 布局已经被你的本地布局覆盖,将会在除了首页外的所有页面添加一个自定义的页脚:

    extending-a-theme

    组件替换

    布局插槽十分实用,但有时候你可能会觉得它不够灵活。默认主题同样提供了替换单个组件的能力。

    ',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 中直接扩展默认主题以外,你可以通过继承默认主题来开发一个你自己的主题:

    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',
    +      ),
    +    },
    +  }
    +}
    +
    `,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(`

    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 the Layout 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):

    extending-a-theme

    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:

    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',
    +      ),
    +    },
    +  }
    +}
    +
    `,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(`

    该插件已经集成到默认主题中。

    使用方法

    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 文字。

      如果没有指定该配置项,它会降级使用默认文字。

    • 示例:

    export default {
    +  plugins: [
    +    externalLinkIconPlugin({
    +      locales: {
    +        '/': {
    +          openInNewWindow: 'open in new window',
    +        },
    +        '/zh/': {
    +          openInNewWindow: '在新窗口打开',
    +        },
    +      },
    +    }),
    +  ],
    +}
    +
    `,8),v=e(`

    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:

    export default {
    +  plugins: [
    +    externalLinkIconPlugin({
    +      locales: {
    +        '/': {
    +          openInNewWindow: 'open in new window',
    +        },
    +        '/zh/': {
    +          openInNewWindow: '在新窗口打开',
    +        },
    +      },
    +    }),
    +  ],
    +}
    +
    `,8),h=l(`

    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.

    TIP

    This component is mainly used for theme development. You don't need to use it directly in most cases.

    `,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(`
    • 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:

    <head>
    +  <meta name="foo" content="yaml array syntax" />
    +  <meta name="bar" content="square brackets syntax" />
    +</head>
    +
    `,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(`

    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
    +---
    +
    `,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:

      PatternDescription
      :yearYear part of created date
      :monthMonth part of created date
      :dayDay part of created date
      :slugSlug of page filename
      :rawRaw 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 or yyyy-MM-foobar.md.
      • The dirname that matches the date pattern yyyy/MM/dd/foobar.md or yyyy/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 2021/01/03/bar-baz.html.

    `,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,"Record")])],-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:

    .theme-container.custom-page-class {
    +  /* page styles */
    +}
    +
    `,5),E=i(`

    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:

    ---
    +# public file path
    +heroImage: /images/hero.png
    +# url
    +heroImage: https://vuejs.org/images/logo.png
    +---
    +
    `,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('

    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.
    +---
    +
    • 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.

    `,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 a text field and a link field.
      • A string should be the path to the target page file. It will be converted to a NavLink object, whose text is the page title, and link 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

    • 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.

    `,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(`
    • 类型: HeadConfig[]

    • 详情:

      页面 <head> 标签内添加的额外标签。

    • 示例:

    ---
    +head:
    +  - - meta
    +    - name: foo
    +      content: yaml 数组语法
    +  - [meta, { name: bar, content: 方括号语法 }]
    +---
    +

    渲染为:

    <head>
    +  <meta name="foo" content="yaml 数组语法" />
    +  <meta name="bar" content="方括号语法" />
    +</head>
    +
    `,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(`

    layout

    • 类型: string

    • 详情:

      页面的布局。

      布局是由主题提供的。如果你不指定该 Frontmatter ,则会使用默认布局。你应该参考主题自身的文档来了解其提供了哪些布局。

      如果主题布局无法满足你的需求,你可以使用自定义布局组件。

    • 示例:

    .vuepress/client.ts 文件中注册一个布局组件:

    import { defineClientConfig } from '@vuepress/client'
    +import CustomLayout from './CustomLayout.vue'
    +
    +export default defineClientConfig({
    +  layouts: {
    +    CustomLayout,
    +  },
    +})
    +

    在 Frontmatter 中设置自定义布局:

    ---
    +layout: CustomLayout
    +---
    +
    `,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.mdyyyy-MM-foobar.md 日期格式的文件名。
      • 符合 yyyy/MM/dd/foobar.mdyyyy/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
    +---
    +

    那么页面的永久链接将会是 2021/01/03/bar-baz.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,"Record")])],-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 文件中为这个页面添加自定义样式:

    .theme-container.custom-page-class {
    +  /* 页面样式 */
    +}
    +
    `,5),E=i(`

    首页

    本章节中的 Frontmatter 只会在首页中生效。

    home

    • 类型: boolean

    • 详情:

      设定该页面是首页还是普通页面。

      如果你不设置该 Frontmatter 或将其设为 false ,则该页面会是一个 普通页面

    • 示例:

      ---
      +home: true
      +---
      +

    heroImage

    `,5),L=i(`
  • 类型: string

  • 详情:

    首页图片的 URL 。

  • 示例:

    ---
    +# Public 文件路径
    +heroImage: /images/hero.png
    +# URL
    +heroImage: https://vuejs.org/images/logo.png
    +---
    +
  • `,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('

    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 运行。
    +---
    +
    • 类型: string

    • 详情:

      首页的页脚。

    footerHtml

    • 类型: boolean

    • 详情:

      是否允许页脚中使用 HTML 。

      如果设置为 true ,那么 footer 会被作为 HTML 代码处理。

    普通页面

    本章节中的 Frontmatter 只会在普通页面中生效。

    `,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

    • 类型: NavLink | string

    • 详情:

      下一个页面的链接。

      如果你不设置该 Frontmatter ,该链接会自动根据侧边栏配置进行推断。

      类型和 prev Frontmatter 相同。

    `,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(`

    手动安装

    这一章节会帮助你从头搭建一个简单的 VuePress 文档网站。如果你想在一个现有项目中使用 VuePress 管理文档,从步骤 3 开始。

    • 步骤 1: 创建并进入一个新目录
    mkdir vuepress-starter
    +cd vuepress-starter
    +
    • 步骤 2: 初始化项目
    `,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(`
    {
    +  "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
    +
    • 步骤 7: 在本地启动服务器来开发你的文档网站
    `,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(`

    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
    `,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(`
    {
    +  "scripts": {
    +    "docs:dev": "vuepress dev docs",
    +    "docs:build": "vuepress build docs"
    +  }
    +}
    +
    • Step 5: Add the default temp and cache directory to .gitignore file
    echo '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
    `,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(`

    该插件主要用于开发主题,大部分情况下你不需要直接使用它。

    使用方法

    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
    +}
    +
    • 详情:

      页面的贡献者信息。

      该属性将会包含 gitInclude 所列文件的贡献者。

    `,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(`

    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
    +}
    +
    • Details:

      The contributors information of the page.

      This attribute would also include contributors to the files listed in gitInclude.

    `,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(`

    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(`
    export default {
    +  plugins: [
    +    googleAnalyticsPlugin({
    +      id: 'G-XXXXXXXXXX',
    +      debug: true,
    +    }),
    +  ],
    +}
    +
    `,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(`

    使用方法

    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(`
    export default {
    +  plugins: [
    +    googleAnalyticsPlugin({
    +      id: 'G-XXXXXXXXXX',
    +      debug: true,
    +    }),
    +  ],
    +}
    +
    `,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(`

    多语言支持

    站点多语言配置

    要启用 VuePress 的多语言支持,首先需要使用如下的文件目录结构:

    docs
    +├─ README.md
    +├─ foo.md
    +├─ nested
    +│  └─ README.md
    +└─ zh
    +   ├─ README.md
    +   ├─ foo.md
    +   └─ nested
    +      └─ README.md
    +
    `,4),d=n("code",null,"locales",-1),y=p(`
    export default {
    +  locales: {
    +    // 键名是该语言所属的子路径
    +    // 作为特例,默认语言可以使用 '/' 作为其路径。
    +    '/': {
    +      lang: 'en-US',
    +      title: 'VuePress',
    +      description: 'Vue-powered Static Site Generator',
    +    },
    +    '/zh/': {
    +      lang: 'zh-CN',
    +      title: 'VuePress',
    +      description: 'Vue 驱动的静态网站生成器',
    +    },
    +  },
    +}
    +

    如果一个语言没有声明 lang, title, description 或者 head ,VuePress 将会尝试使用顶层配置的对应值。如果每个语言都声明了这些值,那么顶层配置中的对应值可以被省略。

    `,2),v={class:"custom-container tip"},u=n("p",{class:"custom-container-title"},"提示",-1),m=p(`

    主题多语言配置

    VuePress 没有限制主题如何提供多语言支持,因此每个主题可能会有不同的多语言配置方式,而且部分主题可能不会提供多语言支持。建议你查看主题本身的文档来获取更详细的指引。

    如果你使用的是默认主题,那么它提供多语言支持的方式和上述是一致的:

    import { defaultTheme } from 'vuepress'
    +
    +export default {
    +  theme: defaultTheme({
    +    locales: {
    +      '/': {
    +        selectLanguageName: 'English',
    +      },
    +      '/zh/': {
    +        selectLanguageName: '简体中文',
    +      },
    +    },
    +  }),
    +}
    +
    `,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(`

    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
    +
    `,4),d=n("code",null,"locales",-1),u=o(`
    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 or head, VuePress will fallback to the root-level values. You can omit the root level config as long as they are provided in each locale.

    `,2),y={class:"custom-container tip"},v=n("p",{class:"custom-container-title"},"TIP",-1),m=o(`

    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: '简体中文',
    +      },
    +    },
    +  }),
    +}
    +
    `,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;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 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);r3)for(r=[r],i=3;i0?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;l3)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;et.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;it.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.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;e1&&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);r0&&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;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0},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;et.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;et.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+c2&&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;n0?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;et.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.length0&&(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;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&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 alias when extending or using your theme.

    `,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(`

    布局插槽

    这种方式需要你来决定主题的哪些部分是可以被扩展的,它更适合用于一些常见的自定义需求,比如页眉或页脚。

    你只需要在你的布局文件中提供 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>
    +

    这样,用户在继承或使用你的主题时,就可以通过覆盖 alias 来替换特定的组件了。

    `,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(`

    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">
    +    配置参考 &gt; 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',
    +  }),
    +})
    +
     




     
     
     

    行数范围标记的例子:

    • 行数范围: {5-8}
    • 多个单行: {4,7,9}
    • 组合: {4,7-13,16,23-27,40}
    `,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(`

    行号

    你肯定已经注意到在代码块的最左侧会展示行号。这个功能是默认启用的,你可以通过配置来禁用它。

    你可以在代码块添加 :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'
    +
    // 行号被禁用
    +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(`

    你可以在代码块添加 :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
    +
    // 由于 JS 代码高亮,这里不会被正确编译
    +const onePlusTwoPlusThree = {{ 1 + 2 + 3 }}
    +
    `,8),Es={class:"custom-container tip"},fs=s("p",{class:"custom-container-title"},"提示",-1),ws=s("p",null,"v-pre 扩展是由我们的内置插件支持的。",-1),xs=t(`

    导入代码块

    你可以使用下面的语法,从文件中导入代码块:

    <!-- 最简单的语法 -->
    +
    +@[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')),
    +    },
    +  },
    +}
    +
    <!-- 会被解析至 'path/to/src/foo.js' -->
    +
    +@[code](@src/foo.js)
    +
    `,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(`

    输入

    一加一等于: {{ 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 the title and content are optional.

    Supported type :

    `,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(`

    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 &gt; 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:

    • Line ranges: {5-8}
    • Multiple single lines: {4,7,9}
    • Combined: {4,7-13,16,23-27,40}
    `,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 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'
    +
    `,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(`

    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 }}
    +
    `,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(`

    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)
    +
    `,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(`

    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 是必需的, titlecontent 是可选的。

    支持的 type 有:

    `,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(`

    输入

    ::: 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(`
    import { nextTick } from 'vue'
    +import { useMediumZoom } from '@vuepress/plugin-medium-zoom/client'
    +
    +export default {
    +  setup() {
    +    const zoom = useMediumZoom()
    +
    +    // ... 进行了一些操作,在当前页面添加了新的图片
    +
    +    // 此时你可能需要手动调用 \`refresh\` 来让这些新图片支持缩放
    +    nextTick(() => {
    +      zoom.refresh()
    +    })
    +  },
    +}
    +
    `,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(`

    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(`
    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()
    +    })
    +  },
    +}
    +
    `,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(`

    从 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
    - module.exports = {
    +-   sass: { /* ... */ },
    +- }
    +
    ++ import { webpackBundler } from '@vuepress/bundler-webpack'
    ++ export default {
    ++   bundler: webpackBundler({
    ++     sass: { /* ... */ },
    ++   }),
    ++ }
    +
    `,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(`
    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 变更

    • :i_month:移除
    • :i_day:移除
    • :minutes:移除(v1 文档中未列出)
    • :seconds:移除(v1 文档中未列出)
    • :regular:重命名为 :raw
    `,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(`

    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 现在只接受 tipwarningdanger

    调色板系统

    默认主题的调色板系统迁移为 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 变更

    • plugins:移除
    • ready:重命名为 onPrepared
    • updated:重命名为 onWatched
    • generated:重命名为 onGenerated
    • additionalPages:移除,改为在 onInitialized Hook 中使用 app.pages.push(createPage())
    • clientDynamicModules:移除,改为在 onPrepared Hook 中使用 app.writeTemp()
    • enhanceAppFiles:移除,使用 clientConfigFile Hook
    • globalUIComponents:移除,使用 clientConfigFile Hook
    • clientRootMixin:移除,使用 clientConfigFile Hook
    • extendMarkdown:重命名为 extendsMarkdown
    • chainMarkdown:移除
    • extendPageData:重命名为 extendsPage
    • extendsCli:移除
    • configureWebpack:移除
    • chainWebpack:移除
    • beforeDevServer:移除
    • afterDevServer:移除
    ',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("
  • theme/layouts/ 目录下的文件不会被自动注册为布局组件。你需要在 clientConfigFile 中通过 layouts 来显式指定。
  • theme/templates/ 目录下的文件不会被自动用作 dev / ssr 的模板。你需要通过 templateBuildtemplateDev 配置项来显式指定。
  • 你始终需要提供一个合法的 JS 入口文件,不要再使用 "main": "layouts/Layout.vue" 作为主题入口。
  • ",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(`

    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.

    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 to true.

    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(`

    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 from false to true
    - module.exports = {
    +-   sass: { /* ... */ },
    +- }
    +
    ++ import { webpackBundler } from '@vuepress/bundler-webpack'
    ++ export default {
    ++   bundler: webpackBundler({
    ++     sass: { /* ... */ },
    ++   }),
    ++ }
    +
    `,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(`
    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');\`],
    +  ],
    +  // ...
    +}
    +
    • :i_month: removed
    • :i_day: removed
    • :minutes: removed (undocumented in v1)
    • :seconds: removed (undocumented in v1)
    • :regular: renamed to :raw
    `,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(`

    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 for cache option, and the value of cache 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 accepts tip, warning and danger 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: {
    +-   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

    • plugins: removed
    • ready: renamed to onPrepared
    • updated: renamed to onWatched
    • generated: renamed to onGenerated
    • additionalPages: removed, use app.pages.push(createPage()) in onInitialized hook
    • clientDynamicModules: removed, use app.writeTemp() in onPrepared hook
    • enhanceAppFiles: removed, use clientConfigFile hook
    • globalUIComponents: removed, use clientConfigFile hook
    • clientRootMixin: removed, use clientConfigFile hook
    • extendMarkdown: renamed to extendsMarkdown
    • chainMarkdown: removed
    • extendPageData: renamed to extendsPage
    • extendsCli: removed
    • configureWebpack: removed
    • chainWebpack: removed
    • beforeDevServer: removed
    • afterDevServer: removed
    ',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("
  • Files in theme/layouts/ directory will not be registered as layout components automatically. You need to specify it explicitly in layouts option in clientConfigFile.
  • Files in theme/templates/ directory will not be used as dev / ssr template automatically. You need to specify theme explicitly in templateBuild and templateDev option.
  • Always provide a valid js entry file, and do not use "main": "layouts/Layout.vue" as the theme entry anymore.
  • ",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(`
    npm i -D @vuepress/core@next
    +

    App

    `,2),C=p(`

    BuildAppDevApp 除了 builddev 方法外,拥有一样的属性和方法。

    createBuildApp

    • 函数签名:
    const createBuildApp: (config: AppConfig) => BuildApp
    +
    • 参数:
    参数类型描述
    configAppConfig创建 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
    +
    • 参数:
    参数类型描述
    configAppConfig创建 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 / createDevAppconfig 参数,但所有可选的字段都填充上了默认值。

    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>
    +
    • 参数:
    参数类型描述
    filestring要写入的临时文件的路径,相对于临时文件目录。
    contentstring要写入的临时文件路径的内容。
    • 详情:

      用于写入临时文件的方法。

      写入的文件可以在客户端文件中通过 @temp 别名来引入。

    • 示例:

    export default {
    +  // 在 onPrepared hook 中写入临时文件
    +  async onPrepared() {
    +    await app.writeTemp('foo.js', "export const foo = 'bar'")
    +  },
    +}
    +
    // 在客户端文件中引入临时文件
    +import { foo } from '@temp/foo'
    +

    init

    • 函数签名:
    init(): Promise<void>
    +
    `,17),B=s("li",null,[s("p",null,"详情:"),s("p",null,"初始化 VuePress App 。")],-1),w=s("p",null,"参考:",-1),z=p(`

    prepare

    • 函数签名:
    prepare(): Promise<void>
    +
    `,3),M=s("li",null,[s("p",null,"详情:"),s("p",null,"准备客户端临时文件。")],-1),I=s("p",null,"参考:",-1),R=p(`

    build

    • 函数签名:
    build(): Promise<void>
    +
    `,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(`

    dev

    • 函数签名:
    dev(): Promise<() => Promise<void>>
    +
    `,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(`

    Page

    createPage

    • 函数签名:
    const createPage: (app: App, options: PageOptions) => Promise<Page>
    +
    • 参数:
    参数类型描述
    appAppVuePress App 实例。
    optionsPageOptions创建 VuePress Page 的选项。
    • 详情:

      创建一个 VuePress Page 对象。

    • 示例:

    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
    +
    +你好,世界。
    +\`,
    +      }),
    +    )
    +  },
    +}
    +
    `,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("
  • 类型: string

  • 详情:

    该 Page 的语言。

  • 示例:

    • 'en-US'
    • 'zh-CN'
  • ",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(`

    headers

    • 类型: PageHeader[]
    interface PageHeader {
    +  level: number
    +  title: string
    +  slug: string
    +  children: PageHeader[]
    +}
    +
    `,3),Ds=s("li",null,[s("p",null,"详情:"),s("p",null,"该 Page 的小标题。")],-1),us=s("p",null,"参考:",-1),hs=p(`

    data

    • 类型: PageData
    interface PageData {
    +  key: string
    +  path: string
    +  title: string
    +  lang: string
    +  frontmatter: PageFrontmatter
    +  headers: PageHeader[]
    +}
    +
    `,3),ys=s("li",null,[s("p",null,"详情:"),s("p",null,"该 Page 的数据。"),s("p",null,"Page 数据可以在客户端代码中使用。")],-1),vs=s("p",null,"参考:",-1),Cs=p('

    content

    • 类型: string

    • 详情:

      该 Page 的未经渲染的原始内容。

    contentRendered

    • 类型: string

    • 详情:

      该 Page 的渲染后的内容。

    date

    ',5),ms=p("
  • 类型: string

  • 详情:

    该 Page 的日期,遵从 'yyyy-MM-dd' 格式。

  • 示例:

    • '0000-00-00'
    • '2021-08-16'
  • ",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(`
    • 类型: MarkdownLink[]
    interface MarkdownLink {
    +  raw: string
    +  relative: string
    +  absolute: string
    +}
    +
    • 详情:

      该 Page 内容中包含的链接。

    markdownEnv

    `,5),ks=p("
  • 类型: Record<string, unknown>

  • 详情:

    在使用 markdown-it 解析 Markdown 内容时的 env 对象。

    一些 markdown-it 插件可能会在这个对象中存储一些额外的信息,你可以使用它们来进行高级定制化。

    需要注意的是,其他的一些 Page 属性其实也是从 env 对象中获取到的,但是我们已经把这些属性从 page.markdownEnv 中移除掉了。

  • ",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('
  • 类型: string | null

  • 详情:

    该 Page 根据文件路径推断出的路由路径。

    默认情况下,路由路径是根据 Markdown 源文件的相对文件路径推断出来的。然而,用户可能会显式指定页面路由,比如通过 permalink 来指定该页面最终使用的路由路径。因此我们在 Page 属性中保留推断出来的路径,以便于你在某些情况下可能会用到它。

    如果该 Page 不是来自于 Markdown 源文件,那么该属性会为 null

  • 示例:

    • '/'
    • '/foo.html'
  • ',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("
  • 类型: string

  • 详情:

    该 Page 路由路径的 Locale 前缀。

    它是根据页面的 Markdown 源文件相对路径、以及用户配置的 locales 的键推断得到的。

  • 示例:

    • '/'
    • '/en/'
    • '/zh/'
  • ",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")])],-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 MetaPage 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

    • 类型: string | null

    • 详情:

      该 Page 的 Markdown 源文件的相对路径。

      如果该 Page 不是来自于 Markdown 源文件,那么该属性会为 null

    ',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(`
    npm i -D @vuepress/core@next
    +

    App

    `,2),m=o(`

    The BuildApp and DevApp share almost the same properties and methods, except build and dev method.

    createBuildApp

    • Signature:
    const createBuildApp: (config: AppConfig) => BuildApp
    +
    • Parameters:
    ParameterTypeDescription
    configAppConfigConfig 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)
    +}
    +

    createDevApp

    • Signature:
    const createDevApp: (config: AppConfig) => DevApp
    +
    • Parameters:
    ParameterTypeDescription
    configAppConfigConfig 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)
    +}
    +

    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 directory
      • dir.temp(): resolve to temp directory
      • dir.source(): resolve to source directory
      • dir.dest(): resolve to dest directory
      • dir.client(): resolve to @vuepress/client directory
      • dir.public(): resolve to public directory
    • Signature:

    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:
    ParameterTypeDescription
    filestringFilepath of the temp file that going to be written. Relative to temp directory.
    contentstringContent 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:
    init(): Promise<void>
    +
    `,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(`

    prepare

    • Signature:
    prepare(): Promise<void>
    +
    `,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(`

    build

    • Signature:
    build(): Promise<void>
    +
    `,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(`

    dev

    • Signature:
    dev(): Promise<() => Promise<void>>
    +
    `,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(`

    Page

    createPage

    • Signature:
    const createPage: (app: App, options: PageOptions) => Promise<Page>
    +
    • Parameters:
    ParameterTypeDescription
    appAppThe VuePress app instance.
    optionsPageOptionsOptions to create VuePress page.
    • Details:

      Create a VuePress page object.

    • Example:

    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.
    +\`,
    +      }),
    +    )
    +  },
    +}
    +
    `,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("
  • Type: string

  • Details:

    Language of the page.

  • Example:

    • 'en-US'
    • 'zh-CN'
  • ",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(`

    headers

    • Type: PageHeader[]
    interface PageHeader {
    +  level: number
    +  title: string
    +  slug: string
    +  children: 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(`

    data

    • Type: PageData
    interface PageData {
    +  key: string
    +  path: string
    +  title: string
    +  lang: string
    +  frontmatter: PageFrontmatter
    +  headers: PageHeader[]
    +}
    +
    `,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('

    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.

  • Example:

    • '0000-00-00'
    • '2021-08-16'
  • ",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(`
    • 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>

  • 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 from page.markdownEnv.

  • ",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('
  • 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.

  • Example:

    • '/'
    • '/foo.html'
  • ',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("
  • 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.

  • Example:

    • '/'
    • '/en/'
    • '/zh/'
  • ",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")])],-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

    • 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.

    ',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(`

    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:

    :root {
    +  --nprogress-color: #29d;
    +  --nprogress-z-index: 1031;
    +}
    +
    `,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(`

    该插件已经集成到默认主题中。

    使用方法

    npm i -D @vuepress/plugin-nprogress@next
    +
    import { nprogressPlugin } from '@vuepress/plugin-nprogress'
    +
    +export default {
    +  plugins: [nprogressPlugin()],
    +}
    +

    样式

    你可以通过 CSS 变量来自定义进度条的样式:

    :root {
    +  --nprogress-color: #29d;
    +  --nprogress-z-index: 1031;
    +}
    +
    `,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(`

    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
    +
    `,6),h=t("code",null,"docs",-1),m=t("code",null,"vuepress dev docs",-1),f=r("
    Relative PathRoute Path
    /README.md/
    /index.md/
    /contributing.md/contributing.html
    /guide/README.md/guide/
    /guide/getting-started.md/guide/getting-started.html
    ",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(`
    ---
    +lang: en-US
    +title: Title of this page
    +description: Description of this page
    +---
    +
    `,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,"