import{u as h,c as p,j as s,t as i,k as e,a2 as r,a,o as k}from"./chunks/framework.BV61Qrc0.js";const d=r(`

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

`,6),o=s("h3",{id:"page-data",tabindex:"-1"},[a("Page Data "),s("a",{class:"header-anchor",href:"#page-data","aria-label":'Permalink to "Page Data"'},"​")],-1),E=s("h3",{id:"page-frontmatter",tabindex:"-1"},[a("Page Frontmatter "),s("a",{class:"header-anchor",href:"#page-frontmatter","aria-label":'Permalink to "Page Frontmatter"'},"​")],-1),g=s("h2",{id:"more",tabindex:"-1"},[a("More "),s("a",{class:"header-anchor",href:"#more","aria-label":'Permalink to "More"'},"​")],-1),c=s("p",null,[a("Check out the documentation for the "),s("a",{href:"https://vitepress.dev/reference/runtime-api#usedata",target:"_blank",rel:"noreferrer"},"full list of runtime APIs"),a(".")],-1),D=JSON.parse('{"title":"Runtime API Examples","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"api-ex.md","filePath":"api-ex.md"}'),m={name:"api-ex.md"},F=Object.assign(m,{setup(u){const{site:y,theme:t,page:n,frontmatter:l}=h();return(_,f)=>(k(),p("div",null,[d,s("pre",null,i(e(t)),1),o,s("pre",null,i(e(n)),1),E,s("pre",null,i(e(l)),1),g,c]))}});export{D as __pageData,F as default};