mirror of
https://github.com/waynesutton/markdown-site.git
synced 2026-01-12 04:09:14 +00:00
2.9 KiB
2.9 KiB
Deployment
Type: page Date: 2026-01-07
Deployment
Netlify setup
- Connect GitHub repo to Netlify
- Build command:
npm ci --include=dev && npx convex deploy --cmd 'npm run build' - Publish directory:
dist - Add env variables:
CONVEX_DEPLOY_KEY(from Convex Dashboard > Project Settings > Deploy Key)VITE_CONVEX_URL(your production Convex URL, e.g.,https://your-deployment.convex.cloud)
Both are required: deploy key for builds, URL for edge function runtime.
Convex production
npx convex deploy
Edge functions
RSS, sitemap, and API routes are handled by Netlify Edge Functions in netlify/edge-functions/. They dynamically read VITE_CONVEX_URL from the environment. No manual URL configuration needed.
Convex schema
// convex/schema.ts
export default defineSchema({
posts: defineTable({
slug: v.string(),
title: v.string(),
description: v.string(),
content: v.string(),
date: v.string(),
published: v.boolean(),
tags: v.array(v.string()),
readTime: v.optional(v.string()),
image: v.optional(v.string()),
excerpt: v.optional(v.string()), // For card view
featured: v.optional(v.boolean()), // Show in featured section
featuredOrder: v.optional(v.number()), // Order in featured (lower = first)
authorName: v.optional(v.string()), // Author display name
authorImage: v.optional(v.string()), // Author avatar image URL
lastSyncedAt: v.number(),
})
.index("by_slug", ["slug"])
.index("by_published", ["published"])
.index("by_featured", ["featured"]),
pages: defineTable({
slug: v.string(),
title: v.string(),
content: v.string(),
published: v.boolean(),
order: v.optional(v.number()),
excerpt: v.optional(v.string()), // For card view
image: v.optional(v.string()), // Thumbnail for featured cards
featured: v.optional(v.boolean()), // Show in featured section
featuredOrder: v.optional(v.number()), // Order in featured (lower = first)
authorName: v.optional(v.string()), // Author display name
authorImage: v.optional(v.string()), // Author avatar image URL
lastSyncedAt: v.number(),
})
.index("by_slug", ["slug"])
.index("by_published", ["published"])
.index("by_featured", ["featured"]),
});
Troubleshooting
Posts not appearing
- Check
published: truein frontmatter - Run
npm run syncfor development - Run
npm run sync:prodfor production - Use
npm run sync:allornpm run sync:all:prodto sync content and update discovery files together - Verify in Convex dashboard
RSS/Sitemap errors
- Verify
VITE_CONVEX_URLis set in Netlify - Test Convex HTTP URL:
https://your-deployment.convex.site/rss.xml - Check edge functions in
netlify/edge-functions/
Build failures
- Verify
CONVEX_DEPLOY_KEYis set in Netlify - Ensure
@types/nodeis in devDependencies - Build command must include
--include=dev - Check Node.js version (18+)