Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bigcommerce/stencil-cli",
"version": "1.3.11",
"version": "1.3.12",
"description": "CLI tool to run BigCommerce Stores locally for theme development.",
"main": "index.js",
"engines": {
Expand Down Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/bigcommerce/stencil-cli",
"dependencies": {
"@bigcommerce/stencil-paper": "^1.1.6",
"@bigcommerce/stencil-paper": "^1.1.7",
"@bigcommerce/stencil-styles": "^1.0.2",
"accept-language-parser": "^1.0.2",
"archiver": "^0.14.4",
Expand Down
40 changes: 1 addition & 39 deletions server/plugins/renderer/responses/pencil-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module.exports = function (data, assembler) {
this.respond = function (request, reply) {
var response,
output,
html,
paper,
templatePath;

Expand All @@ -31,44 +30,7 @@ module.exports = function (data, assembler) {
return reply(data.context);
}

if (data.remote || _.isArray(templatePath)) {

if (data.remote) {
data.context = _.extend({}, data.context, data.remote_data);
}

if (templatePath) {
// if multiple render_with
if (_.isArray(templatePath)) {
// if templatePath is an array ( multiple templates using render_with option)
// compile all the template required files into a hash table
html = templatePath.reduce(function(table, file) {
table[file] = paper.render(file, data.context);

return table;
}, {});
} else {
html = paper.render(templatePath, data.context);
}

if (data.remote) {
// combine the context & rendered html
output = {
data: data.remote_data,
content: html
};
} else {
output = html;
}
} else {
output = {
data: data.remote_data
};
}
} else {
output = paper.render(templatePath, data.context);
}

output = paper.renderTheme(templatePath, data);
response = reply(output);
response.code(data.statusCode);

Expand Down