From 766ce1ac51b6ed26a85ae32b3d30634c6d4864c0 Mon Sep 17 00:00:00 2001 From: William Golden Date: Tue, 5 Nov 2013 20:14:23 -0600 Subject: [PATCH] Render a page template if it exists in a theme for a post marked as page. Closes #1329. --- core/server/controllers/frontend.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/server/controllers/frontend.js b/core/server/controllers/frontend.js index 570353b412..856571d35c 100644 --- a/core/server/controllers/frontend.js +++ b/core/server/controllers/frontend.js @@ -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();