1
0
mirror of synced 2025-12-25 02:17:36 -05:00

return an empty breadcrumbs object on the landing page

This commit is contained in:
Sarah Schneider
2020-12-08 09:50:05 -05:00
parent 2e8b8d3802
commit 38659b37f4

View File

@@ -4,10 +4,12 @@ const { getPathWithoutLanguage } = require('../lib/path-utils')
module.exports = async (req, res, next) => {
if (!req.context.page) return next()
if (req.context.page.hidden) return next()
if (req.context.page.relativePath === 'index.md') return next()
req.context.breadcrumbs = {}
// Return an empty object on the landing page
if (req.context.page.relativePath === 'index.md') return next()
const rawPath = getPathWithoutLanguage(req.path)
const pathParts = rawPath.split('/')