Skip to content

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

{
  "codeBlock": {
    "disabled": false,
    "collapseHeight": 700
  },
  "page": {
    "pageSize": 16
  },
  "post": {
    "coverImgMode": "full",
    "showMore": true
  },
  "articleAnalyze": {
    "imageViewer": {
      "hideOnClickModal": true
    },
    "showIcon": true,
    "dateFormat": "yyyy-MM-dd",
    "showInfo": true,
    "showAuthor": true,
    "showCreateDate": true,
    "showUpdateDate": true,
    "showCategory": true,
    "showTag": true,
    "teleport": {
      "selector": "h1",
      "position": "after",
      "className": "h1-bottom-info"
    }
  },
  "comment": {
    "provider": "twikoo",
    "options": {
      "envId": "https://twikoo.onedayxyy.cn/",
      "version": "1.6.41"
    }
  },
  "notice": {
    "enabled": true,
    "title": "公告",
    "initOpen": true,
    "duration": 3000,
    "mobileMinify": false,
    "reopen": true,
    "useStorage": false,
    "twinkle": true,
    "position": "center"
  },
  "siteAnalytics": [
    {
      "provider": "google",
      "options": {
        "id": "G-YDTSLB09YH"
      }
    }
  ],
  "appreciation": {
    "position": "doc-after",
    "options": {
      "icon": "weChatPay",
      "expandTitle": "打赏支持",
      "collapseTitle": "下次一定",
      "content": "<img src='/img/alipay/1.png'><img src='/img/alipay/2.png'>",
      "expand": false
    }
  },
  "articleShare": {
    "enabled": true
  },
  "category": {
    "enabled": true,
    "limit": 8,
    "autoPage": false,
    "pageSpeed": 4000
  },
  "tag": {
    "enabled": true,
    "limit": 21,
    "autoPage": false,
    "pageSpeed": 4000
  },
  "topArticle": {
    "enabled": true,
    "limit": 5,
    "autoPage": false,
    "pageSpeed": 4000,
    "dateFormat": "yyyy-MM-dd hh:mm:ss"
  },
  "docAnalysis": {
    "createTime": "2021-10-19",
    "statistics": {
      "provider": "busuanzi"
    },
    "wordCount": true,
    "readingTime": true,
    "appendInfo": [
      {
        "key": "index",
        "label": "序号",
        "value": "One"
      }
    ]
  },
  "riskLink": {
    "enabled": true,
    "whitelist": [
      "https://onedayxyy.cn/",
      "https://vp.teek.top/",
      "https://teek.seasir.top/",
      {},
      {}
    ],
    "blacklist": []
  },
  "logo": "/favicon.ico",
  "darkModeSwitchLabel": "主题",
  "sidebarMenuLabel": "菜单",
  "returnToTopLabel": "返回顶部",
  "lastUpdatedText": "上次更新时间",
  "outline": {
    "level": [
      2,
      4
    ],
    "label": "本页导航"
  },
  "docFooter": {
    "prev": "上一页",
    "next": "下一页"
  },
  "nav": [
    {
      "text": "🏡首页",
      "link": "/"
    },
    {
      "text": "🗃️笔记",
      "items": [
        {
          "text": "运维",
          "items": [
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/linux.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>Linux</span>\n                </div>\n                ",
              "link": "/linux",
              "activeMatch": "01.指南/01.运维"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/nginx.png\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>Nginx</span>\n                </div>\n                ",
              "link": "/nginx"
            }
          ],
          "activeMatch": "01.指南"
        },
        {
          "text": "前端",
          "items": [
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/html.png\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>Html</span>\n                </div>\n                ",
              "link": "/html"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/css.png\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>Css</span>\n                </div>\n                ",
              "link": "/css"
            }
          ]
        },
        {
          "text": "编程",
          "items": [
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/python.png\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>Python</span>\n                </div>\n                ",
              "link": "/python"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/go.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>Go</span>\n                </div>\n                ",
              "link": "/go",
              "activeMatch": "go/01.go-resty"
            }
          ],
          "activeMatch": "go"
        },
        {
          "text": "专题",
          "items": [
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/博客.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>博客搭建</span>\n                </div>\n                ",
              "link": "/blog"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/前端demo.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>前端demo</span>\n                </div>\n                ",
              "link": "/qianduan-demo"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/Git.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>Git</span>\n                </div>\n                ",
              "link": "/git"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/面试.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>面试</span>\n                </div>\n                ",
              "link": "/mianshi"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/NAS.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>NAS</span>\n                </div>\n                ",
              "link": "/NAS"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/脚本.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>脚本</span>\n                </div>\n                ",
              "link": "/jiaoben"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/工具.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>工具</span>\n                </div>\n                ",
              "link": "/tools"
            }
          ]
        },
        {
          "text": "开源项目",
          "items": [
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/teek.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>Teek-one</span>\n                </div>\n                ",
              "link": "/teek"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/Typora.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>Typora-one</span>\n                </div>\n                ",
              "link": "/typora-theme-one"
            }
          ]
        }
      ]
    },
    {
      "text": "🏓生活",
      "items": [
        {
          "text": "娱乐",
          "items": [
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/相册.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>相册</span>\n                </div>\n                ",
              "link": "https://photo.onedayxyy.cn/"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/电影.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>电影</span>\n                </div>\n                ",
              "link": "/movie"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/音乐.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>音乐</span>\n                </div>\n                ",
              "link": "/music"
            }
          ]
        },
        {
          "text": "小屋",
          "items": [
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/精神小屋.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>精神小屋</span>\n                </div>\n                ",
              "link": "/love"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/时间管理.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>时间管理</span>\n                </div>\n                ",
              "link": "/time-plan"
            },
            {
              "text": "\n                <div style=\"display: flex; align-items: center; gap: 4px;\">\n                  <img src=\"/img/nav/文案.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n                  <span>文案</span>\n                </div>\n                ",
              "link": "/wenan"
            }
          ]
        }
      ]
    },
    {
      "text": "👏索引",
      "items": [
        {
          "text": "📃分类页",
          "link": "/categories"
        },
        {
          "text": "🔖标签页",
          "link": "/tags"
        },
        {
          "text": "\n            <div style=\"display: flex; align-items: center; gap: 4px;\">\n              <img src=\"/img/nav/归档.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n              <span>归档页</span>\n            </div>\n            ",
          "link": "/archives"
        },
        {
          "text": "\n            <div style=\"display: flex; align-items: center; gap: 4px;\">\n              <img src=\"/img/nav/清单.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n              <span>清单页</span>\n            </div>\n            ",
          "link": "/articleOverview"
        },
        {
          "text": "\n            <div style=\"display: flex; align-items: center; gap: 4px;\">\n              <img src=\"/img/nav/登录.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n              <span>登录页</span>\n            </div>\n            ",
          "link": "/login"
        },
        {
          "text": "\n            <div style=\"display: flex; align-items: center; gap: 4px;\">\n              <img src=\"/img/nav/风险提示.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n              <span>风险链接提示页</span>\n            </div>\n            ",
          "link": "/risk-link?target=https://onedayxyy.cn/"
        }
      ]
    },
    {
      "text": "🍷关于",
      "items": [
        {
          "text": "👋关于我",
          "link": "/about-me"
        },
        {
          "text": "🎉关于本站",
          "link": "/about-website"
        },
        {
          "text": "🌐网站导航",
          "link": "/websites"
        },
        {
          "text": "👂留言区",
          "link": "/liuyanqu"
        },
        {
          "text": "💡思考",
          "link": "/thinking"
        },
        {
          "text": "\n            <div style=\"display: flex; align-items: center; gap: 4px;\">\n              <img src=\"/img/nav/时间轴.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n              <span>时间轴</span>\n            </div>\n            ",
          "link": "https://onedayxyy.cn/time-line/"
        },
        {
          "text": "\n            <div style=\"display: flex; align-items: center; gap: 4px;\">\n              <img src=\"/img/nav/网站统计.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n              <span>网站统计</span>\n            </div>\n            ",
          "link": "https://umami.onedayxyy.cn/share/DzS4g85V8JkxsNRk/onedayxyy.cn"
        },
        {
          "text": "\n            <div style=\"display: flex; align-items: center; gap: 4px;\">\n              <img src=\"/img/nav/站点监控.svg\" alt=\"\" style=\"width: 16px; height: 16px;\">\n              <span>站点监控</span>\n            </div>\n            ",
          "link": "https://status.onedayxyy.cn/status/monitor"
        }
      ]
    }
  ],
  "socialLinks": [
    {
      "icon": {
        "svg": "<svg t=\"1743875298298\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2388\" width=\"200\" height=\"200\"><path d=\"M512 1024C229.2224 1024 0 794.7776 0 512S229.2224 0 512 0s512 229.2224 512 512-229.2224 512-512 512z m259.1488-568.8832H480.4096a25.2928 25.2928 0 0 0-25.2928 25.2928l-0.0256 63.2064c0 13.952 11.3152 25.2928 25.2672 25.2928h177.024c13.9776 0 25.2928 11.3152 25.2928 25.2672v12.6464a75.8528 75.8528 0 0 1-75.8528 75.8528H366.592a25.2928 25.2928 0 0 1-25.2672-25.2928v-240.1792a75.8528 75.8528 0 0 1 75.8272-75.8528h353.9456a25.2928 25.2928 0 0 0 25.2672-25.2928l0.0768-63.2064a25.2928 25.2928 0 0 0-25.2672-25.2928H417.152a189.6192 189.6192 0 0 0-189.6192 189.6448v353.9456c0 13.9776 11.3152 25.2928 25.2928 25.2928h372.9408a170.6496 170.6496 0 0 0 170.6496-170.6496v-145.408a25.2928 25.2928 0 0 0-25.2928-25.2672z\" fill=\"#C71D23\" p-id=\"2389\"></path></svg>"
      },
      "link": "https://gitee.com/onlyonexl/vitepress-theme-teek-one-public"
    },
    {
      "icon": {
        "svg": "<svg t=\"1743875620187\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"16697\" width=\"200\" height=\"200\"><path d=\"M512 0A512 512 0 1 1 0 512 512 512 0 0 1 512 0z\" fill=\"#ff485f\" p-id=\"16698\" data-spm-anchor-id=\"a313x.search_index.0.i13.70183a81yTylfI\" class=\"selected\"></path><path d=\"M726.980923 295.384615H280.123077A63.606154 63.606154 0 0 0 216.615385 358.892308v295.187692a63.606154 63.606154 0 0 0 63.507692 63.507692h446.857846a63.606154 63.606154 0 0 0 63.507692-63.507692v-295.187692A63.606154 63.606154 0 0 0 726.980923 295.384615z m25.403077 358.715077a25.481846 25.481846 0 0 1-25.403077 25.403077H280.123077a25.481846 25.481846 0 0 1-25.403077-25.403077v-295.187692a25.481846 25.481846 0 0 1 25.403077-25.403077h446.857846a25.481846 25.481846 0 0 1 25.403077 25.403077z\" fill=\"#FFFFFF\" p-id=\"16699\"></path><path d=\"M693.720615 396.307692l-190.148923 119.965539-190.148923-119.965539a19.062154 19.062154 0 0 0-20.322461 32.236308l200.073846 126.247385a19.062154 19.062154 0 0 0 10.161231 2.934153h0.630153a19.062154 19.062154 0 0 0 10.161231-2.934153l200.073846-126.247385a19.101538 19.101538 0 1 0-20.48-32.236308z\" fill=\"#FFFFFF\" p-id=\"16700\"></path></svg>"
      },
      "link": "mailto:[email protected]"
    }
  ],
  "search": {
    "provider": "local"
  },
  "sidebar": {
    "/": [
      {
        "text": "api-examples",
        "collapsed": true,
        "link": "/api-examples"
      },
      {
        "text": "markdown-examples",
        "collapsed": true,
        "link": "/markdown-examples"
      }
    ],
    "/01.指南/": [
      {
        "collapsed": true,
        "items": [
          {
            "text": "运维",
            "collapsed": true,
            "link": "/01.指南/01.运维"
          }
        ]
      }
    ],
    "/go/": [
      {
        "collapsed": true,
        "items": [
          {
            "text": "go-resty",
            "collapsed": true,
            "link": "/go/01.go-resty"
          }
        ]
      }
    ]
  },
  "permalinks": {
    "map": {
      "markdown-examples": "/pages/5e857b",
      "01.指南/01.运维": "/linux",
      "go/01.go-resty": "/go"
    },
    "inv": {
      "/pages/5e857b": "markdown-examples",
      "/linux": "01.指南/01.运维",
      "/go": "go/01.go-resty"
    }
  },
  "docAnalysisInfo": {
    "fileList": [
      {
        "filePath": "/home/runner/work/moweilong.github.io/moweilong.github.io/docs/01.指南/01.运维.md",
        "relativePath": "01.指南/01.运维.md"
      },
      {
        "filePath": "/home/runner/work/moweilong.github.io/moweilong.github.io/docs/api-examples.md",
        "relativePath": "api-examples.md"
      },
      {
        "filePath": "/home/runner/work/moweilong.github.io/moweilong.github.io/docs/go/01.go-resty.md",
        "relativePath": "go/01.go-resty.md"
      },
      {
        "filePath": "/home/runner/work/moweilong.github.io/moweilong.github.io/docs/markdown-examples.md",
        "relativePath": "markdown-examples.md"
      }
    ],
    "totalFileWords": 257,
    "eachFileWords": [
      {
        "fileInfo": {
          "filePath": "/home/runner/work/moweilong.github.io/moweilong.github.io/docs/01.指南/01.运维.md",
          "relativePath": "01.指南/01.运维.md"
        },
        "wordCount": 2,
        "readingTime": "1m",
        "frontmatter": {
          "title": "运维",
          "date": {},
          "permalink": "/linux",
          "categories": [
            "运维"
          ],
          "tags": [
            "运维"
          ],
          "coverImg": "/img/bg/1.webp"
        }
      },
      {
        "fileInfo": {
          "filePath": "/home/runner/work/moweilong.github.io/moweilong.github.io/docs/api-examples.md",
          "relativePath": "api-examples.md"
        },
        "wordCount": 119,
        "readingTime": "1m",
        "frontmatter": {
          "outline": "deep"
        }
      },
      {
        "fileInfo": {
          "filePath": "/home/runner/work/moweilong.github.io/moweilong.github.io/docs/go/01.go-resty.md",
          "relativePath": "go/01.go-resty.md"
        },
        "wordCount": 3,
        "readingTime": "1m",
        "frontmatter": {
          "title": "go-resty",
          "permalink": "/go",
          "categories": [
            "go"
          ],
          "tags": [
            "go-resty"
          ],
          "coverImg": "/img/bg/1.webp"
        }
      },
      {
        "fileInfo": {
          "filePath": "/home/runner/work/moweilong.github.io/moweilong.github.io/docs/markdown-examples.md",
          "relativePath": "markdown-examples.md"
        },
        "wordCount": 133,
        "readingTime": "1m",
        "frontmatter": {
          "date": {},
          "title": "markdown-examples",
          "permalink": "/pages/5e857b",
          "categories": [
            null
          ],
          "coverImg": "/img/bg/9.webp"
        }
      }
    ],
    "lastCommitTime": "2025-07-09 20:56:07"
  },
  "catalogues": {
    "arr": [],
    "map": {},
    "inv": {}
  },
  "posts": {
    "allPosts": [
      {
        "url": "/01.指南/01.运维",
        "frontmatter": {
          "title": "运维",
          "date": "2024-12-19 18:50:31",
          "permalink": "/linux",
          "categories": [
            "运维"
          ],
          "tags": [
            "运维"
          ],
          "coverImg": "/img/bg/1.webp"
        },
        "title": "运维",
        "date": "2024-12-19 18:50:31",
        "capture": "ops\nso ?"
      },
      {
        "url": "/api-examples",
        "frontmatter": {
          "outline": "deep"
        },
        "title": "Runtime API Examples",
        "date": "2025-07-09 12:56:29",
        "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&lt;script setup\nimport { useData } from 'vitepress'\ncon"
      },
      {
        "url": "/go/01.go-resty",
        "frontmatter": {
          "title": "go-resty",
          "permalink": "/go",
          "categories": [
            "go"
          ],
          "tags": [
            "go-resty"
          ],
          "coverImg": "/img/bg/1.webp"
        },
        "title": "go-resty",
        "date": "2025-07-09 12:56:29",
        "capture": "go-resty\nso ?"
      },
      {
        "url": "/",
        "frontmatter": {
          "layout": "home",
          "hero": {
            "name": "老莫想吃鱼了",
            "text": "温故而知新,忘记了,就回来看看!",
            "tagline": "My great project tagline",
            "actions": [
              {
                "theme": "brand",
                "text": "Markdown Examples",
                "link": "/markdown-examples"
              },
              {
                "theme": "alt",
                "text": "API Examples",
                "link": "/api-examples"
              }
            ]
          },
          "features": [
            {
              "title": "Feature A",
              "details": "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
            },
            {
              "title": "Feature B",
              "details": "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
            },
            {
              "title": "Feature C",
              "details": "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
            }
          ]
        },
        "title": "",
        "date": "2025-07-09 12:56:29",
        "capture": ""
      },
      {
        "url": "/markdown-examples",
        "frontmatter": {
          "date": "2025-06-09 00:28:05",
          "title": "markdown-examples",
          "permalink": "/pages/5e857b",
          "categories": [
            null
          ],
          "coverImg": "/img/bg/9.webp"
        },
        "title": "markdown-examples",
        "date": "2025-06-09 00:28:05",
        "capture": "This page demonstrates some of the built-in markdown extensions provided by VitePress.\n Syntax Highlighting\nVitePress provides Syntax Highlighting powered by Shiki, with additional features like line-highlighting:\nInput\n````md\n```js{4}\nexport default {\n  data () {\n    return {\n      msg: 'Highlighte"
      }
    ],
    "originPosts": [
      {
        "url": "/01.指南/01.运维",
        "frontmatter": {
          "title": "运维",
          "date": "2024-12-19 18:50:31",
          "permalink": "/linux",
          "categories": [
            "运维"
          ],
          "tags": [
            "运维"
          ],
          "coverImg": "/img/bg/1.webp"
        },
        "title": "运维",
        "date": "2024-12-19 18:50:31",
        "capture": "ops\nso ?"
      },
      {
        "url": "/api-examples",
        "frontmatter": {
          "outline": "deep"
        },
        "title": "Runtime API Examples",
        "date": "2025-07-09 12:56:29",
        "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&lt;script setup\nimport { useData } from 'vitepress'\ncon"
      },
      {
        "url": "/go/01.go-resty",
        "frontmatter": {
          "title": "go-resty",
          "permalink": "/go",
          "categories": [
            "go"
          ],
          "tags": [
            "go-resty"
          ],
          "coverImg": "/img/bg/1.webp"
        },
        "title": "go-resty",
        "date": "2025-07-09 12:56:29",
        "capture": "go-resty\nso ?"
      },
      {
        "url": "/markdown-examples",
        "frontmatter": {
          "date": "2025-06-09 00:28:05",
          "title": "markdown-examples",
          "permalink": "/pages/5e857b",
          "categories": [
            null
          ],
          "coverImg": "/img/bg/9.webp"
        },
        "title": "markdown-examples",
        "date": "2025-06-09 00:28:05",
        "capture": "This page demonstrates some of the built-in markdown extensions provided by VitePress.\n Syntax Highlighting\nVitePress provides Syntax Highlighting powered by Shiki, with additional features like line-highlighting:\nInput\n````md\n```js{4}\nexport default {\n  data () {\n    return {\n      msg: 'Highlighte"
      }
    ],
    "sortPostsByDateAndSticky": [
      {
        "url": "/api-examples",
        "frontmatter": {
          "outline": "deep"
        },
        "title": "Runtime API Examples",
        "date": "2025-07-09 12:56:29",
        "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&lt;script setup\nimport { useData } from 'vitepress'\ncon"
      },
      {
        "url": "/go/01.go-resty",
        "frontmatter": {
          "title": "go-resty",
          "permalink": "/go",
          "categories": [
            "go"
          ],
          "tags": [
            "go-resty"
          ],
          "coverImg": "/img/bg/1.webp"
        },
        "title": "go-resty",
        "date": "2025-07-09 12:56:29",
        "capture": "go-resty\nso ?"
      },
      {
        "url": "/markdown-examples",
        "frontmatter": {
          "date": "2025-06-09 00:28:05",
          "title": "markdown-examples",
          "permalink": "/pages/5e857b",
          "categories": [
            null
          ],
          "coverImg": "/img/bg/9.webp"
        },
        "title": "markdown-examples",
        "date": "2025-06-09 00:28:05",
        "capture": "This page demonstrates some of the built-in markdown extensions provided by VitePress.\n Syntax Highlighting\nVitePress provides Syntax Highlighting powered by Shiki, with additional features like line-highlighting:\nInput\n````md\n```js{4}\nexport default {\n  data () {\n    return {\n      msg: 'Highlighte"
      },
      {
        "url": "/01.指南/01.运维",
        "frontmatter": {
          "title": "运维",
          "date": "2024-12-19 18:50:31",
          "permalink": "/linux",
          "categories": [
            "运维"
          ],
          "tags": [
            "运维"
          ],
          "coverImg": "/img/bg/1.webp"
        },
        "title": "运维",
        "date": "2024-12-19 18:50:31",
        "capture": "ops\nso ?"
      }
    ],
    "sortPostsByDate": [
      {
        "url": "/api-examples",
        "frontmatter": {
          "outline": "deep"
        },
        "title": "Runtime API Examples",
        "date": "2025-07-09 12:56:29",
        "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&lt;script setup\nimport { useData } from 'vitepress'\ncon"
      },
      {
        "url": "/go/01.go-resty",
        "frontmatter": {
          "title": "go-resty",
          "permalink": "/go",
          "categories": [
            "go"
          ],
          "tags": [
            "go-resty"
          ],
          "coverImg": "/img/bg/1.webp"
        },
        "title": "go-resty",
        "date": "2025-07-09 12:56:29",
        "capture": "go-resty\nso ?"
      },
      {
        "url": "/markdown-examples",
        "frontmatter": {
          "date": "2025-06-09 00:28:05",
          "title": "markdown-examples",
          "permalink": "/pages/5e857b",
          "categories": [
            null
          ],
          "coverImg": "/img/bg/9.webp"
        },
        "title": "markdown-examples",
        "date": "2025-06-09 00:28:05",
        "capture": "This page demonstrates some of the built-in markdown extensions provided by VitePress.\n Syntax Highlighting\nVitePress provides Syntax Highlighting powered by Shiki, with additional features like line-highlighting:\nInput\n````md\n```js{4}\nexport default {\n  data () {\n    return {\n      msg: 'Highlighte"
      },
      {
        "url": "/01.指南/01.运维",
        "frontmatter": {
          "title": "运维",
          "date": "2024-12-19 18:50:31",
          "permalink": "/linux",
          "categories": [
            "运维"
          ],
          "tags": [
            "运维"
          ],
          "coverImg": "/img/bg/1.webp"
        },
        "title": "运维",
        "date": "2024-12-19 18:50:31",
        "capture": "ops\nso ?"
      }
    ],
    "groupPostsByYear": {
      "2025 ": [
        {
          "url": "/api-examples",
          "frontmatter": {
            "outline": "deep"
          },
          "title": "Runtime API Examples",
          "date": "2025-07-09 12:56:29",
          "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&lt;script setup\nimport { useData } from 'vitepress'\ncon"
        },
        {
          "url": "/go/01.go-resty",
          "frontmatter": {
            "title": "go-resty",
            "permalink": "/go",
            "categories": [
              "go"
            ],
            "tags": [
              "go-resty"
            ],
            "coverImg": "/img/bg/1.webp"
          },
          "title": "go-resty",
          "date": "2025-07-09 12:56:29",
          "capture": "go-resty\nso ?"
        },
        {
          "url": "/markdown-examples",
          "frontmatter": {
            "date": "2025-06-09 00:28:05",
            "title": "markdown-examples",
            "permalink": "/pages/5e857b",
            "categories": [
              null
            ],
            "coverImg": "/img/bg/9.webp"
          },
          "title": "markdown-examples",
          "date": "2025-06-09 00:28:05",
          "capture": "This page demonstrates some of the built-in markdown extensions provided by VitePress.\n Syntax Highlighting\nVitePress provides Syntax Highlighting powered by Shiki, with additional features like line-highlighting:\nInput\n````md\n```js{4}\nexport default {\n  data () {\n    return {\n      msg: 'Highlighte"
        }
      ],
      "2024 ": [
        {
          "url": "/01.指南/01.运维",
          "frontmatter": {
            "title": "运维",
            "date": "2024-12-19 18:50:31",
            "permalink": "/linux",
            "categories": [
              "运维"
            ],
            "tags": [
              "运维"
            ],
            "coverImg": "/img/bg/1.webp"
          },
          "title": "运维",
          "date": "2024-12-19 18:50:31",
          "capture": "ops\nso ?"
        }
      ]
    },
    "groupPostsByYearMonth": {
      "2025 ": {
        "07": [
          {
            "url": "/api-examples",
            "frontmatter": {
              "outline": "deep"
            },
            "title": "Runtime API Examples",
            "date": "2025-07-09 12:56:29",
            "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&lt;script setup\nimport { useData } from 'vitepress'\ncon"
          },
          {
            "url": "/go/01.go-resty",
            "frontmatter": {
              "title": "go-resty",
              "permalink": "/go",
              "categories": [
                "go"
              ],
              "tags": [
                "go-resty"
              ],
              "coverImg": "/img/bg/1.webp"
            },
            "title": "go-resty",
            "date": "2025-07-09 12:56:29",
            "capture": "go-resty\nso ?"
          }
        ],
        "06": [
          {
            "url": "/markdown-examples",
            "frontmatter": {
              "date": "2025-06-09 00:28:05",
              "title": "markdown-examples",
              "permalink": "/pages/5e857b",
              "categories": [
                null
              ],
              "coverImg": "/img/bg/9.webp"
            },
            "title": "markdown-examples",
            "date": "2025-06-09 00:28:05",
            "capture": "This page demonstrates some of the built-in markdown extensions provided by VitePress.\n Syntax Highlighting\nVitePress provides Syntax Highlighting powered by Shiki, with additional features like line-highlighting:\nInput\n````md\n```js{4}\nexport default {\n  data () {\n    return {\n      msg: 'Highlighte"
          }
        ]
      },
      "2024 ": {
        "12": [
          {
            "url": "/01.指南/01.运维",
            "frontmatter": {
              "title": "运维",
              "date": "2024-12-19 18:50:31",
              "permalink": "/linux",
              "categories": [
                "运维"
              ],
              "tags": [
                "运维"
              ],
              "coverImg": "/img/bg/1.webp"
            },
            "title": "运维",
            "date": "2024-12-19 18:50:31",
            "capture": "ops\nso ?"
          }
        ]
      }
    },
    "groupPosts": {
      "categories": {
        "go": [
          {
            "url": "/go/01.go-resty",
            "frontmatter": {
              "title": "go-resty",
              "permalink": "/go",
              "categories": [
                "go"
              ],
              "tags": [
                "go-resty"
              ],
              "coverImg": "/img/bg/1.webp"
            },
            "title": "go-resty",
            "date": "2025-07-09 12:56:29",
            "capture": "go-resty\nso ?"
          }
        ],
        "运维": [
          {
            "url": "/01.指南/01.运维",
            "frontmatter": {
              "title": "运维",
              "date": "2024-12-19 18:50:31",
              "permalink": "/linux",
              "categories": [
                "运维"
              ],
              "tags": [
                "运维"
              ],
              "coverImg": "/img/bg/1.webp"
            },
            "title": "运维",
            "date": "2024-12-19 18:50:31",
            "capture": "ops\nso ?"
          }
        ]
      },
      "tags": {
        "go-resty": [
          {
            "url": "/go/01.go-resty",
            "frontmatter": {
              "title": "go-resty",
              "permalink": "/go",
              "categories": [
                "go"
              ],
              "tags": [
                "go-resty"
              ],
              "coverImg": "/img/bg/1.webp"
            },
            "title": "go-resty",
            "date": "2025-07-09 12:56:29",
            "capture": "go-resty\nso ?"
          }
        ],
        "运维": [
          {
            "url": "/01.指南/01.运维",
            "frontmatter": {
              "title": "运维",
              "date": "2024-12-19 18:50:31",
              "permalink": "/linux",
              "categories": [
                "运维"
              ],
              "tags": [
                "运维"
              ],
              "coverImg": "/img/bg/1.webp"
            },
            "title": "运维",
            "date": "2024-12-19 18:50:31",
            "capture": "ops\nso ?"
          }
        ]
      }
    },
    "groupCards": {
      "categories": [
        {
          "name": "go",
          "length": 1
        },
        {
          "name": "运维",
          "length": 1
        }
      ],
      "tags": [
        {
          "name": "go-resty",
          "length": 1
        },
        {
          "name": "运维",
          "length": 1
        }
      ]
    }
  }
}

