1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-10-18 21:34:25 -04:00

pre-render optimizations

This commit is contained in:
2025-03-14 12:51:18 -04:00
parent e162d6a46c
commit 3932660acc
57 changed files with 305 additions and 318 deletions

17
lib/config/constants.ts Normal file
View File

@@ -0,0 +1,17 @@
// path to directory with .mdx files, relative to project root
export const POSTS_DIR = "notes";
// path to an image used in various places to represent the site, relative to project root
// IMPORTANT: must be included in next.config.ts under "outputFileTracingIncludes"
export const AVATAR_PATH = "app/opengraph-image.jpg";
// maximum width of content wrapper (e.g. for images) in pixels
export const MAX_WIDTH = 865;
// same logic as metadataBase: https://nextjs.org/docs/app/api-reference/functions/generate-metadata#default-value
export const BASE_URL =
process.env.NEXT_PUBLIC_VERCEL_ENV === "production" && process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`
: process.env.NEXT_PUBLIC_VERCEL_ENV === "preview" && process.env.NEXT_PUBLIC_VERCEL_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: `http://localhost:${process.env.PORT || 3000}`;