Jekyll X GitHub Setup!
Create your first Jekyll GitHub page
- Install Jekyll and create a
Jekyll
project - Create a git repository on your
GitHub
account - Go to the project root on your local computer
git init git add remote origin your_git_repo.git
- Change the
baseurl
andurl
in _config.yml file which is under your project rootbaseurl: "/myblog" # the subpath of your site, e.g. /blog url: "https://sleepingkit.github.io" # the base hostname & protocol for your site, e.g. http://example.com
- Push all the things to your repository
- Go to the setting of your
GitHub
repo - Change the source of
GitHub
Pages to master branch - Wait for a minute and your first
Jekyll
site is built!
Attention:
- Don’t change the theme directly in GitHub setting
- The date of the post you have created should not be the future date, otherwise it will skip your post when built
- Add image should add your website url to your path, you may check the path of the image above
Change your Jekyll Github page theme
I suggest to use Minimal Mistakes. The following tutorial is talking about how to change the theme in your Github page but not in local. If you want to test in your local computer, you may read the documents of Minimal Mistakes
- Uncommnet this line in ./Gemfile
gem "github-pages", group: :jekyll_plugins
- Add
gem "jekyll-remote-theme"
to the jekyll_plugins in ./Gemfilegroup :jekyll_plugins do gem "jekyll-feed", "~> 0.12" gem "jekyll-remote-theme" end
- Replace the current theme to remote-theme in ./_config.yml
from:theme: minima
to:
remote_theme: "mmistakes/minimal-mistakes@4.19.2"
- Add
jekyll-remote-theme
andjekyll-include-cache
plugins in ./_config.yml s ``` yml plugins:- jekyll-feed
- jekyll-remote-theme
- jekyll-include-cache ```
- In your posts
yy-mm-dd-post-title.markdown
, remove the YAML Front Matterlayout: post
--- title: "Post title" ---
- Add the followings in _config.yml, so that you don’t have to add the posts layout in every post, same for the other type of layout.
defaults: # _posts - scope: path: "" type: posts values: layout: single read_time: true comments: true share: true related: true toc: true toc_sticky: true
- Push your changes to your Github project and see the changes!
Comments