A modern portfolio website built with Next.js, featuring dynamic content management through Ghost CMS integration.
- 🏗️ Built with Next.js 14 and TypeScript
- 🎨 Styled with Tailwind CSS
- 📝 Dynamic content management with Ghost CMS
- 🚀 Optimized for both Vercel and GitHub Pages deployment
- 📱 Responsive design
- 🔍 SEO optimized with automatic sitemap generation
For Ghost CMS integration, you need to configure the following environment variables:
GHOST_URL=https://your-ghost-site.com
GHOST_CONTENT_API_KEY=your_content_api_key_here- GHOST_URL: Your Ghost site URL (e.g.,
https://yourblog.ghost.io) - GHOST_CONTENT_API_KEY:
- Go to your Ghost Admin panel
- Navigate to Settings → Integrations
- Click "Add custom integration"
- Copy the "Content API Key"
In your Vercel dashboard:
- Go to your project settings
- Navigate to "Environment Variables"
- Add the above environment variables
Create a .env.local file in your project root:
GHOST_URL=https://your-ghost-site.com
GHOST_CONTENT_API_KEY=your_content_api_key_hereThis configuration enables serverless functions to fetch Ghost CMS content on-demand:
npm run buildVercel will automatically deploy with dynamic page generation enabled.
For static deployment to GitHub Pages:
npm run build:githubThis generates a static export of all Ghost CMS pages at build time.
npm run devOpen http://localhost:3000 to view the site.
- Dynamic Routes: The
[slug]route dynamically fetches content from Ghost CMS - Conflict Resolution: Built-in protection against route conflicts with existing Next.js pages
- Serverless Functions: On Vercel, pages are generated on-demand using serverless functions
- Static Generation: For GitHub Pages, all pages are pre-built at deployment time
The site automatically pulls pages from your Ghost CMS and makes them available at yoursite.com/[slug]. Pages that conflict with existing routes (like /about, /consulting) are automatically excluded.
This example supports deloying a static Next.js application (using next export) to GitHub Pages.
Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example github-pages nextjs-github-pages
# or
yarn create next-app --example github-pages nextjs-github-pages
# or
pnpm create next-app --example github-pages nextjs-github-pages- Create a new public GitHub repository.
- Edit
next.config.jsto match your GitHub repository name. - Push the starter code to the
mainbranch. - Run the
deployscript (e.g.npm run deploy) to create thegh-pagesbranch. - On GitHub, go to Settings > Pages > Source, and choose
gh-pagesas the branch with the/rootfolder. Hit Save. - Make a change.
- Run the
deployscript again to push the changes to GitHub Pages.
Congratulations! You should have a URL like:
https://<github-user-name>.github.io/<github-project-name>/