3
votes

Can anyone point me to the definitive list of supported Jekyll Liquid tags?

I'm aware of {{ contents }} and a few others from https://github.com/mojombo/jekyll/wiki/liquid-extensions

But I'm sure there are a lot more. Can someone help?

I'm particularly interested in predefined output markup - is there a tag that contains "index" when rendering "index.html"?

4
it's {{ content }} (without the s)bluesmoon
Hey paperjam, would you accept one of the answers? Was any of this helpful in your research?artu-hnrq

4 Answers

5
votes

A list of stock tags can be found on the Liquid for Designers page of the Liquid project.
A list of context data injected into Liquid can be found here.

AFAIK, page.name contains the source file name, eg index.md and {{ page.basename }} should output index in this case (but I haven't tried it yet).

2
votes

I'm aware of {{ contents }}

You probably mean {{ page.contents }} - {{ contents }} alone will render nothing (unless you have defined that variable manually)

Can anyone point me to the definitive list of supported Jekyll Liquid tags?

The "definitive guide" is: https://github.com/mojombo/jekyll/wiki/Template-Data . It lists all the available tags.

But I'm sure there are a lot more

I'm afraid there are not. By default, for a page, you only get page.url and page.content. You can also get anything defined on the yaml front. And that's all you can get.

Is there a tag that contains "index" when rendering "index.html"?

page.url will be index.html, but there isn't a direct way to get index alone (unless you define it manually in the yaml front).

1
votes

Jekyll uses Liquid template language, and you can find the list of tags and filters at the Liquid Documentation, which can be considered the official reference. There is also a tutorial for designers.

The list of Jekyll-specific variables can be found at Jekyll Documentation.

0
votes

Well, according to the official github-pages gem, GitHub Pages is currently running version 1.1.2 of Jekyll. Documentation for that specific version is here. Digging around there will reveal a few things, such as a few filters not documented at the Liquid for Designers page. For example, I found {{ page.date | date_to_rfc822 }} useful when generating an RSS feed for my Jekyll site.

I did not find the above documentation resource complete, but I thought it might be useful for anyone looking at this question looking for additional documentation on what Liquid tags are available in GitHub Pages.