Include jekyll / liquid template data in a YAML variable?

Today I ran into a similar problem. As a solution I created the following simple Jekyll filter-plugin which allows to expand nested liquid-templates in (e.g. liquid-variables in the YAML front matter): module Jekyll module LiquifyFilter def liquify(input) Liquid::Template.parse(input).render(@context) end end end Liquid::Template.register_filter(Jekyll::LiquifyFilter) Filters can be added to a Jekyll site by placing them in the … Read more

Iterate over hashes in liquid templates

When you iterate over a hash using a variable called hash, hash[0] contains the key and hash[1] contains the value on each iteration. {% for link_hash in page.links %} {% for link in link_hash %} <a href=”https://stackoverflow.com/questions/8206869/{{ link[1] }}”>{{ link[0] }}</a> {% endfor %} {% endfor %}

find_spec_for_exe’: can’t find gem bundler (>= 0.a) (Gem::GemNotFoundException)

The problem in my case is that the Gemfile.lock file had a BUNDLED_WITH version of 1.16.1 and gem install bundler installed version 2.0.1, so there was a version mismatch when looking to right the folder gem install bundler -v 1.16.1 fixed it Of course, you can also change your Gemfile.lock‘s BUNDLED_WITH with last bundler version … Read more

Jekyll/Liquid Templating: How to group blog posts by year?

It can be done with much, much less Liquid code than in the existing answers: {% for post in site.posts %} {% assign currentdate = post.date | date: “%Y” %} {% if currentdate != date %} <li id=”y{{currentdate}}”>{{ currentdate }}</li> {% assign date = currentdate %} {% endif %} <li><a href=”https://stackoverflow.com/questions/19086284/{{ post.url }}”>{{ post.title }}</a></li> … Read more

How do I configure GitHub to use non-supported Jekyll site plugins?

Depending if you deal with a User/Organization (UO) site or a Project site (P), do : from your working folder git init git remote add origin git@github.com:userName/userName.github.io.git (UO) or git remote add origin git@github.com:userName/repositoryName.git (P) jekyll new . creates your code base in _config.yml, set the baseurl parameter to baseurl: ” (UO) or baseurl: ‘/repositoryName’ … Read more

Showing C# tags in Jekyll Github pages using Highlight.js

Jekyll has highlight tag and css (_sass/_syntax-highlighting.scss) onboard. {% highlight csharp %} /// <summary> /// Main class of the project /// </summary> class Program { /// <summary> /// Main entry point of the program /// </summary> /// <param name=”args”>Command line args</param> static void Main(string[] args) { //Do stuff } } {% endhighlight %} This works … Read more