Document variables in include tag

This commit is contained in:
maul.esel 2013-09-17 17:46:45 +02:00
parent 4c6ccc8009
commit 2a92ad77cc
1 changed files with 13 additions and 0 deletions

View File

@ -192,6 +192,19 @@ Jekyll expects all include files to be placed in an `_includes` directory at the
root of your source directory. This will embed the contents of root of your source directory. This will embed the contents of
`<source>/_includes/footer.html` into the calling file. `<source>/_includes/footer.html` into the calling file.
<div class="note">
<h5>ProTip™: Use variables as file name</h5>
<p>
The name of the file you wish to embed can be literal (as in the example above),
or you can use a variable, using liquid-like variable syntax as in
<code>{% raw %}{% include {{my_variable}} %}{% endraw %}</code>.
Note that unlike usual liquid variable syntax, you cannot have spaces inside the curly braces.
</p>
</div>
You can also pass parameters to an include: You can also pass parameters to an include:
{% highlight ruby %} {% highlight ruby %}