-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
clh
committed
Dec 3, 2024
1 parent
d03495a
commit 05dd5da
Showing
31 changed files
with
312 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,11 +32,11 @@ jobs: | |
- name: Build Site | ||
run: npm run docs:build | ||
|
||
# 将文档产物提交到gh-pages分支 | ||
# 将文档产物提交到master分支 | ||
- name: Deploy for Github 🚀 | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
branch: master | ||
folder: docs/.vitepress/dist | ||
# enable single-commit to reduce the repo size | ||
single-commit: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US" dir="ltr"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<title>404 | Charlie Blog</title> | ||
<meta name="description" content="Not Found"> | ||
<meta name="generator" content="VitePress v1.5.0"> | ||
<link rel="preload stylesheet" href="/assets/style.B2ecEMZ6.css" as="style"> | ||
<link rel="preload stylesheet" href="/vp-icons.css" as="style"> | ||
|
||
<script type="module" src="/assets/app.r5tYvX-f.js"></script> | ||
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin=""> | ||
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script> | ||
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script>window.__VP_HASH_MAP__=JSON.parse("{\"api-examples.md\":\"CHn0THWE\",\"index.md\":\"DgEX3J0P\",\"markdown-examples.md\":\"CTAsE_tL\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Charlie Blog\",\"description\":\"Welcome to Charlie's blog!\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"Home\",\"link\":\"/\"},{\"text\":\"Examples\",\"link\":\"/markdown-examples\"}],\"sidebar\":[{\"text\":\"Examples\",\"items\":[{\"text\":\"Markdown Examples\",\"link\":\"/markdown-examples\"},{\"text\":\"Runtime API Examples\",\"link\":\"/api-examples\"}]}],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/vuejs/vitepress\"}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US" dir="ltr"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<title>Runtime API Examples | Charlie Blog</title> | ||
<meta name="description" content="Welcome to Charlie's blog!"> | ||
<meta name="generator" content="VitePress v1.5.0"> | ||
<link rel="preload stylesheet" href="/assets/style.B2ecEMZ6.css" as="style"> | ||
<link rel="preload stylesheet" href="/vp-icons.css" as="style"> | ||
|
||
<script type="module" src="/assets/app.r5tYvX-f.js"></script> | ||
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin=""> | ||
<link rel="modulepreload" href="/assets/chunks/theme.BpX2rRNb.js"> | ||
<link rel="modulepreload" href="/assets/chunks/framework.BGabeMLJ.js"> | ||
<link rel="modulepreload" href="/assets/api-examples.md.CHn0THWE.lean.js"> | ||
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script> | ||
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script> | ||
</head> | ||
<body> | ||
<div id="app"><div class="Layout" data-v-e82b0478><!--[--><!--]--><!--[--><span tabindex="-1" data-v-95e4e91c></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-95e4e91c> Skip to content </a><!--]--><!----><header class="VPNav" data-v-e82b0478 data-v-8c670eef><div class="VPNavBar" data-v-8c670eef data-v-f1cc7ac9><div class="wrapper" data-v-f1cc7ac9><div class="container" data-v-f1cc7ac9><div class="title" data-v-f1cc7ac9><div class="VPNavBarTitle has-sidebar" data-v-f1cc7ac9 data-v-706b8a92><a class="title" href="/" data-v-706b8a92><!--[--><!--]--><!----><span data-v-706b8a92>Charlie Blog</span><!--[--><!--]--></a></div></div><div class="content" data-v-f1cc7ac9><div class="content-body" data-v-f1cc7ac9><!--[--><!--]--><div class="VPNavBarSearch search" data-v-f1cc7ac9><!----></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-f1cc7ac9 data-v-c7dd21cc><span id="main-nav-aria-label" class="visually-hidden" data-v-c7dd21cc> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/" tabindex="0" data-v-c7dd21cc data-v-7ca42efb><!--[--><span data-v-7ca42efb>Home</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/markdown-examples.html" tabindex="0" data-v-c7dd21cc data-v-7ca42efb><!--[--><span data-v-7ca42efb>Examples</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-f1cc7ac9 data-v-915670bf><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-915670bf data-v-f9f47021 data-v-7a4da74b><span class="check" data-v-7a4da74b><span class="icon" data-v-7a4da74b><!--[--><span class="vpi-sun sun" data-v-f9f47021></span><span class="vpi-moon moon" data-v-f9f47021></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-f1cc7ac9 data-v-561d04be data-v-c9628203><!--[--><a class="VPSocialLink no-icon" href="https://github.com/vuejs/vitepress" aria-label="github" target="_blank" rel="noopener" data-v-c9628203 data-v-3f83907b><span class="vpi-social-github"></span></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-f1cc7ac9 data-v-266ae973 data-v-13cdd73a><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-13cdd73a><span class="vpi-more-horizontal icon" data-v-13cdd73a></span></button><div class="menu" data-v-13cdd73a><div class="VPMenu" data-v-13cdd73a data-v-782d28ee><!----><!--[--><!--[--><!----><div class="group" data-v-266ae973><div class="item appearance" data-v-266ae973><p class="label" data-v-266ae973>Appearance</p><div class="appearance-action" data-v-266ae973><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-266ae973 data-v-f9f47021 data-v-7a4da74b><span class="check" data-v-7a4da74b><span class="icon" data-v-7a4da74b><!--[--><span class="vpi-sun sun" data-v-f9f47021></span><span class="vpi-moon moon" data-v-f9f47021></span><!--]--></span></span></button></div></div></div><div class="group" data-v-266ae973><div class="item social-links" data-v-266ae973><div class="VPSocialLinks social-links-list" data-v-266ae973 data-v-c9628203><!--[--><a class="VPSocialLink no-icon" href="https://github.com/vuejs/vitepress" aria-label="github" target="_blank" rel="noopener" data-v-c9628203 data-v-3f83907b><span class="vpi-social-github"></span></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-f1cc7ac9 data-v-4d8ad16d><span class="container" data-v-4d8ad16d><span class="top" data-v-4d8ad16d></span><span class="middle" data-v-4d8ad16d></span><span class="bottom" data-v-4d8ad16d></span></span></button></div></div></div></div><div class="divider" data-v-f1cc7ac9><div class="divider-line" data-v-f1cc7ac9></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-e82b0478 data-v-8e7ffb7c><div class="container" data-v-8e7ffb7c><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-8e7ffb7c><span class="vpi-align-left menu-icon" data-v-8e7ffb7c></span><span class="menu-text" data-v-8e7ffb7c>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-8e7ffb7c data-v-6d360d95><button data-v-6d360d95>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-e82b0478 data-v-815c4c2d><div class="curtain" data-v-815c4c2d></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-815c4c2d><span class="visually-hidden" id="sidebar-aria-label" data-v-815c4c2d> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-82ed0220><section class="VPSidebarItem level-0 has-active" data-v-82ed0220 data-v-8f293ade><div class="item" role="button" tabindex="0" data-v-8f293ade><div class="indicator" data-v-8f293ade></div><h2 class="text" data-v-8f293ade>Examples</h2><!----></div><div class="items" data-v-8f293ade><!--[--><div class="VPSidebarItem level-1 is-link" data-v-8f293ade data-v-8f293ade><div class="item" data-v-8f293ade><div class="indicator" data-v-8f293ade></div><a class="VPLink link link" href="/markdown-examples.html" data-v-8f293ade><!--[--><p class="text" data-v-8f293ade>Markdown Examples</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-8f293ade data-v-8f293ade><div class="item" data-v-8f293ade><div class="indicator" data-v-8f293ade></div><a class="VPLink link link" href="/api-examples.html" data-v-8f293ade><!--[--><p class="text" data-v-8f293ade>Runtime API Examples</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-e82b0478 data-v-91af4e23><div class="VPDoc has-sidebar has-aside" data-v-91af4e23 data-v-fca15d40><!--[--><!--]--><div class="container" data-v-fca15d40><div class="aside" data-v-fca15d40><div class="aside-curtain" data-v-fca15d40></div><div class="aside-container" data-v-fca15d40><div class="aside-content" data-v-fca15d40><div class="VPDocAside" data-v-fca15d40 data-v-ec239fac><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-ec239fac data-v-c0dee88f><div class="content" data-v-c0dee88f><div class="outline-marker" data-v-c0dee88f></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-c0dee88f>On this page</div><ul class="VPDocOutlineItem root" data-v-c0dee88f data-v-369db6a8><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-ec239fac></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-fca15d40><div class="content-container" data-v-fca15d40><!--[--><!--]--><main class="main" data-v-fca15d40><div style="position:relative;" class="vp-doc _api-examples" data-v-fca15d40><div><h1 id="runtime-api-examples" tabindex="-1">Runtime API Examples <a class="header-anchor" href="#runtime-api-examples" aria-label="Permalink to "Runtime API Examples""></a></h1><p>This page demonstrates usage of some of the runtime APIs provided by VitePress.</p><p>The main <code>useData()</code> API can be used to access site, theme, and page data for the current page. It works in both <code>.md</code> and <code>.vue</code> files:</p><div class="language-md vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">md</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><script setup></span></span> | ||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">import { useData } from 'vitepress'</span></span> | ||
<span class="line"></span> | ||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">const { theme, page, frontmatter } = useData()</span></span> | ||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></script></span></span> | ||
<span class="line"></span> | ||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">## Results</span></span> | ||
<span class="line"></span> | ||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">### Theme Data</span></span> | ||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><pre>{{ theme }}</pre></span></span> | ||
<span class="line"></span> | ||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">### Page Data</span></span> | ||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><pre>{{ page }}</pre></span></span> | ||
<span class="line"></span> | ||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold;">### Page Frontmatter</span></span> | ||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><pre>{{ frontmatter }}</pre></span></span></code></pre></div><h2 id="results" tabindex="-1">Results <a class="header-anchor" href="#results" aria-label="Permalink to "Results""></a></h2><h3 id="theme-data" tabindex="-1">Theme Data <a class="header-anchor" href="#theme-data" aria-label="Permalink to "Theme Data""></a></h3><pre>{ | ||
"nav": [ | ||
{ | ||
"text": "Home", | ||
"link": "/" | ||
}, | ||
{ | ||
"text": "Examples", | ||
"link": "/markdown-examples" | ||
} | ||
], | ||
"sidebar": [ | ||
{ | ||
"text": "Examples", | ||
"items": [ | ||
{ | ||
"text": "Markdown Examples", | ||
"link": "/markdown-examples" | ||
}, | ||
{ | ||
"text": "Runtime API Examples", | ||
"link": "/api-examples" | ||
} | ||
] | ||
} | ||
], | ||
"socialLinks": [ | ||
{ | ||
"icon": "github", | ||
"link": "https://github.com/vuejs/vitepress" | ||
} | ||
] | ||
}</pre><h3 id="page-data" tabindex="-1">Page Data <a class="header-anchor" href="#page-data" aria-label="Permalink to "Page Data""></a></h3><pre>{ | ||
"title": "Runtime API Examples", | ||
"description": "", | ||
"frontmatter": { | ||
"outline": "deep" | ||
}, | ||
"headers": [], | ||
"relativePath": "api-examples.md", | ||
"filePath": "api-examples.md" | ||
}</pre><h3 id="page-frontmatter" tabindex="-1">Page Frontmatter <a class="header-anchor" href="#page-frontmatter" aria-label="Permalink to "Page Frontmatter""></a></h3><pre>{ | ||
"outline": "deep" | ||
}</pre><h2 id="more" tabindex="-1">More <a class="header-anchor" href="#more" aria-label="Permalink to "More""></a></h2><p>Check out the documentation for the <a href="https://vitepress.dev/reference/runtime-api#usedata" target="_blank" rel="noreferrer">full list of runtime APIs</a>.</p></div></div></main><footer class="VPDocFooter" data-v-fca15d40 data-v-ce8ba144><!--[--><!--]--><!----><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-ce8ba144><span class="visually-hidden" id="doc-footer-aria-label" data-v-ce8ba144>Pager</span><div class="pager" data-v-ce8ba144><a class="VPLink link pager-link prev" href="/markdown-examples.html" data-v-ce8ba144><!--[--><span class="desc" data-v-ce8ba144>Previous page</span><span class="title" data-v-ce8ba144>Markdown Examples</span><!--]--></a></div><div class="pager" data-v-ce8ba144><!----></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div> | ||
<script>window.__VP_HASH_MAP__=JSON.parse("{\"api-examples.md\":\"CHn0THWE\",\"index.md\":\"DgEX3J0P\",\"markdown-examples.md\":\"CTAsE_tL\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Charlie Blog\",\"description\":\"Welcome to Charlie's blog!\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"Home\",\"link\":\"/\"},{\"text\":\"Examples\",\"link\":\"/markdown-examples\"}],\"sidebar\":[{\"text\":\"Examples\",\"items\":[{\"text\":\"Markdown Examples\",\"link\":\"/markdown-examples\"},{\"text\":\"Runtime API Examples\",\"link\":\"/api-examples\"}]}],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/vuejs/vitepress\"}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.