Skip to content

Convert site to fully static - remove runtime Contentful API calls#10

Draft
Copilot wants to merge 10 commits intomainfrom
copilot/make-site-static
Draft

Convert site to fully static - remove runtime Contentful API calls#10
Copilot wants to merge 10 commits intomainfrom
copilot/make-site-static

Conversation

Copy link

Copilot AI commented Jan 15, 2026

Site was using ISR and SSR to sync content from Contentful at runtime (hourly in prod, every 30s in staging). Now fully static - content only fetched at build time.

Changes

Removed Incremental Static Regeneration

  • Deleted revalidate from all getStaticProps
  • Changed fallback: 'blocking'fallback: false in all getStaticPaths
  • Pages now generated once at build time only

Removed Server-Side Rendering

  • Deleted /pages/preview/ directory and all getServerSideProps usage
  • Preview functionality no longer available

Converted Runtime API Routes to Build-Time

  • Created utils/sitemap.ts - generates sitemap during Next.js build
  • Modified pages/api/sitemap.ts - now serves static file instead of generating dynamically
  • Sitemap generation called from pages/index.tsx getStaticProps
  • Restored sitemap rewrite in next.config.js
// Build now works like this:
// yarn build → next build
// During build, index.tsx getStaticProps calls:
await generateSitemap(); // from utils/sitemap.ts
// This generates public/sitemap.xml and RSS feeds
// Then /api/sitemap serves the static file

Cleanup

  • Removed CONTENT_REVALIDATE_RATE constant
  • Updated .gitignore to exclude generated sitemap/RSS

Impact

Breaking: Content updates now require full rebuild. No automatic runtime sync. Preview functionality removed.

Approach: Matches oxen-website implementation - sitemap generated during Next.js build, not as separate script.

Original prompt

This site needs to be made entirely static, it should not make any contentful api requests after it is built. A full manual rebuild should be required to update content.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 7 commits January 15, 2026 23:11
Co-authored-by: Aerilym <5667907+Aerilym@users.noreply.github.com>
Co-authored-by: Aerilym <5667907+Aerilym@users.noreply.github.com>
Co-authored-by: Aerilym <5667907+Aerilym@users.noreply.github.com>
Co-authored-by: Aerilym <5667907+Aerilym@users.noreply.github.com>
Co-authored-by: Aerilym <5667907+Aerilym@users.noreply.github.com>
Co-authored-by: Aerilym <5667907+Aerilym@users.noreply.github.com>
Co-authored-by: Aerilym <5667907+Aerilym@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove API requests and make site static Convert site to fully static - remove runtime Contentful API calls Jan 15, 2026
Copilot AI requested a review from Aerilym January 15, 2026 23:27
@Aerilym
Copy link
Collaborator

Aerilym commented Jan 15, 2026

@copilot Update to do the same sitemap stuff as this PR on the oxen io site oxen-io/oxen-website#69

Copy link
Author

Copilot AI commented Jan 15, 2026

@copilot Update to do the same sitemap stuff as this PR on the oxen io site oxen-io/oxen-website#69

Done! Updated to match oxen-website approach (commit 1d69cfc):

Changes:

  • Moved sitemap generation from scripts/ to utils/sitemap.ts
  • Now called from pages/index.tsx getStaticProps during Next.js build
  • Restored pages/api/sitemap.ts to serve the static file
  • Added sitemap rewrite back to next.config.js
  • Removed separate build script

Build now works the same way as oxen-website - sitemap generated during Next.js build, not as a separate pre-build step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants