From a1bcd913bf756d55a1a7e925141bcc14c939e5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Fri, 6 Oct 2017 17:02:54 +0200 Subject: [PATCH] fix(title): use correct title for landing pages --- routes/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/routes/index.js b/routes/index.js index 8125467..9b41ad9 100644 --- a/routes/index.js +++ b/routes/index.js @@ -6,7 +6,14 @@ const router = express.Router() /* GET the home landing page. */ router.get('/', catchErrors(async function (req, res, next) { const landingPage = await getLandingPage('home', req.query.locale, req.query.api) - res.render('landingPage', { title: 'Contentful University', landingPage }) + let title = landingPage.fields.title + if (!title || landingPage.fields.slug === 'home') { + title = 'The Example App' + } + res.render('landingPage', { + title, + landingPage + }) })) module.exports = router