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

Doesn't actually support absolute paths #10

Open snan opened 4 years ago

snan commented 4 years ago

Paths like ../foo/bar are still relative paths. An absolute path is something like /home/sandra/foo/bar, starts with a slash typically.

You can pull from https://idiomdrottning.org/jekyll-include-absolute-plugin if you want because I've fixed it there. Much love♥

mslinn commented 4 years ago

I made a GitHub repo with the work @snan did folded into master.

snan commented 4 years ago

Thank you for that♥

Mike Slinn notifications@github.com writes:

I made a GitHub repo with the work @snan did folded into master.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/tnhu/jekyll-include-absolute-plugin/issues/10#issuecomment-702166738

mslinn commented 4 years ago

I just added the ability to include files relative to the user home directory. Please see the mslinn branch in my GitHub repo

These work now:

{% include_absolute '/etc/passwd' %}
{% include_absolute '~/.ssh/config' %}

I did not make a PR because as I noted in the README I disabled the validate_file_name invocation because I do not have time to figure out how to modify it so that filenames relative to the home directory would work.

mslinn commented 4 years ago

I just added the ability to include executable files on the PATH. I also renamed the plugin to flexible_include because it can include 4 ways, not just absolute and relative. Please see the mslinn branch in my GitHub repo.

You can see my other Jekyll plugins here.

snan commented 4 years ago

Thank you, Mike. I updated my repo web page to include a link to your wonderful repo.

mslinn commented 4 years ago

I added a new plugin that provides 3 new filters related to including files: from, to and until.