Background
This is my first blog stimulated by suxy15, written to take down the prossess of writing blog using Jeykll
Jekyll and Github Pages
Roughly speaking, Jekyll and Github Pages are two different parts. Jekyll is a static website generator like hexo(use html, mardown, etc to generate a new html), while Github Pages is a Github component which uses a repository to generate a user website. But Jekyll is the engine of Github Pages, which makes it convenient to set up a blog using Jekyll on Github. We just edit on our local machine, commit as usual and get our blog.
Basics
Basic information about Jekyll can be easily got from the Jekyll official
Set up Github Pages can see Set up Github Pages with Jekyll
Some pitfalls
However, some pitfalls need to be noticed.
-
Theme changing
There are different types of theme in Jekyll. For me, I use gem theme, which means that _layouts, etc is invisible for me but make a difference when built. To use a gem theme, check Jekyll themes. After installing a new theme, the
home
andlayout
in the front matter of pages must be changed to:default
, or else it will complain. -
Link
Links to the content files in the markdown is commonly used, the path for the url ==can not== use
.
or..
, one good way to link properly is to use Liquid tags, such as[Jekyll beginning](/jekyll/2021/08/28/Jekyll_beginning.html) # Since liquid grammar will be transformed, better check it as raw
which can work properly
Make a table of contents
In markdown, we add [toc]
will generate a table of contents, however, this will not work by default in Jekyll. To make a table of contents check
https://github.com/toshimaru/jekyll-toc
If you are using a gem-based theme
bundle info --path minima
will find config files for you theme