Merge pull request #2830 from kansaichris/render-liquid-in-coffeescript
This commit is contained in:
commit
190ab7f6b8
|
@ -27,8 +27,8 @@ Feature: Rendering
|
||||||
Then the _site directory should not exist
|
Then the _site directory should not exist
|
||||||
And I should see "Invalid CSS after" in the build output
|
And I should see "Invalid CSS after" in the build output
|
||||||
|
|
||||||
Scenario: Don't render liquid in CoffeeScript
|
Scenario: Render liquid in CoffeeScript
|
||||||
Given I have an "index.coffee" page that contains "hey='for {{site.animal}}'"
|
Given I have an "index.coffee" page with animal "cicada" that contains "hey='for {{page.animal}}'"
|
||||||
When I run jekyll build
|
When I run jekyll build
|
||||||
Then the _site directory should exist
|
Then the _site directory should exist
|
||||||
And I should see "hey = 'for {{site.animal}}';" in "_site/index.js"
|
And I should see "hey = 'for cicada';" in "_site/index.js"
|
||||||
|
|
|
@ -162,16 +162,14 @@ module Jekyll
|
||||||
|
|
||||||
# Determine whether the file should be rendered with Liquid.
|
# Determine whether the file should be rendered with Liquid.
|
||||||
#
|
#
|
||||||
# Returns false if the document is either an asset file or a yaml file,
|
# Always returns true.
|
||||||
# true otherwise.
|
|
||||||
def render_with_liquid?
|
def render_with_liquid?
|
||||||
!coffeescript_file?
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
# Determine whether the file should be placed into layouts.
|
# Determine whether the file should be placed into layouts.
|
||||||
#
|
#
|
||||||
# Returns false if the document is either an asset file or a yaml file,
|
# Returns false if the document is an asset file.
|
||||||
# true otherwise.
|
|
||||||
def place_in_layout?
|
def place_in_layout?
|
||||||
!asset_file?
|
!asset_file?
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,6 +25,15 @@ have a file named `css/styles.scss` in your site's source folder, Jekyll
|
||||||
will process it and put it in your site's destination folder under
|
will process it and put it in your site's destination folder under
|
||||||
`css/styles.css`.
|
`css/styles.css`.
|
||||||
|
|
||||||
|
<div class="note info">
|
||||||
|
<h5>Jekyll processes all Liquid filters and tags in asset files</h5>
|
||||||
|
<p>If you are using <a href="http://mustache.github.io">Mustache</a>
|
||||||
|
or another JavaScript templating language that conflicts with
|
||||||
|
the <a href="/docs/templates/">Liquid template syntax</a>, you
|
||||||
|
will need to place <code>{% raw %}</code> and
|
||||||
|
<code>{% endraw %}</code> tags around your code.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
## Sass/SCSS
|
## Sass/SCSS
|
||||||
|
|
||||||
Jekyll allows you to customize your Sass conversion in certain ways.
|
Jekyll allows you to customize your Sass conversion in certain ways.
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
message: "I knew it!"
|
||||||
---
|
---
|
||||||
|
|
||||||
$ ->
|
$ ->
|
||||||
|
@ -7,4 +8,4 @@ $ ->
|
||||||
cube = (x) -> square(x) * x
|
cube = (x) -> square(x) * x
|
||||||
cubes = (math.cube num for num in list)
|
cubes = (math.cube num for num in list)
|
||||||
|
|
||||||
alert "I knew it!" if elvis?
|
alert "{{ page.message }}" if elvis?
|
||||||
|
|
Loading…
Reference in New Issue