public function build(RouteMatchInterface
$route_match) { $breadcrumb =
new Breadcrumb();
$links =
[];
// Add the url.path.parent cache context. This code ignores the last path
// part so the result only depends on the path parents.
$breadcrumb->
addCacheContexts(['url.path.parent', 'url.path.is_front'
]);
// Do not display a breadcrumb on the frontpage.
if ($this->pathMatcher->
isFrontPage()) { return $breadcrumb;
} // General path-based breadcrumbs. Use the actual request path, prior to
// resolving path aliases, so the breadcrumb can be defined by simply
// creating a hierarchy of path aliases.
$path =
trim($this->context->
getPathInfo(), '/'
);
$path_elements =
explode('/',
$path);
$exclude =
[];
// Don't show a link to the front-page path.
$front =
$this->config->
get('page.front'
);