Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/danielroe/roe.dev. This is the code and content for my personal website, built in Nuxt. roe.dev
Something went wrong. Try again.
TypeScript
at feat/nuxt-v5
12345678910111213141516171819202122232425262728293031323334353637383940import { defineEventHandler } from 'nuxt/server'
import { pageMeta } from '#md-page-meta'
import { getProjects } from '../utils/cms/projects'
export default defineEventHandler(async event => { if (import.meta.test) { return mdResponse(event, '') }
const categories = await getProjects()
const lines = [ mdFrontmatter('/projects', pageMeta['/projects']!), '', ]
for (const category of categories) { lines.push(`## ${category.title}`) lines.push('')
for (const item of category.items) { const primaryUrl = item.url || item.repo const name = primaryUrl ? `[${item.name}](${primaryUrl})` : item.name const desc = item.description ? ` — ${item.description}` : '' const archived = item.archived ? ' _(archived)_' : '' lines.push(`- **${name}**${archived}${desc}`)
if (item.repo && item.repo !== item.url) { lines.push(` [Source](${item.repo})`) } }
lines.push('') }
return mdResponse(event, lines.join('\n'))})