0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

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) { api.posts.read({'slug': req.params.slug}).then(function (post) {
if (post) { if (post) {
ghost.doFilter('prePostsRender', post).then(function (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 { } else {
next(); next();