From 71b10e2d4a8184ba48c69f1ed46fbbc1e4891855 Mon Sep 17 00:00:00 2001 From: Chris Frederick Date: Tue, 26 Aug 2014 17:14:33 +0900 Subject: [PATCH 1/6] Make render_with_liquid? true for CoffeeScript --- lib/jekyll/convertible.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index d513d737..2c9e4fc4 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -165,7 +165,7 @@ module Jekyll # Returns false if the document is either an asset file or a yaml file, # true otherwise. def render_with_liquid? - !coffeescript_file? + true end # Determine whether the file should be placed into layouts. From 79992fc3c86fefe1ca08b01152ac52c9c7915882 Mon Sep 17 00:00:00 2001 From: Chris Frederick Date: Tue, 26 Aug 2014 17:17:13 +0900 Subject: [PATCH 2/6] Fix inaccurate comments --- lib/jekyll/convertible.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index 2c9e4fc4..72d825fa 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -162,16 +162,14 @@ module Jekyll # Determine whether the file should be rendered with Liquid. # - # Returns false if the document is either an asset file or a yaml file, - # true otherwise. + # Always returns true. def render_with_liquid? true end # Determine whether the file should be placed into layouts. # - # Returns false if the document is either an asset file or a yaml file, - # true otherwise. + # Returns false if the document is an asset file. def place_in_layout? !asset_file? end From 55de1354677a9c39bbeac7811d352cfc4f18fc63 Mon Sep 17 00:00:00 2001 From: Chris Frederick Date: Tue, 26 Aug 2014 17:24:27 +0900 Subject: [PATCH 3/6] Test Liquid syntax in CoffeeScript files --- test/source/js/coffeescript.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/source/js/coffeescript.coffee b/test/source/js/coffeescript.coffee index e0e066b1..9531a7cb 100644 --- a/test/source/js/coffeescript.coffee +++ b/test/source/js/coffeescript.coffee @@ -1,4 +1,5 @@ --- +message: "I knew it!" --- $ -> @@ -7,4 +8,4 @@ $ -> cube = (x) -> square(x) * x cubes = (math.cube num for num in list) - alert "I knew it!" if elvis? + alert "{{ page.message }}" if elvis? From 1238ccefcc3f79a339c2880f08ddb05c41ddc3d8 Mon Sep 17 00:00:00 2001 From: Chris Frederick Date: Tue, 26 Aug 2014 22:24:18 +0900 Subject: [PATCH 4/6] Fix Cucumber scenario --- features/rendering.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/rendering.feature b/features/rendering.feature index 5f71e2cd..6ceaef57 100644 --- a/features/rendering.feature +++ b/features/rendering.feature @@ -27,8 +27,8 @@ Feature: Rendering Then the _site directory should not exist And I should see "Invalid CSS after" in the build output - Scenario: Don't render liquid in CoffeeScript - Given I have an "index.coffee" page that contains "hey='for {{site.animal}}'" + Scenario: Render liquid in CoffeeScript + Given I have an "index.coffee" page with animal "cicada" that contains "hey='for {{page.animal}}'" When I run jekyll build 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" From d84b801feca8b4255112efe7d65b85eb557effa0 Mon Sep 17 00:00:00 2001 From: Chris Frederick Date: Wed, 27 Aug 2014 22:22:24 +0900 Subject: [PATCH 5/6] Add a note about Liquid and template languages --- site/_docs/assets.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/site/_docs/assets.md b/site/_docs/assets.md index 23bf4953..01a990fd 100644 --- a/site/_docs/assets.md +++ b/site/_docs/assets.md @@ -25,6 +25,11 @@ 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 `css/styles.css`. +
+
Jekyll processes all Liquid filters and tags in asset files
+

If you are using Mustache or another JavaScript templating language that conflicts with the Liquid template syntax, you will need to place {% raw %} and {% endraw %} tags around your code.

+
+ ## Sass/SCSS Jekyll allows you to customize your Sass conversion in certain ways. From 98ed3b1c8f5a6cbf701db7df5597e216bdabc9b4 Mon Sep 17 00:00:00 2001 From: Chris Frederick Date: Wed, 27 Aug 2014 22:58:31 +0900 Subject: [PATCH 6/6] Might as well hard-wrap this to be consistent --- site/_docs/assets.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site/_docs/assets.md b/site/_docs/assets.md index 01a990fd..c2965bdf 100644 --- a/site/_docs/assets.md +++ b/site/_docs/assets.md @@ -27,7 +27,11 @@ will process it and put it in your site's destination folder under
Jekyll processes all Liquid filters and tags in asset files
-

If you are using Mustache or another JavaScript templating language that conflicts with the Liquid template syntax, you will need to place {% raw %} and {% endraw %} tags around your code.

+

If you are using Mustache + or another JavaScript templating language that conflicts with + the Liquid template syntax, you + will need to place {% raw %} and + {% endraw %} tags around your code.

## Sass/SCSS