リソース
This page demonstrates usage of some of the runtime APIs provided by VitePress.
The main useData()
API can be used to access site, theme, and page data for the current page. It works in both .md
and .vue
files:
md
<script setup>
import { useData } from 'vitepress'
const { theme, page, frontmatter } = useData()
</script>
## Results
### Theme Data
<pre>{{ theme }}</pre>
### Page Data
<pre>{{ page }}</pre>
### Page Frontmatter
<pre>{{ frontmatter }}</pre>
Results
Theme Data
{ "footer": { "copyright": "Copyright © 2024 CloseX" }, "nav": [ { "text": "ガイド", "link": "/ja/guidelines" }, { "text": "リソース", "link": "/ja/resources" }, { "text": "もっと", "items": [ { "text": "プライバシーポリシー", "link": "/ja/privacy" }, { "text": "リリースノート", "link": "/ja/release-note" }, { "text": "ブログ", "link": "https://blog.closex.org" }, { "text": "CloseX", "link": "https://closex.org" }, { "text": "お問い合わせ", "link": "mailto:fusion-x-one@outlook.com" } ] } ], "search": { "provider": "local", "options": { "locales": { "zh": { "translations": { "button": { "buttonText": "搜索文档", "buttonAriaLabel": "搜索文档" }, "modal": { "noResultsText": "无法找到相关结果", "resetButtonTitle": "清除查询条件", "footer": { "selectText": "选择", "navigateText": "切换", "closeText": "关闭" } } } }, "ja": { "translations": { "button": { "buttonText": "文書の検索", "buttonAriaLabel": "文書の検索" }, "modal": { "noResultsText": "関連する結果が見つかりませんでした", "resetButtonTitle": "クエリ条件をクリアする", "footer": { "selectText": "選ぶ", "navigateText": "スイッチ", "closeText": "閉鎖" } } } } } } }, "logo": "/img/logo.webp", "sidebar": [ { "text": "プラットフォーム", "collapsed": true, "items": [ { "text": "デスクトップ向け設計", "link": "/ja/guidelines/platforms/designing-for-desktop" }, { "text": "モバイル向け設計", "link": "/ja/guidelines/platforms/designing-for-mobile" }, { "text": "タブレット向け設計", "link": "/ja/guidelines/platforms/designing-for-tablet" }, { "text": "Safari向け設計", "link": "/ja/guidelines/platforms/designing-for-safari" }, { "text": "Chrome向け設計", "link": "/ja/guidelines/platforms/designing-for-chrome" }, { "text": "大規模言語モデル向けの設計", "link": "/ja/guidelines/platforms/designing-for-llms" } ] }, { "text": "基本要素", "collapsed": true, "items": [ { "text": "ブランド", "link": "/ja/guidelines/foundations/branding" }, { "text": "レイアウト", "link": "/ja/guidelines/foundations/layout" }, { "text": "タイポグラフィー", "link": "/ja/guidelines/foundations/typography" }, { "text": "画像", "link": "/ja/guidelines/foundations/image" }, { "text": "色彩", "link": "/ja/guidelines/foundations/color" }, { "text": "ダークモード", "link": "/ja/guidelines/foundations/dark-mode" } ] }, { "text": "コンポーネント", "collapsed": true, "items": [ { "text": "コンテンツ", "link": "/ja/guidelines/components/content" }, { "text": "データのグラフ化", "link": "/ja/guidelines/components/charting-data" }, { "text": "ローディング", "link": "/ja/guidelines/components/loading" }, { "text": "入力", "link": "/ja/guidelines/components/input" }, { "text": "検索", "link": "/ja/guidelines/components/search" }, { "text": "メニュー", "link": "/ja/guidelines/components/menu" } ] }, { "text": "著作物", "collapsed": true, "items": [ { "text": "Markdown", "link": "/ja/guidelines/writing/markdown" }, { "text": "Frontmatter", "link": "/ja/guidelines/writing/frontmatter" }, { "text": "Markdownでのコード使用", "link": "/ja/guidelines/writing/using-code-in-markdown" }, { "text": "アセット管理", "link": "/ja/guidelines/writing/asset-handling" }, { "text": "ボイス", "link": "/ja/guidelines/writing/voice" }, { "text": "国際化", "link": "/ja/guidelines/writing/internationalization" } ] }, { "text": "パフォーマンス", "collapsed": true, "items": [ { "text": "デプロイ", "link": "/ja/guidelines/performance/deploy" }, { "text": "スピードテスト", "link": "/ja/guidelines/performance/speedtest" }, { "text": "SEO", "link": "/ja/guidelines/performance/seo" }, { "text": "ユーザーエクスペリエンス", "link": "/ja/guidelines/performance/user-experience" } ] }, { "text": "カスタマイズ", "collapsed": true, "items": [ { "text": "プロファイル", "link": "/ja/guidelines/customization/profile" }, { "text": "CSS", "link": "/ja/guidelines/customization/css" }, { "text": "Javascript", "link": "/ja/guidelines/customization/javascript" }, { "text": "フレンドリンク", "link": "/ja/guidelines/customization/friendlink" }, { "text": "フッター", "link": "/ja/guidelines/customization/footer" }, { "text": "ナビゲーションバー", "link": "/ja/guidelines/customization/navigation-bar" } ] } ], "outline": { "label": "ページナビゲーション" }, "docFooter": { "prev": "前のページ", "next": "次のページ" }, "lastUpdated": { "text": "最終更新", "formatOptions": { "dateStyle": "short", "timeStyle": "medium" } }, "langMenuLabel": "言語", "returnToTopLabel": "トップに戻る", "sidebarMenuLabel": "メニュー", "darkModeSwitchLabel": "テーマ", "lightModeSwitchTitle": "ライトモードに切り替え", "darkModeSwitchTitle": "ダークモードに切り替え" }
Page Data
{ "title": "リソース", "description": "", "frontmatter": { "outline": false, "sidebar": false, "aside": false }, "headers": [], "relativePath": "ja/resources.md", "filePath": "ja/resources.md" }
Page Frontmatter
{ "outline": false, "sidebar": false, "aside": false }
More
Check out the documentation for the full list of runtime APIs.