Allow including within subdirectories #400

Closed
richtaur opened this Issue Sep 14, 2011 · 2 comments

Projects

None yet

2 participants

@richtaur

In code like this:

{% include foo.html %}

It would be wonderful to allow for subdirectories, eg:

{% include subdirectory/foo.html %}

Note: could be that this is a Liquid issue …

@envygeeks
Jekyll member

I was just looking over this bug to see if I could send something upstream to fix this but both looking at the source and testng I was able to include test/test.txt from _includes. Perhaps a mistake in your sources syntax or an older version of Ruby? Liquid/Jekyll?

If you look here: https://github.com/mojombo/jekyll/blob/master/lib/jekyll/tags/include.rb#L21 you'll see that Jekyll only conforms the directory, rejects symlinks and then validates that in the end it's in the list */ is a traversal so if you create a directory test/test/test/test/test.txt and then do {% include test/test/test/test/test.txt %} it should include it. The test was done on Ruby1.9.2 with liquid2.2.2.

@richtaur

Right you are, sorry the error was on our end. Thank you!

@richtaur richtaur closed this Sep 14, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment