- Published on
Create your own free MDX blog
- Authors
- Name
- sinhnt
- @sinhnt
What is this?
- A blog allow to write a post in Github Markdown Format (GFM)
- Static Site Generation with Next.js
- Free hosting with Github Pages
- Optional custom domain buy at Tenten.vn
Prerequisites
- A Github account
- Basic knowledge of Markdown and Next.js so that you can customize the blog to your liking
Steps
- Fork this dev-blog repository (Selecting master branch)
- After forking, wait for Github Actions run successfully to deploy your pages
- Your blog is now live at
https://<your-github-username>.github.io/<your-repository-name>
Custom domains (Skip if you don't need custom domain)
- Buy your custom domain at Tenten.vn or any other domain provider
- Upload Personal Card and Registration form to activate your custom domain (Online)
- Access Github Pages settings and add your custom domain
- Access the Domain Provider and add the A record CNAME record to point to Github Pages. Double check the Github IP address here
Type | Name | Value |
---|---|---|
A | @ | 185.199.108.153 |
A | @ | 185.199.109.153 |
A | @ | 185.199.110.153 |
A | @ | 185.199.111.153 |
CNAME | www | <your-github-username>.github.io |
- Wait for a few minutes and your blog is now live at
https://<your-custom-domain>
Common issues
1. Your site is not styled properly
Solution | With custom domain | Without custom domain |
---|---|---|
next.config.mjs | Remove basePath setting if any | Add basePath: /<repository-name> |
2. Your images are not loading
Solution | With custom domain | Without custom domain |
---|---|---|
The src property of <Image src="" /> | /images/<your-image-in-public/images-folder> | /<repository-name>/images/<your-image-in-public/images-folder> |