kmcom-nuxt-layers 1.6.34 → 1.6.36
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/layers/content/app/app.config.ts +7 -1
- package/layers/content/app/composables/createPortfolioComposables.ts +32 -0
- package/layers/content/app/pages/blog/[slug].vue +5 -0
- package/layers/content/app/pages/blog/index.vue +5 -0
- package/layers/content/app/pages/gallery/[slug]/[imageId].vue +5 -0
- package/layers/content/app/pages/gallery/[slug]/index.vue +5 -0
- package/layers/content/app/pages/gallery/index.vue +5 -0
- package/layers/content/app/pages/portfolio/[slug].vue +5 -0
- package/layers/content/app/pages/portfolio/index.vue +5 -0
- package/layers/content/app/types/app-config.d.ts +5 -0
- package/package.json +7 -7
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import type { PortfolioQueryOptions } from '../types/content'
|
|
3
|
+
|
|
4
|
+
export function createPortfolioComposables(collectionName: string) {
|
|
5
|
+
function useItems(options: PortfolioQueryOptions = {}) {
|
|
6
|
+
const { featured, tags, limit } = options
|
|
7
|
+
|
|
8
|
+
return useContentData(`${collectionName}-items`, async () => {
|
|
9
|
+
let items = await queryCollection(collectionName).order('year', 'DESC').all()
|
|
10
|
+
|
|
11
|
+
if (featured !== undefined) {
|
|
12
|
+
items = items.filter((item) => item.featured === featured)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (tags?.length) {
|
|
16
|
+
items = items.filter((item) => item.tags?.some((tag: string) => tags.includes(tag)))
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (limit) {
|
|
20
|
+
items = items.slice(0, limit)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return items
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function useItem(slug: string) {
|
|
28
|
+
return useCollectionItem(collectionName, slug)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return { useItems, useItem }
|
|
32
|
+
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
definePageMeta({ name: 'content-blog-slug' })
|
|
3
3
|
|
|
4
|
+
const { contentLayer } = useAppConfig()
|
|
5
|
+
if (contentLayer?.sections?.blog === false) {
|
|
6
|
+
throw createError({ statusCode: 404, statusMessage: 'Not Found' })
|
|
7
|
+
}
|
|
8
|
+
|
|
4
9
|
const route = useRoute()
|
|
5
10
|
const slug = route.params.slug as string
|
|
6
11
|
</script>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
const { contentLayer } = useAppConfig()
|
|
3
|
+
if (contentLayer?.sections?.blog === false) {
|
|
4
|
+
throw createError({ statusCode: 404, statusMessage: 'Not Found' })
|
|
5
|
+
}
|
|
6
|
+
|
|
2
7
|
useSeoMeta({
|
|
3
8
|
title: 'Blog',
|
|
4
9
|
description: 'Latest articles and updates',
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
const { contentLayer } = useAppConfig()
|
|
3
|
+
if (contentLayer?.sections?.gallery === false) {
|
|
4
|
+
throw createError({ statusCode: 404, statusMessage: 'Not Found' })
|
|
5
|
+
}
|
|
6
|
+
|
|
2
7
|
const route = useRoute()
|
|
3
8
|
const slug = route.params.slug as string
|
|
4
9
|
const index = Number(route.params.imageId)
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
const { contentLayer } = useAppConfig()
|
|
3
|
+
if (contentLayer?.sections?.gallery === false) {
|
|
4
|
+
throw createError({ statusCode: 404, statusMessage: 'Not Found' })
|
|
5
|
+
}
|
|
6
|
+
|
|
2
7
|
const route = useRoute()
|
|
3
8
|
const slug = route.params.slug as string
|
|
4
9
|
</script>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
const { contentLayer } = useAppConfig()
|
|
3
|
+
if (contentLayer?.sections?.gallery === false) {
|
|
4
|
+
throw createError({ statusCode: 404, statusMessage: 'Not Found' })
|
|
5
|
+
}
|
|
6
|
+
|
|
2
7
|
useSeoMeta({
|
|
3
8
|
title: 'Gallery',
|
|
4
9
|
description: 'Photo collections and visual work',
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
const { contentLayer } = useAppConfig()
|
|
3
|
+
if (contentLayer?.sections?.portfolio === false) {
|
|
4
|
+
throw createError({ statusCode: 404, statusMessage: 'Not Found' })
|
|
5
|
+
}
|
|
6
|
+
|
|
2
7
|
const route = useRoute()
|
|
3
8
|
const slug = route.params.slug as string
|
|
4
9
|
</script>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
const { contentLayer } = useAppConfig()
|
|
3
|
+
if (contentLayer?.sections?.portfolio === false) {
|
|
4
|
+
throw createError({ statusCode: 404, statusMessage: 'Not Found' })
|
|
5
|
+
}
|
|
6
|
+
|
|
2
7
|
useSeoMeta({
|
|
3
8
|
title: 'Portfolio',
|
|
4
9
|
description: 'Featured projects and work',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kmcom-nuxt-layers",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.36",
|
|
5
5
|
"description": "Composable Nuxt 4 layers for building scalable Vue applications",
|
|
6
6
|
"files": [
|
|
7
7
|
"layers/*/nuxt.config.ts",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"@eslint/json": "^1.2.0",
|
|
98
98
|
"@eslint/markdown": "^8.0.1",
|
|
99
99
|
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
|
|
100
|
-
"@iconify-json/lucide": "^1.2.
|
|
100
|
+
"@iconify-json/lucide": "^1.2.107",
|
|
101
101
|
"@netlify/nuxt": "0.3.1",
|
|
102
102
|
"@nuxt/eslint": "^1.15.2",
|
|
103
103
|
"@nuxt/fonts": "^0.14.0",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"@perplex-digital/stylelint-config": "^17.4.0",
|
|
108
108
|
"@pinia/nuxt": "^0.11.3",
|
|
109
109
|
"@types/node": "^25.6.0",
|
|
110
|
-
"@typescript-eslint/eslint-plugin": "^8.59.
|
|
111
|
-
"@typescript-eslint/parser": "^8.59.
|
|
110
|
+
"@typescript-eslint/eslint-plugin": "^8.59.3",
|
|
111
|
+
"@typescript-eslint/parser": "^8.59.3",
|
|
112
112
|
"@vue/eslint-config-typescript": "^14.7.0",
|
|
113
113
|
"@vueuse/core": "^14.3.0",
|
|
114
114
|
"@vueuse/nuxt": "^14.3.0",
|
|
@@ -144,12 +144,12 @@
|
|
|
144
144
|
"stylelint-no-unsupported-browser-features": "^8.1.1",
|
|
145
145
|
"stylelint-prettier": "^5.0.3",
|
|
146
146
|
"tailwindcss": "^4.2.4",
|
|
147
|
-
"turbo": "^2.9.
|
|
147
|
+
"turbo": "^2.9.14",
|
|
148
148
|
"typescript": "^6.0.3",
|
|
149
149
|
"vite-plugin-checker": "^0.13.0",
|
|
150
|
-
"vitest": "^4.1.
|
|
150
|
+
"vitest": "^4.1.6",
|
|
151
151
|
"vue": "latest",
|
|
152
|
-
"vue-tsc": "^3.2.
|
|
152
|
+
"vue-tsc": "^3.2.9",
|
|
153
153
|
"zod": "^4.4.3",
|
|
154
154
|
"zod-to-json-schema": "^3.25.2"
|
|
155
155
|
},
|