Skip to content

Commit 38659b3

Browse files
committed
return an empty breadcrumbs object on the landing page
1 parent 2e8b8d3 commit 38659b3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

middleware/breadcrumbs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ const { getPathWithoutLanguage } = require('../lib/path-utils')
44
module.exports = async (req, res, next) => {
55
if (!req.context.page) return next()
66
if (req.context.page.hidden) return next()
7-
if (req.context.page.relativePath === 'index.md') return next()
87

98
req.context.breadcrumbs = {}
109

10+
// Return an empty object on the landing page
11+
if (req.context.page.relativePath === 'index.md') return next()
12+
1113
const rawPath = getPathWithoutLanguage(req.path)
1214
const pathParts = rawPath.split('/')
1315

0 commit comments

Comments
 (0)