How do I modify the breadcrumb?
As comment said above, you have to implement Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface. Here is a working snippet that I use to implement those Breadcrumbs :

It appends a custom routename to all 'Nodes' pages :


&lt;?php

namespace Drupal\Your_Module_Namespace\Breadcrumb;

use Drupal;
use Drupal\Core\Breadcrumb\Breadcrumb;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
use Drupal\Core\Link;
use Drupal\Core\Routing\RouteMatchInterface;

class Your_Module_NamespaceBreadCrumbBuilder implements BreadcrumbBuilderInterface {

  /**
   * {@inheritdoc}
   */
  public function applies(RouteMatchInterface $attributes) {
    $parameters = $attributes-&gt;getParameters()-&gt;all();
    // I need my breadcrumbs for a few node types ONLY,
    // so it should be applied on node page ONLY.
    if (isset($parameters['node']) &amp;&amp; !empty($parameters['node'])) {
      return TRUE;
    }
  }

  /**
   * {@inheritdoc}
   */
  public function build(RouteMatchInterface $route_match) {
    $breadcrumb = new Breadcrumb();
    $breadcrumb-&gt;addLink(Link::createFromRoute('Home', '&lt;front&gt;'));

    $node = Drupal::routeMatch()-&gt;getParameter('node');
    $node_type = $node-&gt;bundle();

    // Put the needed logic here

    // addLink example
    $breadcrumb-&gt;addLink(Link::createFromRoute('My Page Name', 'drupal_internal.routename'));
    $breadcrumb-&gt;addCacheContexts(['route']);

    return $breadcrumb;
  }
}