@happydesigns/ui 0.17.5 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -70
- package/app/app.config.ts +139 -135
- package/app/components/Snippet.vue +7 -2
- package/app/components/article/ArticleGrid.vue +2 -2
- package/app/components/article/ArticleHeaderBody.vue +26 -26
- package/app/components/article/ArticleHeadlineMeta.vue +37 -37
- package/app/components/article/ArticleList.vue +2 -2
- package/app/components/article/ArticlePage.vue +2 -2
- package/app/components/traits/Authors.vue +2 -1
- package/app/components/traits/Links.vue +17 -21
- package/app/components/traits/Surround.vue +13 -7
- package/app/composables/useArticleList.ts +44 -33
- package/app/composables/usePageContent.ts +22 -19
- package/app/layouts/article.vue +132 -135
- package/app/layouts/content.vue +70 -73
- package/app/types/config.ts +96 -91
- package/app/types/content.ts +14 -0
- package/app/utils/resolveUsers.ts +56 -55
- package/nuxt.config.ts +1 -5
- package/package.json +2 -3
- package/schemas/collections.ts +11 -46
- package/schemas/index.ts +1 -0
- package/schemas/traits.ts +1 -1
- package/server/utils/contentSearch.ts +68 -67
- package/app/layouts/page.vue +0 -59
- package/content.config.ts +0 -6
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
v-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
size="sm"
|
|
19
|
-
v-bind="link"
|
|
20
|
-
/>
|
|
21
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ContentLink } from '../../types/content'
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
links?: ContentLink[]
|
|
6
|
+
}>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<UButton
|
|
11
|
+
v-for="(link, index) in links"
|
|
12
|
+
:key="index"
|
|
13
|
+
variant="subtle"
|
|
14
|
+
size="sm"
|
|
15
|
+
v-bind="link"
|
|
16
|
+
/>
|
|
17
|
+
</template>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
<script setup lang="ts" generic="C extends
|
|
1
|
+
<script setup lang="ts" generic="C extends PageCollectionName">
|
|
2
2
|
import type { PageCollections } from '@nuxt/content'
|
|
3
3
|
import type { QueryConfig } from '../../types/config'
|
|
4
|
+
import type { PageCollectionName } from '../../types/content'
|
|
5
|
+
|
|
6
|
+
type PageField = Extract<keyof PageCollections[keyof PageCollections], string>
|
|
4
7
|
|
|
5
8
|
const props = defineProps<{
|
|
6
9
|
collection: C
|
|
@@ -13,25 +16,28 @@ const props = defineProps<{
|
|
|
13
16
|
const route = useRoute()
|
|
14
17
|
const collection = computed(() => props.collection)
|
|
15
18
|
const path = computed(() => route.path)
|
|
16
|
-
const key = computed(() => `surround-${
|
|
19
|
+
const key = computed(() => `surround-${collection.value}-${path.value}`)
|
|
17
20
|
|
|
18
21
|
const { data: surround } = await useAsyncData(
|
|
19
22
|
key,
|
|
20
23
|
() => {
|
|
21
24
|
const qc = props.query || {}
|
|
22
|
-
|
|
23
|
-
const fields = (qc.fields || ['title', 'description', 'published']) as Array<keyof PageCollections[C]>
|
|
25
|
+
const fields = qc.fields || ['title', 'description', 'published']
|
|
24
26
|
const order = qc.order
|
|
25
27
|
const where = qc.where || [{ field: 'published', operator: '=', value: true }]
|
|
26
28
|
|
|
27
|
-
let query = queryCollectionItemSurroundings(
|
|
29
|
+
let query = queryCollectionItemSurroundings(
|
|
30
|
+
collection.value as keyof PageCollections,
|
|
31
|
+
path.value,
|
|
32
|
+
{ fields: fields as PageField[] },
|
|
33
|
+
)
|
|
28
34
|
|
|
29
35
|
where.forEach((filter) => {
|
|
30
|
-
query = query.where(filter.field, filter.operator, filter.value)
|
|
36
|
+
query = query.where(filter.field as PageField, filter.operator, filter.value)
|
|
31
37
|
})
|
|
32
38
|
|
|
33
39
|
if (order) {
|
|
34
|
-
query = query.order(order.field as
|
|
40
|
+
query = query.order(order.field as PageField, order.direction)
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
return query
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Collections, PageCollections, SQLOperator } from '@nuxt/content'
|
|
1
|
+
import type { CollectionQueryBuilder, Collections, PageCollectionItemBase, PageCollections, SQLOperator } from '@nuxt/content'
|
|
2
2
|
import type { BadgeProps } from '@nuxt/ui'
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue'
|
|
4
|
+
import type { PageCollectionName } from '../types/content'
|
|
4
5
|
import { computed, toValue } from 'vue'
|
|
5
6
|
|
|
6
7
|
export interface ArticleFilter {
|
|
@@ -9,7 +10,7 @@ export interface ArticleFilter {
|
|
|
9
10
|
value?: unknown
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export interface UseArticleListOptions<C extends
|
|
13
|
+
export interface UseArticleListOptions<C extends PageCollectionName = 'article'> {
|
|
13
14
|
page?: MaybeRefOrGetter<number | undefined>
|
|
14
15
|
itemsPerPage?: MaybeRefOrGetter<number | undefined>
|
|
15
16
|
category?: MaybeRefOrGetter<string | undefined>
|
|
@@ -30,10 +31,11 @@ export interface UseArticleListOptions<C extends keyof PageCollections = 'articl
|
|
|
30
31
|
* Composable to fetch a paginated and filtered list of articles or any other collection.
|
|
31
32
|
* Includes automatic resolution of authors and category badges.
|
|
32
33
|
*/
|
|
33
|
-
export function useArticleList<C extends
|
|
34
|
+
export function useArticleList<C extends PageCollectionName = 'article'>(options: UseArticleListOptions<C> = {}) {
|
|
34
35
|
const collection = computed(() => (toValue(options.collection) || ('article' as C)) as C)
|
|
35
36
|
|
|
36
37
|
const { config } = useVariant(collection)
|
|
38
|
+
const appConfig = useAppConfig()
|
|
37
39
|
|
|
38
40
|
const page = computed(() => toValue(options.page) || 1)
|
|
39
41
|
const itemsPerPage = computed(() => toValue(options.itemsPerPage) || config.value.list?.itemsPerPage || 12)
|
|
@@ -64,22 +66,30 @@ export function useArticleList<C extends keyof PageCollections = 'article'>(opti
|
|
|
64
66
|
|
|
65
67
|
return useAsyncData(queryKey, async () => {
|
|
66
68
|
// The result keeps consumer collection fields together with the article fields used by the UI.
|
|
67
|
-
type
|
|
69
|
+
type ConsumerItem = PageCollectionItemBase
|
|
70
|
+
& (C extends keyof PageCollections ? PageCollections[C] : object)
|
|
71
|
+
type ArticleItem = ConsumerItem & {
|
|
72
|
+
authors?: string[]
|
|
73
|
+
category?: string
|
|
74
|
+
date?: string
|
|
75
|
+
dateEnd?: string
|
|
76
|
+
published?: boolean
|
|
77
|
+
}
|
|
68
78
|
const getDataQuery = () => {
|
|
69
|
-
let query = queryCollection(collection.value)
|
|
79
|
+
let query = queryCollection(collection.value as keyof Collections) as unknown as CollectionQueryBuilder<ArticleItem>
|
|
70
80
|
|
|
71
81
|
if (publishedOnly.value) {
|
|
72
|
-
query = query.where('published', '=', true)
|
|
82
|
+
query = query.where('published' as Extract<keyof ArticleItem, string>, '=', true)
|
|
73
83
|
}
|
|
74
84
|
|
|
75
85
|
if (category.value && category.value !== labelAll.value) {
|
|
76
|
-
query = query.where('category', '=', category.value)
|
|
86
|
+
query = query.where('category' as Extract<keyof ArticleItem, string>, '=', category.value)
|
|
77
87
|
}
|
|
78
88
|
|
|
79
89
|
// Apply additional filters
|
|
80
90
|
if (where.value && Array.isArray(where.value)) {
|
|
81
91
|
where.value.forEach((filter) => {
|
|
82
|
-
query = query.where(filter.field, filter.operator, filter.value)
|
|
92
|
+
query = query.where(filter.field as Extract<keyof ArticleItem, string>, filter.operator, filter.value)
|
|
83
93
|
})
|
|
84
94
|
}
|
|
85
95
|
return query
|
|
@@ -88,25 +98,26 @@ export function useArticleList<C extends keyof PageCollections = 'article'>(opti
|
|
|
88
98
|
let finalQuery = getDataQuery()
|
|
89
99
|
|
|
90
100
|
if (sort.value) {
|
|
91
|
-
finalQuery = finalQuery.order(sort.value.field as keyof
|
|
101
|
+
finalQuery = finalQuery.order(sort.value.field as Extract<keyof ArticleItem, string>, sort.value.direction)
|
|
92
102
|
}
|
|
93
103
|
|
|
94
|
-
const [articles, total] = await Promise.all([
|
|
95
|
-
finalQuery
|
|
96
|
-
.skip((page.value - 1) * itemsPerPage.value)
|
|
97
|
-
.limit(itemsPerPage.value)
|
|
98
|
-
.all() as Promise<ArticleItem[]>,
|
|
99
|
-
getDataQuery().count() as Promise<number>,
|
|
100
|
-
])
|
|
101
|
-
|
|
102
|
-
const userProps = config.value.user ?? {}
|
|
103
|
-
const authorsByUsername = await resolveUserMap(
|
|
104
|
-
articles.flatMap(article => article.authors ?? []),
|
|
105
|
-
userProps,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
const [articles, total] = await Promise.all([
|
|
105
|
+
finalQuery
|
|
106
|
+
.skip((page.value - 1) * itemsPerPage.value)
|
|
107
|
+
.limit(itemsPerPage.value)
|
|
108
|
+
.all() as Promise<ArticleItem[]>,
|
|
109
|
+
getDataQuery().count() as Promise<number>,
|
|
110
|
+
])
|
|
111
|
+
|
|
112
|
+
const userProps = config.value.user ?? {}
|
|
113
|
+
const authorsByUsername = await resolveUserMap(
|
|
114
|
+
articles.flatMap(article => article.authors ?? []),
|
|
115
|
+
userProps,
|
|
116
|
+
appConfig.app.content.userCollection,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
// Resolve display details without issuing additional collection queries.
|
|
120
|
+
const resolved = articles.map((article) => {
|
|
110
121
|
// Resolve Category Badge directly
|
|
111
122
|
const categoryKey = article.category
|
|
112
123
|
let resolvedBadge: BadgeProps | undefined
|
|
@@ -118,19 +129,19 @@ export function useArticleList<C extends keyof PageCollections = 'article'>(opti
|
|
|
118
129
|
}
|
|
119
130
|
}
|
|
120
131
|
|
|
121
|
-
// Preserve the author order declared in front matter.
|
|
122
|
-
const resolvedAuthors = (article.authors ?? []).flatMap((username) => {
|
|
123
|
-
const author = authorsByUsername.get(username)
|
|
124
|
-
return author ? [author] : []
|
|
125
|
-
})
|
|
126
|
-
|
|
132
|
+
// Preserve the author order declared in front matter.
|
|
133
|
+
const resolvedAuthors = (article.authors ?? []).flatMap((username) => {
|
|
134
|
+
const author = authorsByUsername.get(username)
|
|
135
|
+
return author ? [author] : []
|
|
136
|
+
})
|
|
137
|
+
|
|
127
138
|
return {
|
|
128
139
|
...article,
|
|
129
140
|
resolvedBadge,
|
|
130
141
|
resolvedAuthors,
|
|
131
142
|
}
|
|
132
|
-
})
|
|
133
|
-
|
|
143
|
+
})
|
|
144
|
+
|
|
134
145
|
return {
|
|
135
146
|
articles: resolved,
|
|
136
147
|
total,
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import type { PageCollections } from '@nuxt/content'
|
|
1
|
+
import type { PageCollectionItemBase, PageCollections } from '@nuxt/content'
|
|
2
2
|
import type { AsyncData } from 'nuxt/app'
|
|
3
3
|
import type { MaybeRefOrGetter } from 'vue'
|
|
4
|
+
import type { PageCollectionName } from '../types/content'
|
|
4
5
|
import { computed, toValue } from 'vue'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
type PageForCollection<C extends PageCollectionName> = PageCollectionItemBase
|
|
8
|
+
& (C extends keyof PageCollections ? PageCollections[C] : object)
|
|
9
|
+
|
|
10
|
+
interface UsePageContentOptions<C extends PageCollectionName = 'page'> {
|
|
11
|
+
path?: MaybeRefOrGetter<string | undefined>
|
|
12
|
+
collection?: MaybeRefOrGetter<C>
|
|
13
|
+
}
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export function usePageContent<C extends keyof PageCollections = 'page', B = object>(
|
|
19
|
-
{ path, collection }: UsePageContentOptions<C> = {},
|
|
20
|
-
) {
|
|
16
|
+
* Fetches a page without requiring the layer to own its collection definition.
|
|
17
|
+
* Known consumer collection names retain their generated Nuxt Content type.
|
|
18
|
+
*/
|
|
19
|
+
export function usePageContent<C extends PageCollectionName = 'page', B extends object = object>(
|
|
20
|
+
{ path, collection }: UsePageContentOptions<C> = {},
|
|
21
|
+
) {
|
|
21
22
|
const route = useRoute()
|
|
22
23
|
const resolvedPath = computed(() => toValue(path) ?? route.path)
|
|
23
24
|
const resolvedCollection = computed(() => (toValue(collection) ?? ('page' as C)) as C)
|
|
24
|
-
const key = computed(() => `${
|
|
25
|
+
const key = computed(() => `${resolvedCollection.value}:${resolvedPath.value}`)
|
|
26
|
+
|
|
27
|
+
const handler = () => queryCollection(resolvedCollection.value as keyof PageCollections)
|
|
28
|
+
.path(resolvedPath.value)
|
|
29
|
+
.first()
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return useAsyncData(key, handler) as unknown as AsyncData<(PageCollections[C] & B) | null, Error | null>
|
|
29
|
-
}
|
|
31
|
+
return useAsyncData(key, handler) as unknown as AsyncData<(PageForCollection<C> & B) | null, Error | null>
|
|
32
|
+
}
|
package/app/layouts/article.vue
CHANGED
|
@@ -1,135 +1,132 @@
|
|
|
1
|
-
<script setup lang="ts" generic="C extends
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
const props = defineProps<{
|
|
6
|
-
path?: string
|
|
7
|
-
collection?: C
|
|
8
|
-
}>()
|
|
9
|
-
|
|
10
|
-
const route = useRoute()
|
|
11
|
-
const collection = computed(() => props.collection ?? 'article')
|
|
12
|
-
|
|
13
|
-
const { data: page } = await usePageContent({
|
|
14
|
-
path: () => props.path,
|
|
15
|
-
collection: () => collection.value,
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
const { config, has } = useVariant(collection)
|
|
19
|
-
const hasHeader = has('header')
|
|
20
|
-
const hasBackButton = has('backButton')
|
|
21
|
-
const hasCopyButton = has('copyButton')
|
|
22
|
-
const hasSeparator = has('separator')
|
|
23
|
-
const hasSurround = has('surround')
|
|
24
|
-
const hasToc = has('toc')
|
|
25
|
-
const tocEnabled = computed(() => !page.value || !('toc' in page.value) || page.value.toc !== false)
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
v-
|
|
120
|
-
:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
</UPage>
|
|
134
|
-
</UContainer>
|
|
135
|
-
</template>
|
|
1
|
+
<script setup lang="ts" generic="C extends PageCollectionName = 'article'">
|
|
2
|
+
import type { BreadcrumbItem } from '@nuxt/ui'
|
|
3
|
+
import type { PageCollectionName } from '../types/content'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
path?: string
|
|
7
|
+
collection?: C
|
|
8
|
+
}>()
|
|
9
|
+
|
|
10
|
+
const route = useRoute()
|
|
11
|
+
const collection = computed(() => props.collection ?? 'article')
|
|
12
|
+
|
|
13
|
+
const { data: page } = await usePageContent({
|
|
14
|
+
path: () => props.path,
|
|
15
|
+
collection: () => collection.value,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const { config, has } = useVariant(collection)
|
|
19
|
+
const hasHeader = has('header')
|
|
20
|
+
const hasBackButton = has('backButton')
|
|
21
|
+
const hasCopyButton = has('copyButton')
|
|
22
|
+
const hasSeparator = has('separator')
|
|
23
|
+
const hasSurround = has('surround')
|
|
24
|
+
const hasToc = has('toc')
|
|
25
|
+
const tocEnabled = computed(() => !page.value || !('toc' in page.value) || page.value.toc !== false)
|
|
26
|
+
const showTocSidebar = computed(() => hasToc.value && tocEnabled.value)
|
|
27
|
+
|
|
28
|
+
if (!page.value) {
|
|
29
|
+
throw createError({
|
|
30
|
+
statusCode: 404,
|
|
31
|
+
statusMessage: `${collection.value} ${props.path || route.path} not found`,
|
|
32
|
+
fatal: true,
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
usePageSeo(page)
|
|
37
|
+
|
|
38
|
+
const header = computed(() => resolvePageHeader(page.value))
|
|
39
|
+
|
|
40
|
+
const breadcrumbsBase = computed(() => (config.value.breadcrumbs ?? []) as BreadcrumbItem[])
|
|
41
|
+
|
|
42
|
+
const breadcrumbItems = computed(() => {
|
|
43
|
+
const baseItems = breadcrumbsBase.value.map((item, index) => ({
|
|
44
|
+
...item,
|
|
45
|
+
...(index === breadcrumbsBase.value.length - 1
|
|
46
|
+
? { ui: { ...item.ui, separator: 'hidden sm:flex' } }
|
|
47
|
+
: {}),
|
|
48
|
+
}))
|
|
49
|
+
|
|
50
|
+
return [
|
|
51
|
+
...baseItems,
|
|
52
|
+
{
|
|
53
|
+
label: page.value?.title,
|
|
54
|
+
to: page.value?.path,
|
|
55
|
+
ui: { item: 'hidden sm:flex' },
|
|
56
|
+
},
|
|
57
|
+
]
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const backLink = computed(() => {
|
|
61
|
+
const lastBreadcrumb = breadcrumbsBase.value.at(-1)
|
|
62
|
+
|
|
63
|
+
if (!lastBreadcrumb && !config.value?.backButton)
|
|
64
|
+
return null
|
|
65
|
+
|
|
66
|
+
return { ...(lastBreadcrumb ?? {}), ...config.value?.backButton }
|
|
67
|
+
})
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<UContainer v-if="page">
|
|
72
|
+
<UPageHeader
|
|
73
|
+
v-if="hasHeader && header"
|
|
74
|
+
v-bind="header"
|
|
75
|
+
:ui="{
|
|
76
|
+
headline: 'all:flex flex-col gap-y-8 items-start',
|
|
77
|
+
wrapper: 'lg:flex-row',
|
|
78
|
+
}"
|
|
79
|
+
>
|
|
80
|
+
<template #headline>
|
|
81
|
+
<UBreadcrumb
|
|
82
|
+
:ui="{ root: 'max-w-full' }"
|
|
83
|
+
:items="breadcrumbItems"
|
|
84
|
+
/>
|
|
85
|
+
<HArticleHeadlineMeta :page="page" :collection="collection" />
|
|
86
|
+
</template>
|
|
87
|
+
<HArticleHeaderBody :page="page" :collection="collection">
|
|
88
|
+
<slot name="header" />
|
|
89
|
+
</HArticleHeaderBody>
|
|
90
|
+
</UPageHeader>
|
|
91
|
+
|
|
92
|
+
<UPage>
|
|
93
|
+
<UPageBody>
|
|
94
|
+
<slot />
|
|
95
|
+
|
|
96
|
+
<div
|
|
97
|
+
v-if="hasBackButton || hasCopyButton"
|
|
98
|
+
class="all:flex items-center justify-between mt-12"
|
|
99
|
+
>
|
|
100
|
+
<HBackButton
|
|
101
|
+
v-if="hasBackButton && backLink"
|
|
102
|
+
v-bind="backLink"
|
|
103
|
+
/>
|
|
104
|
+
<div class="all:flex justify-end items-center gap-1.5 ml-auto">
|
|
105
|
+
<HCopyButton v-if="hasCopyButton" v-bind="config.copyButton" />
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<HSeparator
|
|
110
|
+
v-if="hasSeparator"
|
|
111
|
+
:stem="page?.stem"
|
|
112
|
+
:extension="page?.extension"
|
|
113
|
+
v-bind="config.separator"
|
|
114
|
+
/>
|
|
115
|
+
|
|
116
|
+
<HSurround
|
|
117
|
+
v-if="hasSurround"
|
|
118
|
+
:collection="collection"
|
|
119
|
+
v-bind="config.surround"
|
|
120
|
+
:query="config.query"
|
|
121
|
+
/>
|
|
122
|
+
</UPageBody>
|
|
123
|
+
|
|
124
|
+
<template v-if="showTocSidebar" #right>
|
|
125
|
+
<HToc
|
|
126
|
+
:links="page?.body?.toc?.links"
|
|
127
|
+
:title="page?.body?.toc?.title"
|
|
128
|
+
/>
|
|
129
|
+
</template>
|
|
130
|
+
</UPage>
|
|
131
|
+
</UContainer>
|
|
132
|
+
</template>
|