Add custom font styles and theme enhancements

- Created a new CSS file for font imports and defined font families for base, mono, strong, em, and h1 elements.
- Added a new JavaScript file to extend the default VitePress theme, incorporating a custom layout and a Vue component for enhanced functionality.
- Integrated Mermaid diagram support and included the necessary styles for it.
This commit is contained in:
2026-06-02 13:03:25 +08:00
parent 6e577b15a2
commit b9bbcf131e
26 changed files with 4274 additions and 18 deletions

22
openwiki/theme/Layout.vue Normal file
View File

@@ -0,0 +1,22 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useData } from 'vitepress'
import DefaultTheme from 'vitepress/theme-without-fonts'
import DocTags from './components/DocTags.vue'
import DocMetaEx from './components/DocMetaEx.vue'
const { frontmatter } = useData()
const tags = computed(() => frontmatter.value?.tags ?? [])
const hasTags = computed(() => tags.value.length > 0)
</script>
<template>
<DefaultTheme.Layout>
<template #doc-before>
<DocTags v-if="hasTags" style="margin-bottom: 24px;" />
</template>
<template #aside-outline-after>
<DocMetaEx style="margin-top: 24px; padding-left: 16px;"/>
</template>
</DefaultTheme.Layout>
</template>