0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

🐛 Fix custom robots.txt via template directory. (#8648)

no issue

- serving a custom robots.txt from the active theme didn't work anymore
- re-ordering the blog middleware solves it
- see http://themes.ghost.org/docs/templates#section-robots-txt
This commit is contained in:
Patrick Kim 2017-07-05 18:14:35 -04:00 committed by Katharina Irrgang
parent 49c8277390
commit 83345d706f

View file

@ -48,8 +48,6 @@ module.exports = function setupBlogApp() {
blogApp.use(servePublicFile('public/ghost-url.min.js', 'application/javascript', utils.ONE_HOUR_S));
// Serve sitemap.xsl file
blogApp.use(servePublicFile('sitemap.xsl', 'text/xsl', utils.ONE_DAY_S));
// Serve robots.txt if not found in theme
blogApp.use(servePublicFile('robots.txt', 'text/plain', utils.ONE_HOUR_S));
// Serve stylesheets for default templates
blogApp.use(servePublicFile('public/ghost.css', 'text/css', utils.ONE_HOUR_S));
@ -80,6 +78,9 @@ module.exports = function setupBlogApp() {
blogApp.use(staticTheme());
debug('Static content done');
// Serve robots.txt if not found in theme
blogApp.use(servePublicFile('robots.txt', 'text/plain', utils.ONE_HOUR_S));
// setup middleware for internal apps
// @TODO: refactor this to be a proper app middleware hook for internal & external apps
config.get('apps:internal').forEach(function (appName) {