mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 22:11:09 +03: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:
commit
ae236068dd
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user