-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from dadi/feature/add-helper-functions-to-locals
add helpers from config to locals passed to template
- Loading branch information
Showing
10 changed files
with
160 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
coverage | ||
node_modules/ | ||
scripts/*.svg | ||
scripts/*.svg | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ | |
"web", | ||
"pug", | ||
"pug.js", | ||
"jade" | ||
"jade", | ||
"dadi-web-engine" | ||
], | ||
"author": "Eduardo Boucas <[email protected]>", | ||
"bugs": { | ||
|
@@ -26,7 +27,8 @@ | |
"homepage": "https://github.com/dadi/web-pugjs#readme", | ||
"dependencies": { | ||
"debug": "^2.6.6", | ||
"pug": "^2.0.0-rc.1" | ||
"pug": "^2.0.0-rc.1", | ||
"require-dir": "^0.3.2" | ||
}, | ||
"devDependencies": { | ||
"colors": "^1.1.2", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
const dust = require('dustjs-linkedin') | ||
|
||
/* | ||
* Returns the supplied 'data' parameter trimmed of whitespace on both left and right sides | ||
* Usage: {@Trim data="{body}"/} | ||
* Returns the supplied 'input' parameter trimmed of whitespace on both left and right sides | ||
*/ | ||
dust.helpers.Trim = function (chunk, context, bodies, params) { | ||
var data = context.resolve(params.data) | ||
return chunk.write(data.trim()) | ||
module.exports = input => { | ||
return input.trim() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"page": { | ||
"name": "products", | ||
"description": "The products page", | ||
"language": "en" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
include /partials/header.pug | ||
|
||
h1 Products: | ||
|
||
ul | ||
each val, index in products | ||
li= trim(val.name) + ' - £' + val.price | ||
|
||
include /partials/footer.pug |