Skip to content
This repository was archived by the owner on Dec 10, 2019. It is now read-only.

Commit 4f6ee81

Browse files
Ghoweri, Salem (BOS-GEN)Ghoweri, Salem (BOS-GEN)
authored andcommitted
-Adding Grunt dependencies to run the PL Twig engine as well
-Fixing Grunt watch task to watch all file deps inside of the _patterns folder vs just mustache and json files -Cleaning up missing Gulp dependencies, Twig Media object example
1 parent d3df3a3 commit 4f6ee81

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

Gruntfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ module.exports = function(grunt) {
8080
files: [
8181
path.resolve(paths().source.css + '**/*.css'),
8282
path.resolve(paths().source.styleguide + 'css/*.css'),
83-
path.resolve(paths().source.patterns + '**/*.mustache'),
84-
path.resolve(paths().source.patterns + '**/*.json'),
83+
path.resolve(paths().source.patterns + '**/*'),
84+
// path.resolve(paths().source.patterns + '**/*.json'),
8585
path.resolve(paths().source.fonts + '/*'),
8686
path.resolve(paths().source.images + '/*'),
8787
path.resolve(paths().source.data + '*.json')

builder/pattern_engines/engine_twig.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
// regexes, stored here so they're only compiled once
3636
findPartialsRE: /{%([ ]+)?(?:extends|include|embed)(\s\S)(.*)%}/g,
37-
findListItemsRE: /({{#( )?)(list(I|i)tems.)(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)( )?}}/g,
37+
findListItemsRE: /({{#( )?)(list(I|i)tems.)(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen|twenty)( )?}}/g, // TODO
3838

3939
// render it
4040
renderPattern: function renderPattern(template, data) {
@@ -70,7 +70,8 @@
7070
// return it.
7171
findPartialKey: function(partialString) {
7272

73-
// var partialKey = partialString.replace(this.findPartialsRE, '$1');
73+
74+
//var partialKey = partialString.replace(this.findPartialsRE, '$1');
7475
var partialKey = partialString.match(/"((?:\\.|[^"\\])*)"/)[0];
7576
partialKey = partialKey.replace(/"/g, '');
7677

package.gulp.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
"fs-extra": "^0.26.5",
1010
"glob": "^7.0.0",
1111
"html-entities": "^1.2.0",
12-
"mustache": "^2.2.1"
12+
"mustache": "^2.2.1",
13+
"handlebars": "^4.0.5",
14+
"twig": "^0.8.8",
15+
"underscore": "^1.8.3",
1316
},
1417
"devDependencies": {
1518
"browser-sync": "^2.11.1",

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"matchdep": "^1.0.0",
1212
"mustache": "^2.2.0",
1313
"handlebars": "^4.0.5",
14-
"underscore": "^1.8.3"
14+
"underscore": "^1.8.3",
15+
"twig": "^0.8.8"
1516
},
1617
"devDependencies": {
1718
"bs-html-injector": "^3.0.0",

source/_patterns/01-molecules/media-object.twig

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,17 @@
1515
</style>
1616

1717

18+
{% set foo = "world!" %}
19+
20+
1821
<div class="Media">
1922
{% include "atoms-image" %}
20-
<p class="Media-body">Media Object body text</p>
23+
24+
<div class="Media-body">
25+
26+
{# Testing if we can also pull in non-twig templates without breaking anything (it works!). Good idea though? Eh... #}
27+
{% include "atoms-paragraph" %}
28+
29+
<p>Oh, hello {{ foo }}</p>
30+
</div>
2131
</div>

0 commit comments

Comments
 (0)