_CONFIG.YML and Project Page URL Structure/Soft coded links
Due to its static nature Jekyll has many deployment possibilities. I was interested to deploy Jekyll blog to GitHub Pages by using github-pages gem. The process of deploying a Jekyll site to gh-pages is like deploying any other static site. For that you create a project repo on GitHub, push all your project files to the master branch and then create a gh-pages branch. GitHub by default will automatically generate your static site directly from the gh-pages branch.
However, there are several steps which can’t be missed while deploying Jekyll:
YAML is known as “a human-readable data-serialization language” which is used for configuration files and for storing or transmitting data.
Yaml uses maps (Hashes, Objects, Dictionaries), sequences (arrays, lists) and scalars (Strings, Numbers, Values).
The basic syntax and logic used by Yaml is the following:
See the full YAML specification for more information.
Jekyll looks for .yml or .json files, another data serialization language, in _data folder under the main directory.
According to the described above Yaml syntax we should specify the following in our _config.yml:
url: [GITHUB ACCOUNT NAME]
baseurl: [REPO NAME]
As we set baseurl: /Jekyll-blog-with-Bootstrap, Jekyll considers /Jekyll-blog-with-Bootstrap/ as the root of the blog and will serve it locally at
http://localhost:4000//Jekyll-blog-with-Bootstrap /
As we set baseurl: /Jekyll-blog-with-Bootstrap, Jekyll considers /Jekyll-blog-with-Bootstrap/ as the root of the blog and will serve it locally at http://localhost:4000//Jekyll-blog-with-Bootstrap /
Now url and baseurl keys can be used for handling url paths inside the blog.
As Jekyll uses Liquid markup, so we need to use double curly braces to output content of our keys. We use double curly braces to reference info which is passed to the html.
Thus,to access styles.css file which is located in css folder under assets directory we need to prepend baseurl to its relative path
href="/blogging-with-Jekyll/assets/css/styles.css". We can also write it this way:
href="/blogging-with-Jekyll/assets/css/styles.css"
The result link will be
https://tatianaazulay.github.io/Jekyll-blog-with-Bootstrap/
Thus,to access styles.css file which is located in css folder under assets directory we need to prepend baseurl to its relative path href="/blogging-with-Jekyll/assets/css/styles.css". We can also write it this way:
href="/blogging-with-Jekyll/assets/css/styles.css"
The result link will be https://tatianaazulay.github.io/Jekyll-blog-with-Bootstrap/