Using MathJax with Jekyll

Certainly you can use mathjax with Jekyll. To get this working make sure that If you’re writing your post in markdown, your markdown interpreter isn’t hammering your mathjax input. The best way to protect it I have found is to always put display math in <div> elements and inline math in <span> elements, which most … Read more

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

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 %}

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

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