avatar
Published on

Create your own free MDX blog

Authors

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

  1. Fork this dev-blog repository (Selecting master branch)
  2. After forking, wait for Github Actions run successfully to deploy your pages
  3. 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
TypeNameValue
A@185.199.108.153
A@185.199.109.153
A@185.199.110.153
A@185.199.111.153
CNAMEwww<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

SolutionWith custom domainWithout custom domain
next.config.mjsRemove basePath setting if anyAdd basePath: /<repository-name>

2. Your images are not loading

SolutionWith custom domainWithout custom domain
The src property of <Image src="" />/images/<your-image-in-public/images-folder>/<repository-name>/images/<your-image-in-public/images-folder>