Add nuxt content supports

This commit is contained in:
2025-08-25 21:11:45 +07:00
parent 61181264f8
commit 4f6cb2e12b
2 changed files with 103 additions and 77 deletions
+31
View File
@@ -0,0 +1,31 @@
import { defineContentConfig, defineCollection, z } from '@nuxt/content'
import { asSitemapCollection } from '@nuxtjs/sitemap/content'
export default defineContentConfig({
collections: {
posts: defineCollection(
asSitemapCollection({
type: 'page',
source: '**/posts/**/*.md',
schema: z.object({
coverImage: z.string(),
tags: z.array(z.string()),
dateCreated: z.string().datetime(),
dateUpdated: z.string().datetime(),
}),
})
),
projects: defineCollection(
asSitemapCollection({
type: 'page',
source: '**/projects/**/*.md',
schema: z.object({
logo: z.string(),
tags: z.array(z.string()),
dateCreated: z.string().datetime(),
dateUpdated: z.string().datetime(),
}),
})
)
},
})
+4 -9
View File
@@ -15,7 +15,7 @@ export default defineNuxtConfig({
baseUrl: process.env.NUXT_PUBLIC_BASE_URL
}
},
modules: ['@nuxt/content', '@nuxt/image', '@nuxt/eslint', '@nuxtjs/color-mode', '@nuxt/icon'],
modules: ['@nuxt/content', '@nuxtjs/sitemap', '@nuxt/image', '@nuxt/eslint', '@nuxtjs/color-mode', '@nuxt/icon'],
app: {
head: {
titleTemplate: `%s / ${process.env.NUXT_PUBLIC_SITE_NAME || 'thawia.ng'}`,
@@ -56,16 +56,11 @@ export default defineNuxtConfig({
{ rel: 'icon', type: 'image/vnd.microsoft.icon', href: '/favicon.ico' },
// { rel: 'stylesheet', href: '/style.css' },
// TYPEFACES
// { rel: 'stylesheet', href: '/fonts/roboto/roboto.css' },
{ rel: 'stylesheet', href: '/fonts/tiktoksans/tiktoksans.css' },
// { rel: 'stylesheet', href: '/fonts/noto/thai/noto+sans.css' },
{ rel: 'stylesheet', href: '/fonts/noto/mono/noto+sans+mono.css' },
// { rel: 'stylesheet', href: '/fonts/roboto/mono/mono.css' },
// { rel: 'stylesheet', href: '/fonts/roboto/serif/serif.css' },
{ rel: 'stylesheet', href: '/fonts/noto/thai/noto+sans+thai.css' },
{ rel: 'stylesheet', href: '/fonts/inter/inter.css' },
],
script: [
//{ src: '/js/ripple.js', type: 'text/javascript', defer: true }
// { src: '/js/ripple.js', type: 'text/javascript', defer: true },
{ src: '/js/nav.js', type: 'text/javascript', defer: true }
]
},
},