tnhu / jekyll-include-absolute-plugin

A Jekyll's liquid tag plugin to include a file from its path relative to Jekyll's source folder
MIT License
22 stars 10 forks source link

Allow variable in include #1

Closed mrksbnch closed 8 years ago

mrksbnch commented 8 years ago

I tried to use a variable in the include_absolute path, but it doesn't seem to work.

{% include_absolute {{ path }}.html %}

This is already supported in Jekyll's build-in include and include_relative functions.

liquidvisual commented 8 years ago

+1

bradfrost commented 8 years ago

+1

This works fantastic for hard coding file names, but I'm dynamically including a bunch of files from an outside directory. My markup looks pretty much exactly like @mrksbnch's.

tnhu commented 8 years ago

Hey sorry everyone for being late, I'll look into this issue some time this weekend :)

ChrisJefferson commented 8 years ago

Based on random cutting+pasting, I found putting @file = context[@file] || @file as the first line of render fixes this (I have no idea at all what I did, just cut from another plugin)

tnhu commented 8 years ago

Fixed with https://github.com/tnhu/jekyll-include-absolute-plugin/commit/a87f625f0fd9aaeec5d3fcdbaf899f4b307a9d40. Thanks all!