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:
commit
ae236068dd
1 changed files with 6 additions and 1 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue