Alter/customize/extend html.html.twig in subtheme

Created on 16 July 2021, almost 3 years ago
Updated 23 September 2023, 9 months ago

Hello, I have created a subtheme and have no problem customizing page.html.twig; however, for html.html.twig I'm not sure how to proceed. Can't find any documentation on this.

At the moment, my only need is to embed some Google Fonts into the head tag; I could have just imported them in the css, but when aggregating css files in Drupal, having such css imports causes errors that are avoided by embedding them in the head.

Anyway, as said, I'm not sure how to proceed. If I simply copy the html.html.twig from the main theme to the subtheme and edit it, it works as expected, but of course, if any future update of the main theme brings a modification of that file, with that method I'll remain stuck with the old version, which could also cause some issue.
So, is there a way to extend it as for page.html.twig? And which would the proper syntax be? Or is there something else I should do?

πŸ’¬ Support request
Status

Closed: works as designed

Version

5.1

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024