Skip to content
This repository was archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
move schema to bottom of compiled file (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Macdonald authored Aug 23, 2016
1 parent e6a0fcb commit ef039ec
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tasks/build-sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,20 @@ function concatContent(files, path) {
var tempContents = fs.readFileSync(path + file, 'utf-8');
var tempMatch;

if (file === 'schema.json') {
contents[0] = '{% schema %}\n' + tempContents + '{% endschema %}\n';

} else if (file === 'style.liquid') {
if (file === 'style.liquid') {
tempMatch = tempContents.replace(hasComments, '');
contents[1] = isEmpty.test(tempMatch)
contents[0] = isEmpty.test(tempMatch)
? null : tempContents;

} else if (file === 'template.liquid') {
contents[2] = tempContents;
contents[1] = tempContents;

} else if (file === 'javascript.js') {
tempMatch = tempContents.replace(hasComments, '');
contents[3] = isEmpty.test(tempMatch)
contents[2] = isEmpty.test(tempMatch)
? null : '{% javascript %}\n' + tempContents + '{% endjavascript %}\n';
} else if (file === 'schema.json') {
contents[3] = '{% schema %}\n' + tempContents + '{% endschema %}\n';
}
});
_.remove(contents, function(item) { return !item; });
Expand Down

0 comments on commit ef039ec

Please sign in to comment.