1 min read

Personal blog with Next.js and Github api

I’ve transfer my blog many times. but the problem is every time have a lot of trouble. I have to transfer code, and transfer database, and…

I’ve transfer my blog many times. but the problem is every time have a lot of trouble. I have to transfer code, and transfer database, and set right permission(if php), and set database permission.

I think it is always a trouble if you have to setup a blog with a backend database if you are only use it as a personal blog.


Idea

So an idea comes that if i can only use it as a git repo to do all the things. I think Github page can do it totally, but it’s all static page which i don’t want every time i post my blog i have to link it manually. And Github page offers Jekyll as it’s blog solution. It’s good for this basic requirement but I’m now using React so I’m think of if i can use it as React as frontend(with Server Side Rendering) and using Github API to grab posts info.

In Github API, we can grab all files name under a folder and we can also fetch a content of a file in a repo. So i think it’s a good start, i can post my blog as Markdown into a post folder and every time i just need to push my code to Github, it will update automatically.


Working on code

Bear with me I don’t have much time to do this side project and i will update how i did after my code.