From 0eca875f6ea2f3d5849bcd66f9c5eb036ae5ea12 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 27 Aug 2015 16:30:43 -0400 Subject: [PATCH] add site title to 404, on cold load anyways --- src/controllers/helpers.js | 12 ++++++++++-- src/routes/index.js | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/controllers/helpers.js b/src/controllers/helpers.js index 6a35540088..001c30c611 100644 --- a/src/controllers/helpers.js +++ b/src/controllers/helpers.js @@ -19,9 +19,17 @@ helpers.notFound = function(req, res, error) { error: error }); } else if (res.locals.isAPI) { - res.status(404).json({path: req.path.replace(/^\/api/, ''), error: error}); + res.status(404).json({ + path: req.path.replace(/^\/api/, ''), + error: error, + title: '[[global:404.title]]' + }); } else { - res.status(404).render('404', {path: req.path, error: error}); + res.status(404).render('404', { + path: req.path, + error: error, + title: '[[global:404.title]]' + }); } }; diff --git a/src/routes/index.js b/src/routes/index.js index 823cd45f8a..4d95ccb25f 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -193,7 +193,7 @@ function handle404(app, middleware) { } middleware.buildHeader(req, res, function() { - res.render('404', {path: req.path}); + res.render('404', {path: req.path, title: '[[global:404.title]]'}); }); } else { res.status(404).type('txt').send('Not found');