[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
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: apply `swr` rules + render confs at runtime

+9 -7
+9 -5
nuxt.config.ts
··· 4 4 import { extendViteConfig } from 'nuxt/kit' 5 5 import { isTest } from 'std-env' 6 6 import type { HmrOptions } from 'vite' 7 + import { pageMeta } from './modules/shared/page-meta' 7 8 8 9 export default defineNuxtConfig({ 9 10 modules: [ ··· 158 159 routeRules: { 159 160 '/admin/**': { prerender: false }, 160 161 '/api/admin/**': { prerender: false }, 161 - '/api/talks': { swr: 1 }, 162 - '/api/upcoming-conferences': { swr: 1 }, 163 - '/api/uses': { swr: 1 }, 164 - '/api/current-location': { swr: 1 }, 165 - '/uses.md': { swr: 1 }, 162 + ...Object.fromEntries(Object.keys(pageMeta).flatMap(path => [ 163 + [path, { swr: 60 * 60 }], 164 + [path + '.md', { swr: 60 * 60 }], 165 + ])), 166 + '/api/talks': { swr: 60 * 60 }, 167 + '/api/upcoming-conferences': { swr: 60 * 60 }, 168 + '/api/uses': { swr: 60 * 60 }, 169 + '/api/current-location': { swr: 60 * 5 }, 166 170 '/api/sponsors': { prerender: true }, 167 171 '/api/hi': { cors: true }, 168 172 '/feed.xml': { redirect: '/rss.xml' },
-2
server/api/upcoming-conferences.get.ts
··· 4 4 import type { UpcomingConference } from '../utils/cms/talks' 5 5 6 6 export default defineEventHandler(async event => { 7 - if (!import.meta.dev && !import.meta.prerender) return [] 8 - 9 7 const upcomingConferences = await getUpcomingTalks(event) 10 8 11 9 const formatter = new Intl.DateTimeFormat('en', {