How to add html head link tag when a specific block is loaded
See NodeViewController::view():

  $build['#attached']['html_head_link'][] = array(
    array(
      'rel' =&gt; $rel,
      'href' =&gt; $node-&gt;url($rel),
    ),
    TRUE,
  );


You can add html_head_link #attached elements anywhere, including in your block, and it will bubble up and be added to any page that shows your block.