Merge pull request #1412 from egdelwonk/feature/1329_page_template

Render a page template if it exists in a theme for a post marked as page
This commit is contained in:
Hannah Wolfe 2013-11-06 12:31:14 -08:00
commit ae236068dd

View File

@ -66,7 +66,12 @@ frontendControllers = {
api.posts.read({'slug': req.params.slug}).then(function (post) {
if (post) {
ghost.doFilter('prePostsRender', post).then(function (post) {
res.render('post', {post: post});
var paths = ghost.paths().availableThemes[ghost.settings('activeTheme')];
if (post.page && paths.hasOwnProperty('page')) {
res.render('page', {post: post});
} else {
res.render('post', {post: post});
}
});
} else {
next();