feat: Add Markdown Page route and component
All checks were successful
CI / cache-and-install (push) Successful in 1m18s

This commit is contained in:
严浩
2024-08-21 12:17:42 +08:00
parent 41f194b180
commit adfa5f525a
8 changed files with 102 additions and 4 deletions

View File

@ -3,12 +3,14 @@ import 'virtual:uno.css';
import { createApp } from 'vue';
import { createPinia } from 'pinia';
import { createHead, unheadVueComposablesImports } from '@unhead/vue';
import App from './App.vue';
import { router } from './router';
import { DataLoaderPlugin } from 'unplugin-vue-router/data-loaders';
createApp(App)
.use(createHead())
.use(createPinia())
// Register the plugin before the router
.use(DataLoaderPlugin, { router })

View File

@ -1,4 +1,15 @@
<script lang="ts" setup>
useHead({
// Titles
title: 'Hello World',
titleTemplate: '%s %separator %siteName',
// Template params
templateParams: { separator: '|', siteName: 'My App' },
// Classes
bodyAttrs: { class: { overflow: true } },
// Deduping
// script: [{ key: '123', src: '/script.js' }],
});
definePage({
alias: '/',
});
@ -11,5 +22,6 @@ definePage({
<li><router-link :to="{ name: 'TsEnumUtil' }">TS Enum Util</router-link></li>
<li><router-link :to="{ name: 'SomePage' }">Some Page</router-link></li>
<li><router-link :to="{ name: '中文页面' }">中文-页面.page.vue</router-link></li>
<li><router-link :to="{ name: 'MdPage' }">Markdown Page</router-link></li>
</ul>
</template>

11
src/pages/md-page.md Normal file
View File

@ -0,0 +1,11 @@
---
name: My Cool App
title: My Cool App
meta:
- name: description
content: Hello World
---
# Hello World
This is {{frontmatter.name}}