Skip to content

Commit

Permalink
don't display partials inside templates list
Browse files Browse the repository at this point in the history
  • Loading branch information
wonknu committed Oct 12, 2016
1 parent b4fec49 commit 35d769d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cli/cms/templates/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@ export function getStructureAndTemplatesFiles() {
try {
var directoryTemplate = fse.lstatSync(path.join(site.path, templates))
if (directoryTemplate.isDirectory()) {
result.templates = result.templates.concat(cmsData.file.getFiles(path.join(site.path, templates), true, 10, new RegExp(`.${config.files.templates.extension}`)))
var resultTemplates = result.templates.concat(cmsData.file.getFiles(path.join(site.path, templates), true, 10, new RegExp(`.${config.files.templates.extension}`)))
result.templates = resultTemplates.filter(function (resultTemplate) {
return resultTemplate.path.indexOf(config.partials) < 0
})
}
} catch (e) {
}
Expand Down

0 comments on commit 35d769d

Please sign in to comment.