You are on page 1of 6

• Gems: Are opensource libraries

• E.g. rails is ruby gem


Installing rails:
$gem install rails
This will go out to server rubygems.org, pull rails and install locally.
Exact link: tubygems.org/gems/rails
• Gems can use other gems.
So while installing one gem, it will say :
$gem install ...
Fetching: …
Fetching: …
Fetching: …
• This may cause dependency conflict. Two gems may depend on same gem’s different versions.
• Bundler – solved dependency conflict
o Gemfile: Allows to optionally specify versions above, exact and below
▪ Example
source ‘https://rubygems.org’
gem ‘rails’, ‘3.2.6’
gem ‘pg’
gem ‘resque’
gem ‘sextant’
o Steps
▪ Put gem file in root folder
▪ Run
$ bundle install
▪ Finds all dependencies, their version numbers that satisfy all conditions
gem 1 requires gem 2 v<3
gem 3 requires gem 2 v>1
it will install v2
▪ If all dependencies resolve, installs bundle
▪ Also generates gemfile.lock, which contains versions of dependencies finally
installed, so that exact installation can be repeated
o Good practice: commit gemfile and gemfile.lock to version control
o TODO Bundle exe

TODO
1. https://github.com/github/pages-gem
2. https://github.com/jekyll/github-metadata#authentication
3. https://help.github.com/en/enterprise/2.14/user/articles/repository-metadata-on-github-pages
4. https://developer.github.com/v3/repos/#list-organization-repositories
5. https://guides.github.com/introduction/flow/
6. https://github.com/rogervila/jekyll-api
7. https://github.com/gregoryjscott/jekyll-api

Other sites
1. https://github.com/collections/github-pages-examples

Official Guides
1. https://guides.github.com/features/pages/
2. https://help.github.com/en/github/working-with-github-pages

Tools TODO
1. https://marketplace.visualstudio.com/items?itemName=ginfuru.ginfuru-vscode-jekyll-syntax

Courses
1. https://www.youtube.com/playlist?list=PLLAZ4kZ9dFpOPV5C5Ay0pHaa0RJFhcmcB
2. https://www.youtube.com/watch?v=jTlfPfTX64E
3. https://www.youtube.com/playlist?list=PLWjCJDeWfDdfVEcLGAfdJn_HXyM4Y7_k-
4. https://www.youtube.com/watch?v=WhrU9m82Wm8&list=PLLAZ4kZ9dFpOPV5C5Ay0pHaa0RJF
hcmcB&index=2
5. https://blog.kloud.com.au/2020/02/17/opensource-blogging-with-jekyll-github-vscode-part1/
https://blog.kloud.com.au/2020/03/09/opensource-blogging-with-jekyll-github-vscode-part2/
6. https://channel9.msdn.com/Blogs/WinCoder/Develop-and-Deploy-Jekyll-Static-Blog-to-Azure-
from-Visual-Studio-Code-with-Bash-on-Ubuntu-on-Window
7.

What is Github pages?


GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight
from a repository on GitHub, optionally runs the files through a build process, and publishes a
website.

What is Jekyll?
Jekyll is a simple, blog-aware, static site generator for personal, project, or organization sites. Written in
Ruby by Tom Preston-Werner, GitHub's co-founder, it is distributed under the open source MIT license.

Steps
1. Install ruby with devkit
https://rubyinstaller.org/downloads/
https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.6-
1/rubyinstaller-devkit-2.6.6-1-x64.exe
In the end of installation, select to run “ridk install” command.
Let it install option 1 and 3.

2. Install Bundler
gem install bundler
3. Create folder for new website
4. Open command prompt in the new folder
5. Init bundle

6. Optionally configure the bundler path to install gems


https://jekyllrb.com/tutorials/using-jekyll-with-bundler/#configure-bundler-install-path
7. Add Jekyll to bundle
E:\workspaces\ghp\first-jekyll-website>bundle add jekyll
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Fetching public_suffix 4.0.4
Installing public_suffix 4.0.4

Fetching terminal-table 1.8.0
Installing terminal-table 1.8.0
Fetching jekyll 4.0.0
Installing jekyll 4.0.0
8. Create Jekyll site
E:\workspaces\ghp\first-jekyll-website>bundle exec jekyll new --force --skip-bundle .
New jekyll site installed in E:/workspaces/ghp/first-jekyll-website.
Bundle install skipped.
9. Make sure all dependencies in your Gemfile are available to your application.
Seems that this fetches all gems required for Jekyll: https://bundler.io/bundle_install.html
> bundle install

10. Serve Jekyll website


bundle exec jekyll serve
11. A

Liquid
1. Liquid is a templating language which has three main parts: objects, tags and filters.
2. Filters: https://jekyllrb.com/docs/liquid/filters/
3. Tags: https://jekyllrb.com/docs/liquid/tags/

You might also like