2025-03-27 13:43:31 +06:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import NotFound from 'vitepress/dist/client/theme-default/NotFound.vue'
|
|
|
|
|
import { useData } from 'vitepress/dist/client/theme-default/composables/data'
|
|
|
|
|
import { useSidebar } from 'vitepress/dist/client/theme-default/composables/sidebar'
|
|
|
|
|
import CustomDoc from './CustomDoc.vue'
|
|
|
|
|
import VPHome from 'vitepress/dist/client/theme-default/components/VPHome.vue'
|
|
|
|
|
import VPPage from 'vitepress/dist/client/theme-default/components/VPPage.vue'
|
|
|
|
|
|
|
|
|
|
const { page, frontmatter } = useData()
|
|
|
|
|
const { hasSidebar } = useSidebar()
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2025-08-25 11:21:09 +00:00
|
|
|
<div class="VPContent CustomContent" id="VPContent" :class="{
|
2025-03-27 13:43:31 +06:00
|
|
|
'has-sidebar': hasSidebar,
|
|
|
|
|
'is-home': frontmatter.layout === 'home'
|
2025-08-25 11:21:09 +00:00
|
|
|
}">
|
|
|
|
|
<slot name="not-found" v-if="page.isNotFound">
|
|
|
|
|
<NotFound />
|
|
|
|
|
</slot>
|
2025-03-27 13:43:31 +06:00
|
|
|
|
|
|
|
|
<VPPage v-else-if="frontmatter.layout === 'page'">
|
2025-08-25 11:21:09 +00:00
|
|
|
<template #page-top>
|
|
|
|
|
<slot name="page-top" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #page-bottom>
|
|
|
|
|
<slot name="page-bottom" />
|
|
|
|
|
</template>
|
2025-03-27 13:43:31 +06:00
|
|
|
</VPPage>
|
|
|
|
|
|
|
|
|
|
<VPHome v-else-if="frontmatter.layout === 'home'">
|
2025-08-25 11:21:09 +00:00
|
|
|
<template #home-hero-before>
|
|
|
|
|
<slot name="home-hero-before" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #home-hero-info>
|
|
|
|
|
<slot name="home-hero-info" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #home-hero-image>
|
|
|
|
|
<slot name="home-hero-image" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #home-hero-after>
|
|
|
|
|
<slot name="home-hero-after" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #home-features-before>
|
|
|
|
|
<slot name="home-features-before" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #home-features-after>
|
|
|
|
|
<slot name="home-features-after" />
|
|
|
|
|
</template>
|
2025-03-27 13:43:31 +06:00
|
|
|
</VPHome>
|
|
|
|
|
|
2025-08-25 11:21:09 +00:00
|
|
|
<component v-else-if="frontmatter.layout && frontmatter.layout !== 'doc'" :is="frontmatter.layout" />
|
2025-03-27 13:43:31 +06:00
|
|
|
|
|
|
|
|
<CustomDoc v-else>
|
2025-08-25 11:21:09 +00:00
|
|
|
<template #doc-top>
|
|
|
|
|
<slot name="doc-top" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #doc-bottom>
|
|
|
|
|
<slot name="doc-bottom" />
|
|
|
|
|
</template>
|
2025-03-27 13:43:31 +06:00
|
|
|
|
2025-08-25 11:21:09 +00:00
|
|
|
<template #doc-footer-before>
|
|
|
|
|
<slot name="doc-footer-before" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #doc-before>
|
|
|
|
|
<slot name="doc-before" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #doc-after>
|
|
|
|
|
<slot name="doc-after" />
|
|
|
|
|
</template>
|
2025-03-27 13:43:31 +06:00
|
|
|
|
2025-08-25 11:21:09 +00:00
|
|
|
<template #aside-top>
|
|
|
|
|
<slot name="aside-top" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #aside-outline-before>
|
|
|
|
|
<slot name="aside-outline-before" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #aside-outline-after>
|
|
|
|
|
<slot name="aside-outline-after" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #aside-ads-before>
|
|
|
|
|
<slot name="aside-ads-before" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #aside-ads-after>
|
|
|
|
|
<slot name="aside-ads-after" />
|
|
|
|
|
</template>
|
|
|
|
|
<template #aside-bottom>
|
|
|
|
|
<slot name="aside-bottom" />
|
|
|
|
|
</template>
|
2025-03-27 13:43:31 +06:00
|
|
|
</CustomDoc>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.VPContent {
|
|
|
|
|
flex-grow: 1;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
margin: var(--vp-layout-top-height, 0px) auto 0;
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.VPContent.is-home {
|
|
|
|
|
width: 100%;
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.VPContent.has-sidebar {
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (min-width: 960px) {
|
|
|
|
|
.VPContent {
|
|
|
|
|
padding-top: var(--vp-nav-height);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.VPContent.has-sidebar {
|
|
|
|
|
margin: var(--vp-layout-top-height, 0px) 0 0;
|
2025-08-22 06:50:47 +00:00
|
|
|
padding-left: 320px;
|
2025-03-27 13:43:31 +06:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (min-width: 1440px) {
|
|
|
|
|
.VPContent.has-sidebar {
|
|
|
|
|
padding-right: calc((100vw - var(--vp-layout-max-width)) / 2);
|
|
|
|
|
// padding-left: calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|