github pages revamp plan
12 Apr 2025 · 4 min · webdev · nextjs
GitHub Pages Migration Plan - COMPLETED ✅
Overview
This document outlines the steps that were taken to migrate the cyberpunk-blog project to the existing GitHub Pages repository (jaidenamari.github.io) while preserving both the new blog features and existing content/workflow.
I wanted a fresh design using some of the new things I've been learning using next.js and radix ui. I'm still not convinced I like next.js, for anything complex, but it seems to be suitable for quickly standing up new designs.
I don't have any projects on my git that I can currently share with the public, but I will eventually get on documenting some of my coding projects as they come to fruition here. I'll improve the aesthetic over time. I was curious about experimenting with the three.js library to add some 3d elements, but my first attempts are very shy of what I was hoping for, so I just added some basic animation for now.
Future Improvements
- Improve placeholder logo, add favicon.
- Actually implement three.js to create animated cyber forest and 3d stars in sky.
- Update colors to be a bit softer and more ephemeral, the effect on the page of moving particles should feel more spore like.
- Add projects from my github as I complete them
- Add notes and various study materials as I'm researching and learning about new cybersecurity, and dev concepts.
- Get some digital art made for blog posts, and Hero.
Current State
- New cyberpunk-blog: Next.js project with modern aesthetics
- Existing blog: Hugo-based site with Obsidian workflow for content
- The existing blog has content in
content/posts/as markdown files with YAML frontmatter
Migration Goals
- Preserve existing blog posts and content ✅
- Maintain Obsidian workflow for content creation ✅
- Update the aesthetics with the new cyberpunk forest design ✅
- Ensure a smooth transition without data loss ✅
Step-by-Step Migration Plan
Phase 1: Repository Setup ✅
- Initialize git in the cyberpunk-blog project
- Create a new branch for the migration work
- Clone the existing GitHub Pages repo to a temporary location
- Analyze the current GitHub Pages repo structure
Phase 2: Content Integration ✅
- Create a proper content directory structure in the cyberpunk-blog project
- Update the blog.ts file to read actual markdown files instead of mock data
- Copy existing blog posts from the GitHub Pages repo to the cyberpunk-blog project
- Ensure the frontmatter in the markdown files is compatible with the new system
Phase 3: Next.js Configuration for GitHub Pages ✅
- Configure Next.js for static export (GitHub Pages requires static files)
- Add
output: 'export'to the next.config.mjs file - Configure basePath if needed (if the site will be at a subpath)
- Create a .nojekyll file to prevent GitHub Pages from processing with Jekyll
- Create a GitHub Actions workflow file for automated builds and deployments
Phase 4: Obsidian Workflow Integration ✅
- Ensure the markdown parser can handle Obsidian-specific features
- Set up a content directory structure that works well with Obsidian
- Document the workflow for creating and editing content using Obsidian
Phase 5: Integration Testing ✅
- Test the content rendering with existing blog posts
- Verify Obsidian workflow compatibility
- Test the build and export process
- Make necessary adjustments to styling and formatting
Phase 6: Deployment ✅
- Add the GitHub Pages repo as a remote in the cyberpunk-blog project
- Push the changes to a new branch in the GitHub Pages repo
- Create a backup of the current GitHub Pages site
- Deploy to the main branch when everything is verified
Phase 7: Post-Deployment ✅
- Verify all content is accessible and correctly rendered
- Ensure the Obsidian workflow continues to function
- Update documentation for the new content management process
- Monitor for any issues
Technical Implementation Details
Content System Modifications
We modified lib/blog.ts to:
- Read markdown files from the file system ✅
- Parse frontmatter correctly ✅
- Support the existing YAML frontmatter format from Hugo ✅
Required Dependencies
gray-matterfor parsing frontmatter in markdown files ✅fsfor reading files from the filesystem ✅- Already have
react-markdownfor rendering ✅
GitHub Pages Configuration
GitHub Pages with Next.js requires:
- Static HTML export ✅
- A .nojekyll file to prevent Jekyll processing ✅
- Proper asset path configuration ✅
Rollback Plan
In case of critical issues:
- Revert to the previous commit in the GitHub Pages repo
- Re-deploy the previous version
- Address issues in the cyberpunk-blog project before attempting migration again
Conclusion
The migration from Hugo to Next.js was successfully completed. The new site maintains compatibility with the Obsidian workflow while providing a modern cyberpunk aesthetic. All existing content has been preserved, and the site is now deployed to GitHub Pages using GitHub Actions for automated deployment.