The html twig file (html.html.twig) in Drupal 8, what was previously the html.tpl.php in Drupal 7.
If there is no html.html.twig in your theme folder /themes/custom/THEME-NAME/templates, just copy the default html.html.twig file from /site/core/modules/system/templates to this folder.
Thereafter you can edit the file to make the desired modifications. Thus you can for example overwrite the {{ html_attributes }}, what can be an efficient mean to change the language tag (html lang="en") without installing language modules.
![How to add a custom html.html.twig to your Drupal 8 theme](/sites/default/files/2022-03/twig-and-drupal.jpg)
- Log in to post comments