Skip to content

Commit

Permalink
feat(ember): body content will be added to the final template
Browse files Browse the repository at this point in the history
  • Loading branch information
gerard2perez committed Mar 25, 2017
1 parent 72cc37d commit ea630fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/functions/emberBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ const postbuildember = async function postBuildEmber (application, options) {
if (attributes) {
attributes = `{{#content "bodyatrributes"}}\n\t\t${attributes}\n\t{{/content}}\n`;
}
let body = (/<.*body.*>((.|\r|\n)*)<\/body>/m).exec(text)[1];
body.match(scripts).forEach(script => {
body = body.replace(script, '');
});
body = body.trim();
text = compile(indextemplate, {
body: body,
bodyatrributes: attributes || '',
title: title,
layout: options.layout || 'main',
Expand Down
3 changes: 3 additions & 0 deletions templates/ember_apps/index.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@
{{jsfiles}}
{{{bundle "{{app_name}}.js"}}}
{{/content}}
{{#content "body"}}
{{body}}
{{/content}}
{{/extend}}

0 comments on commit ea630fe

Please sign in to comment.