Ghost/core/server/routes/frontend.js
Mark Berger 075dd8ac9b Static pages do not use dated permalinks
closes #1753
- Pages are registered to '/:slug/' route if posts are using dated permalinks
2013-12-28 12:47:52 -05:00

20 lines
715 B
JavaScript

var frontend = require('../controllers/frontend'),
api = require('../api');
module.exports = function (server) {
// ### Frontend routes
/* TODO: dynamic routing, homepage generator, filters ETC ETC */
server.get('/rss/', frontend.rss);
server.get('/rss/:page/', frontend.rss);
server.get('/page/:page/', frontend.homepage);
server.get('/', frontend.homepage);
api.settings.read('permalinks').then(function (permalinks) {
if (permalinks.value !== '/:slug/') {
server.get('/:slug/', frontend.page);
server.get(permalinks.value, frontend.post);
} else {
server.get(permalinks.value, frontend.single);
}
});
};