public function getNodeCanonical(NodeInterface $node) : ?string
    {
        if ($this->isNodeBlacklisted($node)) {
            return null;
        }

        $site = null;
        $alias = null;

        if ($this->shareCanonicalAcrossSites) {
            $storage = $this->siteManager->getStorage();

            // Very fist site is the right one for canonical URL
            if ($node->site_id) {
                $site = $storage->findOne($node->site_id);
                if ($site->getState() !== SiteState::ON) {
                    $site = null;
                }
            }
        }

        // If no site, fetch on the current site
        if (!$site) {
            if ($this->siteManager->hasContext()) {
                $site = $this->siteManager->getContext();
            }
        }

        if ($site) {
            $alias = $this->aliasManager->getPathAlias($node->id(), $site->getId());
        }

        if (!$alias) {
            // No alias at all means that the canonical is the node URL in the
            // current site, I am sorry I can't provide more any magic here...
            return url('node/' . $node->id(), ['absolute' => true]);
        }

        return $this->siteManager->getUrlGenerator()->generateUrl($site, $alias, ['absolute' => true], true);
    }