Skip to content

Instantly share code, notes, and snippets.

@jonashackt
Last active November 25, 2019 16:09
Show Gist options
  • Save jonashackt/fcd304fdacd85304faadecfd6330a386 to your computer and use it in GitHub Desktop.
Save jonashackt/fcd304fdacd85304faadecfd6330a386 to your computer and use it in GitHub Desktop.
Jekyll with GitHub-Pages Cheatsheet
# Update Jekyll GitHub-Pages site
https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/#keeping-your-site-up-to-date-with-the-github-pages-gem
bundle update github-pages
# Test Jekyll with GitHub-Pages locally
https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/#step-4-build-your-local-jekyll-site
bundle exec jekyll serve
# Build Static Site
bundle exec jekyll build -d public
# Adding Images
http://sgeos.github.io/github/jekyll/2016/08/30/adding_images_and_downloads_to_a_github_pages_jekyll_blog.html
cp path/to/image.png ./assets/
# insert:
![useful image]({{ site.url }}/assets/image.png)
# Override theme defaults
https://jekyllrb.com/docs/themes/#overriding-theme-defaults
Create your own `_layouts/default.html` - derive it from the gem directory you can read with `cd $(bundle show jekyll-theme-minimal)`
If you're using minimal theme, have a look at https://github.com/pages-themes/minimal also!
# Use Docker (and thus don´t need to install Ruby / gem / bundle(r))
## manual
docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app ruby:2.5 bash
bundle install
bundle exec jekyll build -d public
## automatic
docker run --rm -v "$PWD":/usr/src/app -w /usr/src/app ruby:2.5 bundle install || bundle exec jekyll build -d public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment