You don't have javascript enabled. Good luck! :(


  Feb 18, 2016     Lamsong     blog  UPDATE: Jan 10, 2018

Jekyll blog

jekyll blog

All about jekyll!

Liquid Synatax

Add your own liquid tag

To add a new liquid tag, just creating a plugin (ruby) to your jekyll project, add a class that inherit from Liquid::Tag, and register the tag.

Code sample:

# Jekyll plugin to add new liquid tag.
# file name: *.rb
# liquid tag: test

class Test < Liquid::Tag

  def initialize(tag_name, markup, tokens)

  def render(context)
    page_url = context.environments.first["page"]["url"]
    var = @markup.split

      <a href="#{page_url}">page url</a>

      <p>tag name: #{@tag_name}</p>


  Liquid::Template.register_tag "test", self

Add {% test hello world %} to your post, then the output will be:

    <a href="/posts/jekyll-blog/welcome-to-jekyll.html">page url</a>

    <p>tag name: test</p>

    hello world


See jekyllrb doc

  • The include tag allows you to include the content from another file stored in the _includes folder.
  • The include_relative tag allows you include file fragments relatively.

Synatax highlight

pygmentize -S monokai -f html > your/path/pygments.css