Document variables in include tag
This commit is contained in:
		
							parent
							
								
									4c6ccc8009
								
							
						
					
					
						commit
						2a92ad77cc
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
`<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:
 | 
			
		||||
 | 
			
		||||
{% highlight ruby %}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue