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
var manageEnvironment = function(environment) { | |
environment.addFilter("json", function(value) { | |
return JSON.parse(value); // convert the complete string imported by Nunjucks into JSON and return | |
}); | |
}; | |
gulp.task("nunjucks", function() { | |
// .njk files in pages | |
return ( | |
gulp |
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
{# Import macros for global use in all views #} | |
{% set components = {} %} | |
{% for component in macroFilePaths %} | |
{% import component as temp %}{% set macro = _.assign(components, temp) %} | |
{% endfor %} | |
{# end #} |
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
var manageEnvironment = function(environment) { | |
environment.addFilter("json", function(value) { | |
return JSON.parse(value); // convert the complete string imported by Nunjucks into JSON and return | |
}); | |
}; | |
gulp.task("nunjucks", function() { | |
// .njk files in pages | |
return ( | |
gulp |
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
// | |
// Allows highlighting of code blocks in Nunjucks template. | |
// https://mozilla.github.io/nunjucks/api.html#custom-tags | |
// | |
const nunjucks = require('nunjucks'); | |
const hljs = require('highlight.js'); | |
function HighlightJsExtension() { | |
this.tags = ['highlightjs']; |