Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a liquid tag extension which return filename in Jekyll

It's pretty basic stuff, I guess but I couldn't figure out how to do it.

What I want to do is very simple.

By using Jekyll plugin system, I want to extend Liquid tag to return filename of post.

{{% page.filename %}}

will parse to something like

jekyll-plugin.markdown
like image 914
studiomohawk Avatar asked Jul 23 '11 01:07

studiomohawk


1 Answers

Well, it's not exactly the method you're looking for, but you could just include the filename in the yaml headers for the file. It's probably a bad choice for files that you'll move around and tweak, but since there don't appear to be a wealth of answers pouring forth, maybe it's good enough.

like image 131
OldTroll Avatar answered Sep 24 '22 14:09

OldTroll