From d823026b48f953d7c6d1a4cf98df7963fa249f6f Mon Sep 17 00:00:00 2001 From: sendevia Date: Fri, 12 Jul 2024 22:27:58 +0800 Subject: [PATCH] Initial --- .gitignore | 6 +++ .vitepress/config.mts | 15 +++++++ .vitepress/theme/Layout.vue | 28 ++++++++++++ .vitepress/theme/index.ts | 11 +++++ .vitepress/theme/style.css | 3 ++ api-examples.md | 52 +++++++++++++++++++++++ index.md | 4 ++ markdown-examples.md | 85 +++++++++++++++++++++++++++++++++++++ package.json | 10 +++++ 9 files changed, 214 insertions(+) create mode 100755 .gitignore create mode 100644 .vitepress/config.mts create mode 100644 .vitepress/theme/Layout.vue create mode 100644 .vitepress/theme/index.ts create mode 100644 .vitepress/theme/style.css create mode 100644 api-examples.md create mode 100644 index.md create mode 100644 markdown-examples.md create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..641ea3f --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.vscode +*.code-workspace +*.map +node_modules +package-lock.json +cache/ \ No newline at end of file diff --git a/.vitepress/config.mts b/.vitepress/config.mts new file mode 100644 index 0000000..c3d0b31 --- /dev/null +++ b/.vitepress/config.mts @@ -0,0 +1,15 @@ +import { defineConfig } from "vitepress"; + +// https://vitepress.dev/reference/site-config +export default defineConfig({ + title: "sendevia 的小站", + titleTemplate: ":title - sendevia.page.vitpress", + description: "A VitePress Site", + lang: "zh_CN", + cleanUrls: true, + markdown: { + image: { + lazyLoading: true, + }, + }, +}); diff --git a/.vitepress/theme/Layout.vue b/.vitepress/theme/Layout.vue new file mode 100644 index 0000000..ea1d5e0 --- /dev/null +++ b/.vitepress/theme/Layout.vue @@ -0,0 +1,28 @@ + + + diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts new file mode 100644 index 0000000..9667dfe --- /dev/null +++ b/.vitepress/theme/index.ts @@ -0,0 +1,11 @@ +// https://vitepress.dev/guide/custom-theme +import Layout from "./Layout.vue"; +import type { Theme } from "vitepress"; +import "./style.css"; + +export default { + Layout, + enhanceApp({ app, router, siteData }) { + // ... + }, +} satisfies Theme; diff --git a/.vitepress/theme/style.css b/.vitepress/theme/style.css new file mode 100644 index 0000000..d7148b6 --- /dev/null +++ b/.vitepress/theme/style.css @@ -0,0 +1,3 @@ +html { + font-family: Arial, Helvetica; +} diff --git a/api-examples.md b/api-examples.md new file mode 100644 index 0000000..7ef13ad --- /dev/null +++ b/api-examples.md @@ -0,0 +1,52 @@ +--- +outline: deep +--- + +# 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 + + +## Results + +### Theme Data +
{{ theme }}
+ +### Page Data +
{{ page }}
+ +### Page Frontmatter +
{{ frontmatter }}
+``` + + + +## Results + +### Theme Data + +
{{ theme }}
+ +### Page Data + +
{{ page }}
+ +### Page Frontmatter + +
{{ frontmatter }}
+ +## More + +Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata). diff --git a/index.md b/index.md new file mode 100644 index 0000000..b1c72f4 --- /dev/null +++ b/index.md @@ -0,0 +1,4 @@ +--- +home: true +--- + diff --git a/markdown-examples.md b/markdown-examples.md new file mode 100644 index 0000000..f9258a5 --- /dev/null +++ b/markdown-examples.md @@ -0,0 +1,85 @@ +# Markdown Extension Examples + +This page demonstrates some of the built-in markdown extensions provided by VitePress. + +## Syntax Highlighting + +VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting: + +**Input** + +````md +```js{4} +export default { + data () { + return { + msg: 'Highlighted!' + } + } +} +``` +```` + +**Output** + +```js{4} +export default { + data () { + return { + msg: 'Highlighted!' + } + } +} +``` + +## Custom Containers + +**Input** + +```md +::: info +This is an info box. +::: + +::: tip +This is a tip. +::: + +::: warning +This is a warning. +::: + +::: danger +This is a dangerous warning. +::: + +::: details +This is a details block. +::: +``` + +**Output** + +::: info +This is an info box. +::: + +::: tip +This is a tip. +::: + +::: warning +This is a warning. +::: + +::: danger +This is a dangerous warning. +::: + +::: details +This is a details block. +::: + +## More + +Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown). diff --git a/package.json b/package.json new file mode 100644 index 0000000..68161b6 --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "scripts": { + "docs:dev": "vitepress dev", + "docs:build": "vitepress build", + "docs:preview": "vitepress preview" + }, + "devDependencies": { + "vue": "^3.4.31" + } +}