Page Data

{
  "title": "Runtime API Examples",
  "description": "",
  "frontmatter": {
    "outline": "deep",
    "head": [
      [
        "script",
        {
          "charset": "UTF-8",
          "id": "LA_COLLECT",
          "src": "//sdk.51.la/js-sdk-pro.min.js"
        }
      ],
      [
        "script",
        {},
        "typeof LA !== 'undefined' && LA.init({\"id\":\"你id\",\"ck\":\"你ck\",\"hashMode\":true})"
      ]
    ]
  },
  "headers": [],
  "relativePath": "api-examples.md",
  "filePath": "api-examples.md",
  "lastUpdated": 1749400783000
}

Page Frontmatter

{
  "outline": "deep",
  "head": [
    [
      "script",
      {
        "charset": "UTF-8",
        "id": "LA_COLLECT",
        "src": "//sdk.51.la/js-sdk-pro.min.js"
      }
    ],
    [
      "script",
      {},
      "typeof LA !== 'undefined' && LA.init({\"id\":\"你id\",\"ck\":\"你ck\",\"hashMode\":true})"
    ]
  ]
}

More

Check out the documentation for the full list of runtime APIs.

声明

作者:老莫想吃鱼了

版权:此文章版权归 老莫想吃鱼了 所有,如有转载,请注明出处!

链接:可点击右上角分享此页面复制文章链接

上次更新时间:

最近更新