@happydesigns/ui 0.15.1 → 0.17.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 +64 -53
- package/app/app.config.ts +138 -165
- package/app/app.vue +0 -2
- package/app/assets/css/styles.css +38 -0
- package/app/components/Carousel.vue +33 -0
- package/app/components/{content/Snippet.vue → Snippet.vue} +6 -2
- package/app/components/article/ArticleGrid.vue +4 -4
- package/app/components/article/ArticleGridDate.vue +19 -16
- package/app/components/article/ArticleHeaderBody.vue +26 -20
- package/app/components/article/ArticleHeadlineMeta.vue +37 -26
- package/app/components/article/ArticleList.vue +5 -5
- package/app/components/article/ArticlePage.vue +1 -1
- package/app/components/footer/FooterColumns.vue +60 -101
- package/app/components/search/ContentSearch.client.vue +59 -0
- package/app/components/studio/StudioLoginButton.client.vue +11 -3
- package/app/components/traits/Category.vue +1 -1
- package/app/components/traits/CopyButton.vue +40 -32
- package/app/components/traits/Links.vue +21 -17
- package/app/components/traits/Surround.vue +6 -7
- package/app/components/traits/Toc.vue +18 -16
- package/app/composables/useArticleList.ts +37 -46
- package/app/composables/useClipboard.ts +48 -26
- package/app/composables/useContentSearchData.ts +42 -0
- package/app/composables/useNavigationLinks.ts +40 -0
- package/app/composables/usePageContent.ts +1 -3
- package/app/composables/usePageSeo.ts +7 -15
- package/app/internal/pageLayout.ts +7 -0
- package/app/layouts/article.vue +137 -120
- package/app/layouts/content.vue +63 -59
- package/app/types/config.ts +91 -13
- package/app/utils/createContentSearchLoader.ts +45 -0
- package/app/utils/formatDate.ts +1 -1
- package/app/utils/formatDateTime.ts +1 -1
- package/app/utils/isNavigationTargetActive.ts +12 -0
- package/app/utils/resolveUsers.ts +56 -42
- package/nuxt.config.ts +4 -16
- package/package.json +17 -9
- package/schemas/collections.ts +4 -0
- package/schemas/indexes.ts +10 -0
- package/schemas/traits.ts +9 -4
- package/server/api/navigation.json.get.ts +11 -0
- package/server/api/search.json.get.ts +11 -0
- package/server/utils/contentSearch.ts +67 -0
- package/shared/types/app-config.d.ts +23 -0
- package/app/assets/css/main.css +0 -14
- package/app/components/content/Carousel.vue +0 -11
|
@@ -1,26 +1,37 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { PageCollections } from '@nuxt/content'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PageCollections } from '@nuxt/content'
|
|
3
|
+
|
|
4
|
+
interface HeadlineMetaPage {
|
|
5
|
+
path?: string
|
|
6
|
+
category?: string
|
|
7
|
+
date?: string
|
|
8
|
+
dateEnd?: string
|
|
9
|
+
location?: {
|
|
10
|
+
name?: string
|
|
11
|
+
url?: string
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props = defineProps<{
|
|
16
|
+
page?: HeadlineMetaPage
|
|
17
|
+
collection?: keyof PageCollections
|
|
18
|
+
}>()
|
|
19
|
+
|
|
20
|
+
const { has } = useVariant(() => props.collection || 'article')
|
|
21
|
+
|
|
22
|
+
const showCategory = computed(() => has('category').value && Boolean(props.page?.category))
|
|
23
|
+
const showDates = computed(() => has('dates').value && Boolean(props.page?.date))
|
|
24
|
+
const showLocation = computed(() => has('location').value && Boolean(props.page?.location?.name))
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div class="all:flex flex-wrap items-center gap-x-3 gap-y-2 text-muted">
|
|
29
|
+
<HCategory v-if="showCategory" :category="page?.category" />
|
|
30
|
+
|
|
31
|
+
<span v-if="showCategory && showDates" class="all:hidden sm:inline opacity-50">·</span>
|
|
32
|
+
<HDates v-if="showDates" :date="page?.date" :date-end="page?.dateEnd" />
|
|
33
|
+
|
|
34
|
+
<span v-if="(showCategory || showDates) && showLocation" class="all:hidden sm:inline opacity-50">·</span>
|
|
35
|
+
<HLocation v-if="showLocation" :location="page?.location" />
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
@@ -14,13 +14,13 @@ const props = withDefaults(defineProps<{
|
|
|
14
14
|
where?: ArticleFilter[]
|
|
15
15
|
/** Field to sort by. Set to false to disable default sorting. */
|
|
16
16
|
sort?: { field: string, direction: 'ASC' | 'DESC' } | false
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/** Whether to return only published entries. Defaults to true. */
|
|
18
|
+
publishedOnly?: boolean
|
|
19
19
|
/** Optional items per page override */
|
|
20
20
|
itemsPerPage?: number
|
|
21
21
|
}>(), {
|
|
22
22
|
sort: undefined,
|
|
23
|
-
|
|
23
|
+
publishedOnly: true,
|
|
24
24
|
})
|
|
25
25
|
|
|
26
26
|
/** Resolve the configuration for this collection using the smart merger */
|
|
@@ -56,7 +56,7 @@ const categories = computed(() => {
|
|
|
56
56
|
|
|
57
57
|
<template>
|
|
58
58
|
<div class="all:flex flex-col gap-8">
|
|
59
|
-
<div v-if="!props.category" class="border-b border-
|
|
59
|
+
<div v-if="!props.category" class="border-b border-default">
|
|
60
60
|
<UNavigationMenu
|
|
61
61
|
:items="categories"
|
|
62
62
|
highlight
|
|
@@ -69,7 +69,7 @@ const categories = computed(() => {
|
|
|
69
69
|
:collection="props.collection"
|
|
70
70
|
:where="props.where"
|
|
71
71
|
:sort="props.sort"
|
|
72
|
-
:
|
|
72
|
+
:published-only="props.publishedOnly"
|
|
73
73
|
:items-per-page="props.itemsPerPage"
|
|
74
74
|
>
|
|
75
75
|
<template v-for="(_, name) in $slots" #[name]="slotData">
|
|
@@ -1,101 +1,60 @@
|
|
|
1
|
-
<script setup lang="ts" generic="T extends FooterColumnLink">
|
|
2
|
-
import type { FooterColumn, FooterColumnLink, FooterColumnsProps, FooterColumnsSlots, SlotClass } from '@nuxt/ui'
|
|
3
|
-
import { useAppConfig } from '#imports'
|
|
4
|
-
|
|
5
|
-
interface HFooterColumnProps<T extends FooterColumnLink> extends /* @vue-ignore */ FooterColumnsProps<T> {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
function withLayoutClass(base: string, override?: SlotClass): SlotClass {
|
|
26
|
-
if (typeof override === 'function')
|
|
27
|
-
return defaults => [base, override(defaults)]
|
|
28
|
-
|
|
29
|
-
return [base, override]
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const ui = computed(() => ({
|
|
33
|
-
...props.ui,
|
|
34
|
-
root: withLayoutClass('footer-cols-root all:grid grid-flow-row gap-y-12 gap-x-8', props.ui?.root),
|
|
35
|
-
left: withLayoutClass('footer-cols-left', props.ui?.left),
|
|
36
|
-
center: withLayoutClass('footer-cols-center', props.ui?.center),
|
|
37
|
-
right: withLayoutClass('footer-cols-right', props.ui?.right),
|
|
38
|
-
}))
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
>
|
|
53
|
-
<template v-if="
|
|
54
|
-
<slot name="left" />
|
|
55
|
-
</template>
|
|
56
|
-
<template v-if="
|
|
57
|
-
<slot name="right" />
|
|
58
|
-
</template>
|
|
59
|
-
</UFooterColumns>
|
|
60
|
-
</template>
|
|
61
|
-
|
|
62
|
-
<style>
|
|
63
|
-
@import "tailwindcss" source("../..");
|
|
64
|
-
|
|
65
|
-
.footer-cols-left {
|
|
66
|
-
grid-column: span var(--span-left);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.footer-cols-center {
|
|
70
|
-
grid-column: span var(--span-center);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.footer-cols-right {
|
|
74
|
-
grid-column: span var(--span-right);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.footer-cols-left,
|
|
78
|
-
.footer-cols-center,
|
|
79
|
-
.footer-cols-right {
|
|
80
|
-
display: contents;
|
|
81
|
-
}
|
|
82
|
-
.footer-cols-root {
|
|
83
|
-
grid-template-columns: repeat(var(--cols-sm), minmax(0, 1fr));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@media (min-width: theme(--breakpoint-lg)) {
|
|
87
|
-
.footer-cols-root {
|
|
88
|
-
grid-template-columns: repeat(var(--cols-lg), minmax(0, 1fr));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
@media (min-width: theme(--breakpoint-xl)) {
|
|
93
|
-
.footer-cols-root {
|
|
94
|
-
grid-template-columns: repeat(var(--cols-xl), minmax(0, 1fr));
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.footer-cols-root p:last-child {
|
|
99
|
-
margin-bottom: 0;
|
|
100
|
-
}
|
|
101
|
-
</style>
|
|
1
|
+
<script setup lang="ts" generic="T extends FooterColumnLink">
|
|
2
|
+
import type { FooterColumn, FooterColumnLink, FooterColumnsProps, FooterColumnsSlots, SlotClass } from '@nuxt/ui'
|
|
3
|
+
import { useAppConfig } from '#imports'
|
|
4
|
+
|
|
5
|
+
interface HFooterColumnProps<T extends FooterColumnLink> extends /* @vue-ignore */ FooterColumnsProps<T> {
|
|
6
|
+
/** Fixed column count from the lg breakpoint. Defaults to responsive auto-fit. */
|
|
7
|
+
lgCols?: number
|
|
8
|
+
/** Fixed column count from the xl breakpoint. Defaults to responsive auto-fit. */
|
|
9
|
+
xlCols?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const props = defineProps<HFooterColumnProps<T>>()
|
|
13
|
+
const slots = defineSlots<FooterColumnsSlots<T>>()
|
|
14
|
+
const appConfig = useAppConfig()
|
|
15
|
+
|
|
16
|
+
const footerColumns = computed<FooterColumn<T>[]>(() => (
|
|
17
|
+
props.columns
|
|
18
|
+
?? (appConfig.app.links.footer as FooterColumn<T>[] | undefined)
|
|
19
|
+
?? []
|
|
20
|
+
))
|
|
21
|
+
|
|
22
|
+
const hasLeft = Boolean(slots.left)
|
|
23
|
+
const hasRight = Boolean(slots.right)
|
|
24
|
+
|
|
25
|
+
function withLayoutClass(base: string, override?: SlotClass): SlotClass {
|
|
26
|
+
if (typeof override === 'function')
|
|
27
|
+
return defaults => [base, override(defaults)]
|
|
28
|
+
|
|
29
|
+
return [base, override]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const ui = computed(() => ({
|
|
33
|
+
...props.ui,
|
|
34
|
+
root: withLayoutClass('footer-cols-root all:grid grid-flow-row gap-y-12 gap-x-8', props.ui?.root),
|
|
35
|
+
left: withLayoutClass('footer-cols-left', props.ui?.left),
|
|
36
|
+
center: withLayoutClass('footer-cols-center', props.ui?.center),
|
|
37
|
+
right: withLayoutClass('footer-cols-right', props.ui?.right),
|
|
38
|
+
}))
|
|
39
|
+
|
|
40
|
+
const layoutStyle = computed(() => ({
|
|
41
|
+
...(props.lgCols === undefined ? {} : { '--cols-lg': props.lgCols }),
|
|
42
|
+
...(props.xlCols === undefined ? {} : { '--cols-xl': props.xlCols }),
|
|
43
|
+
}))
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<UFooterColumns
|
|
48
|
+
v-bind="props"
|
|
49
|
+
:columns="footerColumns"
|
|
50
|
+
:ui="ui"
|
|
51
|
+
:style="layoutStyle"
|
|
52
|
+
>
|
|
53
|
+
<template v-if="hasLeft" #left>
|
|
54
|
+
<slot name="left" />
|
|
55
|
+
</template>
|
|
56
|
+
<template v-if="hasRight" #right>
|
|
57
|
+
<slot name="right" />
|
|
58
|
+
</template>
|
|
59
|
+
</UFooterColumns>
|
|
60
|
+
</template>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CommandPaletteGroup } from '@nuxt/ui'
|
|
3
|
+
|
|
4
|
+
const appConfig = useAppConfig()
|
|
5
|
+
const { open } = useContentSearch()
|
|
6
|
+
const search = computed(() => appConfig.app.search)
|
|
7
|
+
const searchTerm = ref('')
|
|
8
|
+
const { navigation, files, status, error, load } = useContentSearchData()
|
|
9
|
+
|
|
10
|
+
const groups = computed<CommandPaletteGroup[]>(() => {
|
|
11
|
+
const configuredGroups = search.value.groups ?? []
|
|
12
|
+
|
|
13
|
+
if (!error.value) {
|
|
14
|
+
return configuredGroups
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
id: 'search-error',
|
|
20
|
+
label: search.value.error?.title,
|
|
21
|
+
ignoreFilter: true,
|
|
22
|
+
items: [
|
|
23
|
+
{
|
|
24
|
+
label: search.value.error?.retryLabel,
|
|
25
|
+
description: search.value.error?.description,
|
|
26
|
+
icon: 'i-lucide-refresh-cw',
|
|
27
|
+
onSelect: () => void load(),
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
...configuredGroups,
|
|
32
|
+
]
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
watch(open, (isOpen) => {
|
|
36
|
+
if (isOpen) {
|
|
37
|
+
void load().then(() => {
|
|
38
|
+
if (error.value) {
|
|
39
|
+
console.error('Failed to load the search index.', error.value)
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
}, { immediate: true })
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<UContentSearch
|
|
48
|
+
v-model:search-term="searchTerm"
|
|
49
|
+
:title="search.title"
|
|
50
|
+
:description="search.description"
|
|
51
|
+
:placeholder="search.placeholder"
|
|
52
|
+
:links="search.links"
|
|
53
|
+
:groups="groups"
|
|
54
|
+
:files="files"
|
|
55
|
+
:navigation="navigation"
|
|
56
|
+
:loading="status === 'pending'"
|
|
57
|
+
:fuse="{ resultLimit: search.resultLimit }"
|
|
58
|
+
/>
|
|
59
|
+
</template>
|
|
@@ -13,15 +13,23 @@ withDefaults(defineProps<{
|
|
|
13
13
|
icon: 'i-lucide-log-in',
|
|
14
14
|
})
|
|
15
15
|
|
|
16
|
-
interface StudioSession {
|
|
17
|
-
user?: StudioUser | null
|
|
16
|
+
interface StudioSession {
|
|
17
|
+
user?: StudioUser | null
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface StudioRuntimeConfig {
|
|
21
|
+
dev?: boolean
|
|
22
|
+
route?: string
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
const runtimeConfig = useRuntimeConfig()
|
|
21
26
|
const sessionCheckCookie = useCookie<string | null>('studio-session-check')
|
|
22
27
|
const sessionUser = ref<StudioUser | null | undefined>()
|
|
23
28
|
|
|
24
|
-
const studio = computed(() =>
|
|
29
|
+
const studio = computed<StudioRuntimeConfig>(() => {
|
|
30
|
+
const config = runtimeConfig.public.studio
|
|
31
|
+
return config && typeof config === 'object' ? config as StudioRuntimeConfig : {}
|
|
32
|
+
})
|
|
25
33
|
const studioRoute = computed(() => studio.value.route || '/_studio')
|
|
26
34
|
|
|
27
35
|
onMounted(async () => {
|
|
@@ -1,32 +1,40 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
const props = defineProps<{
|
|
3
|
-
path?: string
|
|
4
|
-
icon?: string
|
|
5
|
-
label?: string
|
|
6
|
-
successIcon?: string
|
|
7
|
-
successLabel?: string
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{
|
|
3
|
+
path?: string
|
|
4
|
+
icon?: string
|
|
5
|
+
label?: string
|
|
6
|
+
successIcon?: string
|
|
7
|
+
successLabel?: string
|
|
8
|
+
errorIcon?: string
|
|
9
|
+
errorLabel?: string
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const { copy } = useClipboard()
|
|
13
|
+
const url = useRequestURL()
|
|
14
|
+
const route = useRoute()
|
|
15
|
+
|
|
16
|
+
async function copyLink() {
|
|
17
|
+
await copy(`${url.origin}${props.path ?? route.path}`, {
|
|
18
|
+
id: 'article-copy-link',
|
|
19
|
+
title: props.successLabel,
|
|
20
|
+
icon: props.successIcon,
|
|
21
|
+
error: {
|
|
22
|
+
id: 'article-copy-link-error',
|
|
23
|
+
title: props.errorLabel,
|
|
24
|
+
icon: props.errorIcon,
|
|
25
|
+
color: 'error',
|
|
26
|
+
},
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<UButton
|
|
33
|
+
:icon="icon"
|
|
34
|
+
variant="ghost"
|
|
35
|
+
color="neutral"
|
|
36
|
+
@click="copyLink"
|
|
37
|
+
>
|
|
38
|
+
{{ label }}
|
|
39
|
+
</UButton>
|
|
40
|
+
</template>
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
v-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PageCollections } from '@nuxt/content'
|
|
3
|
+
import type { ButtonProps } from '@nuxt/ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
links?: PageCollections['event']['links']
|
|
7
|
+
}>()
|
|
8
|
+
|
|
9
|
+
// Nuxt Content preserves the inherited schema shape but widens a few DOM props to unknown.
|
|
10
|
+
const buttonLinks = computed(() => props.links as ButtonProps[] | undefined)
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<UButton
|
|
15
|
+
v-for="(link, index) in buttonLinks"
|
|
16
|
+
:key="index"
|
|
17
|
+
variant="subtle"
|
|
18
|
+
size="sm"
|
|
19
|
+
v-bind="link"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
@@ -11,28 +11,27 @@ const props = defineProps<{
|
|
|
11
11
|
}>()
|
|
12
12
|
|
|
13
13
|
const route = useRoute()
|
|
14
|
-
const collection = computed(() => props.collection
|
|
14
|
+
const collection = computed(() => props.collection)
|
|
15
15
|
const path = computed(() => route.path)
|
|
16
16
|
const key = computed(() => `surround-${String(collection.value)}-${path.value}`)
|
|
17
17
|
|
|
18
18
|
const { data: surround } = await useAsyncData(
|
|
19
19
|
key,
|
|
20
20
|
() => {
|
|
21
|
-
const colName = collection.value as any
|
|
22
21
|
const qc = props.query || {}
|
|
23
22
|
|
|
24
|
-
const fields = (qc.fields || ['title', 'description', '
|
|
23
|
+
const fields = (qc.fields || ['title', 'description', 'published']) as Array<keyof PageCollections[C]>
|
|
25
24
|
const order = qc.order
|
|
26
|
-
const where = qc.where || [{ field: '
|
|
25
|
+
const where = qc.where || [{ field: 'published', operator: '=', value: true }]
|
|
27
26
|
|
|
28
|
-
let query = queryCollectionItemSurroundings(
|
|
27
|
+
let query = queryCollectionItemSurroundings(collection.value, path.value, { fields })
|
|
29
28
|
|
|
30
29
|
where.forEach((filter) => {
|
|
31
|
-
query = query.where(filter.field
|
|
30
|
+
query = query.where(filter.field, filter.operator, filter.value)
|
|
32
31
|
})
|
|
33
32
|
|
|
34
33
|
if (order) {
|
|
35
|
-
query = query.order(order.field as
|
|
34
|
+
query = query.order(order.field as keyof PageCollections[C], order.direction)
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
return query
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ContentTocLink } from '@nuxt/ui'
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
links?: ContentTocLink[]
|
|
6
|
+
title?: string
|
|
7
|
+
}>()
|
|
8
|
+
|
|
9
|
+
const appConfig = useAppConfig()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<UContentToc
|
|
14
|
+
v-if="links?.length"
|
|
15
|
+
:links="links"
|
|
16
|
+
:title="title || appConfig.app.toc?.title"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|