How to add a referenced taxonomy term name to the node title in page-title.html.twig Using a term reference field, I am adding the manufacturer's name to the front of our node titles in views for styling and line breaks between the manufacturer field and the title which is really nice. For the node display titles, I am currently using a block view for the manufacturer's name, and placing it above the page title block in the block layout. This stacks the Manufacturers name above the Node title which i don't really prefer:

Manufacturer
Some Node Title

I would like to add the field_manufacturer field to the node display title as a prefix so that it is inline and not stacked like my example above, and I need to add a class to it so that I can target and style it. I am not sure which twig file is responsible for rendering the title, so I would really appreciate help marking this up properly.

Thanks!
Posting this answer to help those trying to accomplish the same thing. I was told the code above had security vulnerabilities (which has since been removed see comments below).  On the Drupal Slack channel, someone pointed out the following concern with runwithscissors' answer: 


  "This code is potentially dangerous:$variables['title'] = \Drupal\Core\Render\Markup::create($new_title); A user could set &lt;script&gt;alert("foo")&lt;/script&gt; as the Node or Term title and potentially execute code on the site. Typically you don’t want to ever create Markup objects manually. For what you’re doing, I’d suggest setting $term_name to a new key in $variables, then forming your combined title in the Twig template like {{ term_name}} {{ title }}"


So what i ended up doing was adding this template_preprocess_page_title to my MY_SITE.theme file. 

(Note:  field_manufacturer is the specific field for my use case, so you would need to change all instances of that to your taxonomy reference field name.)

/* Add field_manufacturer to all node titles with field_manufacturer and not empty */
function template_preprocess_page_title(&amp;$variables) {
   $node = \Drupal::request()-&gt;attributes-&gt;get('node');
   if ($node &amp;&amp; $node-&gt;hasField('field_manufacturer') &amp;&amp; !$node-&gt;field_manufacturer-&gt;isEmpty()) {
     $term = \Drupal\taxonomy\Entity\Term::load($node-&gt;get('field_manufacturer')-&gt;target_id);
     $term_name = $term-&gt;getName();
     $variables['term_name'] = $term-&gt;getName();
   }
 }


This applies to all nodes with the field_manufacturer, but also checks that the term field is NOT empty with &amp;&amp; !$node-&gt;field_manufacturer-&gt;isEmpty()). This was critical as the reference field was not required, so nodes that had the field but didn't have a value crashed the site with Error: Call to a member function getName() on null in template_preprocess_page_title()

Then I copied and overwrote the page-title.html.twig file from my bootstrap base theme which originally renders the title like this:

{% if title %}
  &lt;h1{{ title_attributes.addClass('page-header') }}&gt;{{ title }}&lt;/h1&gt;
{% endif %}


And changed the H1 title line to this:

{% if title %}
  &lt;h1{{ title_attributes.addClass('page-header') }}&gt;
    {% if term_name %}
      &lt;span class="MY-DESIRED-CLASS-NAME"&gt;{{ term_name }}&lt;/span&gt;
    {% endif %}
  {{ title }}&lt;/h1&gt;
{% endif %}


This adds a MY-DESIRED-CLASS-NAME span class to the term_name. Also by putting it within {% if term_name %}/{% endif %} statement, it prevents that class from being rendered in the html where there is no term_name present.

Hope this helps someone!