Notes on Jekyll
(Prerequisites)
- install git https://git-scm.com/downloads
- install ruby https://www.ruby-lang.org/en/documentation/installation/
- install jekyll via bundler https://bundler.io/
jekyll install list https://jekyllrb.com/docs/installation/
-If errors appear during installation with bundler, try lowering the ruby version (currently using 2.7).
Preparation
- Create a new repository
- Open Git Bash and cd to the repo
- Make a docs dir mkdir docs OR
- Make a gh-pages branch git checkout –orphan gh-pages
- Run jekyll new . (Needs to be an empty dir)
- Open the Gemfile
- Modify to comment line gem “jekyll”, “~>version”
- Modify to uncomment line with gem “github-pages”, group: :jekyll_plugin
- Modify to add gh-pages version from dependencies at https://pages.github.com/versions/
- gem “github-pages”, “~> 215”, group: :jekyll_plugins
- Save and close Gemfile
- Run bundle update
- Update _config.yml
- Add files, commit and push
- Check deployment from Github browser menu
- Update the site with jekyll serve
- Test locally with bundle exec jekyll serve
- For local errors bundle add webrick
- View locally at http://localhost:4000
Article format YEAR-MONTH-DAY-title.MARKUP
Test html page at /test
- For posts / articles:
- Syntax for Markdown
- For styling:
- Dynamic content is provided with a language called Liquid
- Variable { { variable } }
- Logic statements, loops { % if statement % }
- To avoid printing whitespaces { % - else - % }
Jekyll Links
Update (2022/03/10):
- Use polyglot for multiple languages
-
Minimize code with jekyll-minifier
- If a page does not build / builds partially, maybe the specific plugins are not included in Github pages. In such a case build the site locally and publish the _site folder.