kmcom-nuxt-layers 1.6.35 → 1.6.37

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.
@@ -1,9 +1,9 @@
1
- export default defineAppConfig({
1
+ export default {
2
2
  contentLayer: {
3
3
  sections: {
4
- blog: true as boolean,
5
- portfolio: true as boolean,
6
- gallery: true as boolean,
4
+ blog: true,
5
+ portfolio: true,
6
+ gallery: true,
7
7
  },
8
8
  },
9
- })
9
+ }
@@ -2,8 +2,9 @@
2
2
  // @ts-nocheck
3
3
  import type { PortfolioCollectionItem } from '@nuxt/content'
4
4
 
5
- const { slug } = defineProps<{
5
+ const { slug, collection = 'portfolio' } = defineProps<{
6
6
  slug: string
7
+ collection?: string
7
8
  }>()
8
9
 
9
10
  const asPortfolio = (item: unknown) => item as PortfolioCollectionItem
@@ -11,9 +12,9 @@ const asPortfolio = (item: unknown) => item as PortfolioCollectionItem
11
12
 
12
13
  <template>
13
14
  <NuxtContentDetail
14
- collection="portfolio"
15
+ :collection
15
16
  :slug
16
- not-found-message="Portfolio item not found"
17
+ not-found-message="Item not found"
17
18
  hide-toc
18
19
  >
19
20
  <template #headline="{ item }">
@@ -2,18 +2,20 @@
2
2
  // @ts-nocheck
3
3
  import type { PortfolioQueryOptions } from '../../types/content'
4
4
 
5
- const { options = {} } = defineProps<{
5
+ const { options = {}, collection = 'portfolio' } = defineProps<{
6
6
  options?: PortfolioQueryOptions
7
+ collection?: string
7
8
  }>()
8
9
 
9
- const { data: items, status } = await usePortfolioItems(options)
10
+ const { useItems } = createPortfolioComposables(collection)
11
+ const { data: items, status } = await useItems(options)
10
12
  </script>
11
13
 
12
14
  <template>
13
15
  <NuxtContentList
14
16
  :status="status"
15
17
  :has-items="!!items?.length"
16
- empty-message="No portfolio items found"
18
+ empty-message="No items found"
17
19
  >
18
20
  <UPageGrid>
19
21
  <UPageCard
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kmcom-nuxt-layers",
3
3
  "private": false,
4
- "version": "1.6.35",
4
+ "version": "1.6.37",
5
5
  "description": "Composable Nuxt 4 layers for building scalable Vue applications",
6
6
  "files": [
7
7
  "layers/*/nuxt.config.ts",