MCPcopy Create free account
hub / github.com/github/docs / breadcrumbs

Function breadcrumbs

middleware/contextualizers/breadcrumbs.js:1–16  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

1export default function breadcrumbs(req, res, next) {
2 if (!req.context.page) return next()
3 const isEarlyAccess = req.context.page.relativePath.startsWith('early-access')
4 if (req.context.page.hidden && !isEarlyAccess) return next()
5
6 req.context.breadcrumbs = []
7
8 // Return an empty array on the landing page.
9 if (req.context.page.documentType === 'homepage') {
10 return next()
11 }
12
13 req.context.breadcrumbs = getBreadcrumbs(req, isEarlyAccess)
14
15 return next()
16}
17
18const earlyAccessExceptions = ['insights', 'enterprise-importer']
19

Callers

nothing calls this directly

Calls 2

getBreadcrumbsFunction · 0.85
nextFunction · 0.50

Tested by

no test coverage detected