Capital/pages/docs/[...slug].vue

106 lines
2.4 KiB
Vue
Raw Permalink Normal View History

2024-09-27 16:28:40 +00:00
<template>
<v-container class="px-12 docs-page-container">
<div class="docs-container">
<div class="docs-content">
<div class="mt-5">
<div class="flex gap-2 items-center">
<v-icon :icon="page.icon ?? 'mdi-text-box'" size="28" />
<h1 class="text-2xl">{{ page.title }}</h1>
</div>
<p>{{ page.description }}</p>
</div>
<article class="text-base prose xl:text-lg docs-article">
<content-renderer :value="page">
<content-renderer-markdown :value="page" />
</content-renderer>
</article>
</div>
2024-10-03 18:35:02 +00:00
<v-dialog max-width="540" v-model="dialogOpen" close-on-content-click>
<v-card title="Table of Contents" density="compact">
<div class="mt-[-12px]">
2024-09-28 05:29:05 +00:00
<docs-table-of-contents v-if="page.body.toc.links?.length > 0" :links="page.body.toc.links" />
<v-empty-state v-else text="No Headers Available" />
2024-10-03 18:35:02 +00:00
</div>
</v-card>
</v-dialog>
2024-09-28 05:29:05 +00:00
<v-fab
app
appear
2024-10-04 09:55:42 +00:00
size="large"
2024-09-28 05:29:05 +00:00
location="bottom end"
2024-10-04 09:55:42 +00:00
icon="mdi-menu"
2024-10-03 18:35:02 +00:00
@click="dialogOpen = !dialogOpen"
2024-09-28 05:29:05 +00:00
/>
2024-09-27 16:28:40 +00:00
</div>
</v-container>
</template>
<script setup lang="ts">
2024-09-28 05:29:05 +00:00
import { definePageMeta } from "#imports"
2024-09-27 16:28:40 +00:00
const route = useRoute()
const { t } = useI18n()
const { data: page } = await useAsyncData<any>("page", queryContent(route.path).where({ _locale: getLocale() }).findOne)
2024-09-28 05:29:05 +00:00
const drawerTab = ref(0)
2024-10-03 18:35:02 +00:00
const dialogOpen = ref(false)
2024-09-28 05:29:05 +00:00
2024-09-27 16:28:40 +00:00
if (page.value == null) {
throw createError({
status: 404,
statusMessage: "Document Page Not Found",
})
}
2024-09-28 05:29:05 +00:00
definePageMeta({
layout: "docs",
})
2024-09-27 16:28:40 +00:00
useHead({
title: page.value.title,
titleTemplate: "%s | Solsynth Knowledge Base",
})
useSeoMeta({
title: page.value.title,
ogTitle: page.value.title,
description: page.value.description,
ogDescription: page.value.description,
ogUrl: `${useRuntimeConfig().public.siteUrl}${route.fullPath}`,
publisher: "Solar Archive",
ogSiteName: "Solsynth Capital",
})
</script>
<style scoped>
.docs-article {
padding-bottom: 2rem;
}
2024-09-28 05:29:05 +00:00
.docs-content {
max-width: 75ch;
margin: 0 auto;
2024-09-27 16:28:40 +00:00
}
</style>
<style>
.docs-article img {
border-radius: 8px;
2024-09-28 07:10:43 +00:00
border: 1px solid #eee;
transition: box-shadow .3s ease-in-out;
}
.docs-article img:hover {
box-shadow: 2px 2px 2px rgba(0, 0, 0, .2);;
2024-09-27 16:28:40 +00:00
}
2024-09-28 05:29:05 +00:00
2024-09-27 16:28:40 +00:00
html, body, .v-application, .docs-article {
scroll-behavior: smooth;
}
</style>