Files
omoolab-project/openwiki/theme/components/DocMetaEx.vue
nan b9bbcf131e 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.
2026-06-02 13:03:25 +08:00

51 lines
1.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { computed } from "vue";
import { useData } from "vitepress";
const { frontmatter } = useData();
const source = computed(() => frontmatter.value?.source ?? null);
const title = computed(() => frontmatter.value?.title ?? null);
const abstract = computed(() => frontmatter.value?.abstract ?? null);
const hasExtended = computed(
() => source.value || title.value || abstract.value,
);
</script>
<template>
<div v-if="hasExtended" class="doc-meta-ex">
<div v-if="title" class="doc-meta-title">标题:{{ title }}</div>
<div v-if="source" class="doc-meta-source">
来源:<a :href="source" target="_blank" rel="noopener noreferrer">{{
source
}}</a>
</div>
<div v-if="abstract" class="doc-meta-abstract">摘要:{{ abstract }}</div>
</div>
</template>
<style scoped>
.doc-meta-ex {
display: flex;
flex-direction: column;
line-height: 1.8;
gap: 8px;
}
.doc-meta-source {
font-size: 12px;
color: var(--vp-c-text-2);
}
.doc-meta-title {
font-size: 12px;
color: var(--vp-c-text-1);
}
.doc-meta-abstract {
font-size: 12px;
color: var(--vp-c-text-2);
}
</style>