-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support a new relative_include
tag
#2870
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
aa97f10
Support a new `relative_include` tag
gjtorikian 787bb58
Trash the subclass
gjtorikian 9f558d1
Rename tag to `include_relative`
gjtorikian 0e45490
Define methods for shared vars between include & include_relative
gjtorikian 934c37b
Separate include_relative test out into its own context
gjtorikian e7c8bbf
Test that includes relative to self are included
gjtorikian 4da07bb
Add tests around nasty include attempts
gjtorikian afd30b0
Add documentation on the include_relative tag
gjtorikian 3668437
Rename method to `resolved_includes_dir`
gjtorikian a569799
Sanitize the resolved includes path
gjtorikian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: Post | ||
layout: post | ||
include1: rel_include.html | ||
include2: include_relative/rel_include | ||
include3: rel_INCLUDE | ||
include4: params | ||
include5: clude | ||
--- | ||
|
||
Liquid tests | ||
- 1 {% include_relative include_relative/{{ page.include1 }} %} | ||
- 2 {% include_relative {{ page.include2 | append: '.html' }} %} | ||
- 3 {% include_relative include_relative/{{ page.include3 | downcase | append: '.html' }} %} | ||
|
||
Whitespace tests | ||
- 4 {% include_relative include_relative/{{page.include1}} %} | ||
- 5 {% include_relative include_relative/{{ page.include1}} %} | ||
- 6 {% include_relative include_relative/{{ page.include3 | downcase | append: '.html'}} %} | ||
|
||
Parameters test | ||
- 7 {% include_relative include_relative/{{ page.include4 | append: '.html' }} var1='foo' var2='bar' %} | ||
|
||
Partial variable test | ||
- 8 {% include_relative include_relative/rel_in{{ page.include5 }}.html %} | ||
|
||
Relative to self test: | ||
|
||
- 9 {% include_relative 2014-03-03-yaml-with-dots.md %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<span id='include-param'>{{include.param}}</span> | ||
|
||
<ul id='param-list'> | ||
{% for param in include %} | ||
<li>{{param[0]}} = {{param[1]}}</li> | ||
{% endfor %} | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
relative_included |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use case statements instead of just overwrite certain methods based on the tag class? If you have a separate class, you may as well separate the class-specific code from each other. 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true.dat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want me to do that, I am happy to submit a PR to your PR. Or something? #howtogithub
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I was planing on just killing this and relying more on
tag_name
to do the weight. There's only two spots that need to change. Does that make sense? #howdoiprogram