Custom Theme - Add page specific meta tags / title to pages
You can attach the tag to the page's render array via hook_page_attachments_alter(). 

An example from the related change record:

function MYTHEME_page_attachments_alter(array &amp;$page) {
    $viewport = array(
        '#type' =&gt; 'html_tag',
        '#tag' =&gt; 'meta',
        '#attributes' =&gt; array(
            'name' =&gt; 'viewport',
            'content' =&gt; 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no',
        ),
    );
    $page['#attached']['html_head'][] = [$viewport, 'viewport'];
}