Moving from Wordpress to github pages
[updated] 13 Oct 2018
I was finally prodded into action when my wordpress blog site certificate expired.
Using a few excellent resources available on the interwebs, I was able to run (generate in jekyll) the site locally on a Windows 10 machine and then push it to github (richardborges.github.io), which hosts for free !
Running the site locally.
The main steps where 0. Make sure you have Bash on Ubuntu on Windows and have visited jekyll on Windows
- Install jekyll on Windows 10 bash ( Bash on Ubuntu on Windows ) using instructions at https://jekyllrb.com/docs/windows/
- I used my d drive to create a directory for my blog site (appears in mnt in bash)
- I liked the Cayman theme so downloaded it from github
- How to run locally ?
- Open a bash shell window ( not git bash, the desktop app, but bash, the command). You can now mount the drive where your blog is saved (locally)
cd /mnt/d/RichardBorges.github.io
==> i.e. my local directory on d drive where the cayman theme has been unzipped 3.
bundle exec jekyll serve
, this starts up the website locally 4. browse to http://127.0.0.1:4000 5. add new posts 6. rinse and repeat
Running the site at richarborges.github.io
- Commit your local changes to your local github repository. As the site is generated locally by jekyll, I only commit the fully built site to github. The fully build website is found at _site/
- In bash shell
cd _site/
git add .
git commit -m "This is the initial commit of my blog"
git remote add origin https://github.com/richardborges/richardborges.github.io.git
git push -u origin master
- If the remote repository ( at github ) has not been setup, check using
git remote -v
git config --global user.name "richardborges"
git config --global user.email "richardborges@company.com"
git remote -v
- push your changes to remote
git push -u origin master
You should now be able to see your site at richardborges.github.io
Pointing richardborges.net to richardborges.github.io
-
Firstly I added https://github.com/richardborges/richardborges.github.io.git . Go to settings » custom domain
This creates a CNAME file in the remote repository ( remember to pull it to local later on) -
We need to find the IP address of the remote, so use dig in bash shell
dig richardborges.github.io
3. Now we need to update our DNS record ( at the the DNS hoster to point to the github.io IP address) Also see Setting up an apex domain 4. Now I can use richardborges.net to visit my blog. Yay.
These websites proved invaluable…
Build A Blog With Jekyll And GitHub Pages
How to install Jekyll on Windows 10 with “Windows subsystem for Linux”
Developers can run Bash Shell and user-mode Ubuntu Linux binaries on Windows 10
Windows Subsystem for Linux out of Beta!
Transform your plain text into static websites and blogs.
Using Jekyll as a static site generator with GitHub Pages
How-to: Migrating Blog from WordPress to Jekyll, and Host on Github