- https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll
- https://yxtay.github.io/blog/understanding-jekyll-and-github-pages/
Jekyll is a Ruby application that transforms markdown files into a static website. Install it locally by following the instructions here: https://jekyllrb.com/docs/installation/macos/
- Create a new repo in github and clone to your local machine.
- In your local copy of the repo run the following command:
jekyll new --skip-bundle . --force
This will create a bunch of files that specify the website.
-
In the
Gemfile, comment out the linegem "jekyll", "~> 4.2.2"and uncomment the linegem "github-pages", group: :jekyll_plugins -
In the
_config.ymlfile, comment out the lines below:
#baseurl: ""
#url: ""
Why? This is because Github Pages will automatically set these. Before removing these lines, my page would not build on the server.
- lastly, run
bundle install
This will 'build' the website locally.
Run the following commands in order to test the website locally:
bundle add webrick
bundle exec jekyll serve
This will output a local URL. Paste this into your browser to preview the website.
- commit all local changes and push them to master.
- on github, deploy the website under Settings --> Pages --> Deploy from branch, and select the branch (e.g. master) you want to deploy from.
- each time you push new content, it will automatically be deployed to your website within a few minutes.
- you can also force a rebuild by clicking on the 'deployed' link and then on 're-run all jobs'
- Go to domains.google.com to check if the domain name you want is available. If so, purchase it.
- Follow instructions from this link to connect the Github page with the Google domain: https://dev.to/trentyang/how-to-setup-google-domain-for-github-pages-1p58
Note:
⚠ The CNAME record should always point to <user>.github.ioor <organization>.github.io, excluding the repository name.
- To confirm everything is working, type
dig www.xyz.com +nostats +nocomments +nocmd
If the output looks like this:
> dig www.xyz.com +nostats +nocomments +nocmd
www.samflender.com. 3600 IN CNAME xyz.github.io.
sflender.github.io. 3600 IN A 185.199.108.153
sflender.github.io. 3600 IN A 185.199.109.153
sflender.github.io. 3600 IN A 185.199.110.153
sflender.github.io. 3600 IN A 185.199.111.153
that means everything is working!
- Now, go to your repo on github, settings --> Pages --> Custom Domain, add your custom domain, and click "Save".
- If everything goes well, you can now access your site via the custom domain!
Work in progress. This could work: https://medium.com/@jameshambunann/displaying-medium-posts-on-your-jekyll-website-7eef230309e4