Runtime API Examples
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
{
"teekHome": false,
"private": {
"enabled": true,
"pages": [
{
"username": "ckgf",
"password": "ckgf"
}
]
},
"nav": [
{
"text": "主页",
"link": "/"
},
{
"text": "中期汇报",
"link": "/MIDDLE_TERM_report"
}
],
"socialLinks": [
{
"icon": "github",
"link": "https://github.com/2025DeveloperTeamInStaff"
}
],
"permalinks": {
"map": {
"login": "/login.html"
},
"inv": {
"/login.html": "login"
}
},
"docAnalysisInfo": {
"fileList": [
{
"filePath": "/home/runner/work/ARSGSS-Research/ARSGSS-Research/docs/MIDDLE_TERM_report.md",
"relativePath": "MIDDLE_TERM_report.md"
},
{
"filePath": "/home/runner/work/ARSGSS-Research/ARSGSS-Research/docs/api-examples.md",
"relativePath": "api-examples.md"
},
{
"filePath": "/home/runner/work/ARSGSS-Research/ARSGSS-Research/docs/login.md",
"relativePath": "login.md"
}
],
"totalFileWords": 1570,
"eachFileWords": [
{
"fileInfo": {
"filePath": "/home/runner/work/ARSGSS-Research/ARSGSS-Research/docs/MIDDLE_TERM_report.md",
"relativePath": "MIDDLE_TERM_report.md"
},
"wordCount": 1451,
"readingTime": "5.9m",
"frontmatter": {
"private": true
}
},
{
"fileInfo": {
"filePath": "/home/runner/work/ARSGSS-Research/ARSGSS-Research/docs/api-examples.md",
"relativePath": "api-examples.md"
},
"wordCount": 119,
"readingTime": "1m",
"frontmatter": {
"outline": "deep"
}
},
{
"fileInfo": {
"filePath": "/home/runner/work/ARSGSS-Research/ARSGSS-Research/docs/login.md",
"relativePath": "login.md"
},
"wordCount": 0,
"readingTime": "1m",
"frontmatter": {
"permalink": "/login",
"layout": "TkLoginPage",
"name": "登录",
"article": false
}
}
],
"lastCommitTime": "2026-03-15 01:14:29"
},
"catalogues": {
"arr": [],
"map": {},
"inv": {}
},
"posts": {
"allPosts": [
{
"url": "/MIDDLE_TERM_report.html",
"relativePath": "/MIDDLE_TERM_report.html",
"frontmatter": {
"private": true
},
"title": "**研究性学习:无线电卫星通信-地面站的搭建与测试**",
"date": "2026-03-14 17:15:11",
"capture": "组员构成: \n<script setup\nimport {\n VPTeamPage,\n VPTeamPageTitle,\n VPTeamMembers,\n VPTeamPageSection,\n} from 'vitepress/theme'\nimport { withBase } from 'vitepress'\nconst coreMembers = [\n { name: \"邱楷泉\", title: \"高二15\", avatar: 'img/avatars/qkq.jpg' }\n]\nconst partners = [\n { name: \"蒋昊宸\", title: \"高二"
},
{
"url": "/api-examples.html",
"relativePath": "/api-examples.html",
"frontmatter": {
"outline": "deep"
},
"title": "Runtime API Examples",
"date": "2026-03-14 17:15:11",
"capture": "Runtime API Examples\nThis page demonstrates usage of some of the runtime APIs provided by VitePress.\nThe 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:\n```md\n<script setup\nimport { useData } from 'vitepress'\ncon"
},
{
"url": "/",
"relativePath": "/",
"frontmatter": {
"layout": "home",
"hero": {
"name": "无线电卫星通信<br>地面站系统的搭建与测试研究",
"text": "",
"actions": [
{
"theme": "brand",
"text": "中期汇报",
"link": "/MIDDLE_TERM_report"
}
]
},
"features": [
{
"title": "易理解的系统构成",
"details": "通过模块化的连接,将复杂的无线电卫星地面站,简化为几个核心模块"
},
{
"title": "低成本的方案",
"details": "价格控制在650元内"
},
{
"title": "这里是title",
"details": "请输入文本请输入文本请输入文本"
}
]
},
"title": "",
"date": "2026-03-14 17:15:12",
"capture": ""
},
{
"url": "/login.html",
"relativePath": "/login.html",
"frontmatter": {
"permalink": "/login",
"layout": "TkLoginPage",
"name": "登录",
"article": false
},
"title": "html",
"date": "2026-03-14 17:15:12",
"capture": ""
}
],
"originPosts": [
{
"url": "/MIDDLE_TERM_report.html",
"relativePath": "/MIDDLE_TERM_report.html",
"frontmatter": {
"private": true
},
"title": "**研究性学习:无线电卫星通信-地面站的搭建与测试**",
"date": "2026-03-14 17:15:11",
"capture": "组员构成: \n<script setup\nimport {\n VPTeamPage,\n VPTeamPageTitle,\n VPTeamMembers,\n VPTeamPageSection,\n} from 'vitepress/theme'\nimport { withBase } from 'vitepress'\nconst coreMembers = [\n { name: \"邱楷泉\", title: \"高二15\", avatar: 'img/avatars/qkq.jpg' }\n]\nconst partners = [\n { name: \"蒋昊宸\", title: \"高二"
},
{
"url": "/api-examples.html",
"relativePath": "/api-examples.html",
"frontmatter": {
"outline": "deep"
},
"title": "Runtime API Examples",
"date": "2026-03-14 17:15:11",
"capture": "Runtime API Examples\nThis page demonstrates usage of some of the runtime APIs provided by VitePress.\nThe 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:\n```md\n<script setup\nimport { useData } from 'vitepress'\ncon"
}
],
"sortPostsByDateAndSticky": [
{
"url": "/MIDDLE_TERM_report.html",
"relativePath": "/MIDDLE_TERM_report.html",
"frontmatter": {
"private": true
},
"title": "**研究性学习:无线电卫星通信-地面站的搭建与测试**",
"date": "2026-03-14 17:15:11",
"capture": "组员构成: \n<script setup\nimport {\n VPTeamPage,\n VPTeamPageTitle,\n VPTeamMembers,\n VPTeamPageSection,\n} from 'vitepress/theme'\nimport { withBase } from 'vitepress'\nconst coreMembers = [\n { name: \"邱楷泉\", title: \"高二15\", avatar: 'img/avatars/qkq.jpg' }\n]\nconst partners = [\n { name: \"蒋昊宸\", title: \"高二"
},
{
"url": "/api-examples.html",
"relativePath": "/api-examples.html",
"frontmatter": {
"outline": "deep"
},
"title": "Runtime API Examples",
"date": "2026-03-14 17:15:11",
"capture": "Runtime API Examples\nThis page demonstrates usage of some of the runtime APIs provided by VitePress.\nThe 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:\n```md\n<script setup\nimport { useData } from 'vitepress'\ncon"
}
],
"sortPostsByDate": [
{
"url": "/MIDDLE_TERM_report.html",
"relativePath": "/MIDDLE_TERM_report.html",
"frontmatter": {
"private": true
},
"title": "**研究性学习:无线电卫星通信-地面站的搭建与测试**",
"date": "2026-03-14 17:15:11",
"capture": "组员构成: \n<script setup\nimport {\n VPTeamPage,\n VPTeamPageTitle,\n VPTeamMembers,\n VPTeamPageSection,\n} from 'vitepress/theme'\nimport { withBase } from 'vitepress'\nconst coreMembers = [\n { name: \"邱楷泉\", title: \"高二15\", avatar: 'img/avatars/qkq.jpg' }\n]\nconst partners = [\n { name: \"蒋昊宸\", title: \"高二"
},
{
"url": "/api-examples.html",
"relativePath": "/api-examples.html",
"frontmatter": {
"outline": "deep"
},
"title": "Runtime API Examples",
"date": "2026-03-14 17:15:11",
"capture": "Runtime API Examples\nThis page demonstrates usage of some of the runtime APIs provided by VitePress.\nThe 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:\n```md\n<script setup\nimport { useData } from 'vitepress'\ncon"
}
],
"groupPostsByYear": {
"2026 ": [
{
"url": "/MIDDLE_TERM_report.html",
"relativePath": "/MIDDLE_TERM_report.html",
"frontmatter": {
"private": true
},
"title": "**研究性学习:无线电卫星通信-地面站的搭建与测试**",
"date": "2026-03-14 17:15:11",
"capture": "组员构成: \n<script setup\nimport {\n VPTeamPage,\n VPTeamPageTitle,\n VPTeamMembers,\n VPTeamPageSection,\n} from 'vitepress/theme'\nimport { withBase } from 'vitepress'\nconst coreMembers = [\n { name: \"邱楷泉\", title: \"高二15\", avatar: 'img/avatars/qkq.jpg' }\n]\nconst partners = [\n { name: \"蒋昊宸\", title: \"高二"
},
{
"url": "/api-examples.html",
"relativePath": "/api-examples.html",
"frontmatter": {
"outline": "deep"
},
"title": "Runtime API Examples",
"date": "2026-03-14 17:15:11",
"capture": "Runtime API Examples\nThis page demonstrates usage of some of the runtime APIs provided by VitePress.\nThe 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:\n```md\n<script setup\nimport { useData } from 'vitepress'\ncon"
}
]
},
"groupPostsByYearMonth": {
"2026 ": {
"03": [
{
"url": "/MIDDLE_TERM_report.html",
"relativePath": "/MIDDLE_TERM_report.html",
"frontmatter": {
"private": true
},
"title": "**研究性学习:无线电卫星通信-地面站的搭建与测试**",
"date": "2026-03-14 17:15:11",
"capture": "组员构成: \n<script setup\nimport {\n VPTeamPage,\n VPTeamPageTitle,\n VPTeamMembers,\n VPTeamPageSection,\n} from 'vitepress/theme'\nimport { withBase } from 'vitepress'\nconst coreMembers = [\n { name: \"邱楷泉\", title: \"高二15\", avatar: 'img/avatars/qkq.jpg' }\n]\nconst partners = [\n { name: \"蒋昊宸\", title: \"高二"
},
{
"url": "/api-examples.html",
"relativePath": "/api-examples.html",
"frontmatter": {
"outline": "deep"
},
"title": "Runtime API Examples",
"date": "2026-03-14 17:15:11",
"capture": "Runtime API Examples\nThis page demonstrates usage of some of the runtime APIs provided by VitePress.\nThe 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:\n```md\n<script setup\nimport { useData } from 'vitepress'\ncon"
}
]
}
},
"groupPosts": {
"categories": {},
"tags": {}
},
"groupCards": {
"categories": [],
"tags": []
}
}
}Page Data
{
"title": "Runtime API Examples",
"description": "",
"frontmatter": {
"outline": "deep"
},
"headers": [],
"relativePath": "api-examples.md",
"filePath": "api-examples.md"
}Page Frontmatter
{
"outline": "deep"
}More
Check out the documentation for the full list of runtime APIs.