Skip to content

Commit 672a187

Browse files
author
Jeremie Patonnier
committedDec 26, 2015
Use partial instead of compiling
1 parent 17a935f commit 672a187

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
 

‎.gsk/docs/html/handlebars.md

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ page correspondante.
4747
> **NOTE:** _Tous les layouts doivent être placés dans le dossier
4848
`src/html/layout`_
4949

50+
> **NOTE:** _Dans le layout, le contenu de la page est inclus via le partial
51+
`{{> body}}`_
52+
5053
Helpers
5154
-------------------------------------------------------------------------------
5255
Handlebars peut être etendu par l'usage de helpers.

‎.gsk/pipe/html/handlebars.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ function processData(file) {
5353

5454
var data = _.extend({}, gData, sData);
5555
data.url = file.path.replace(ENV.html['src-dir'], DEST_URL).replace('.hbs', '.html');
56-
data.main = hbs.handlebars.compile(file.contents.toString())(data);
56+
57+
hbs.registerPartial('body', file.contents.toString());
5758

5859
return data;
5960
}

0 commit comments

Comments
 (0)
Please sign in to comment.