This commit is contained in:
2026-10-20 18:07:21 +02:00
parent 855364ee89
commit 17527bab43
5 changed files with 54 additions and 0 deletions
+11
View File
@@ -42,6 +42,17 @@ function leshed_page_attachments_alter(&$page) {
];
}
}
// favicon.ico (racine du thème) est servi par Drupal ; on ajoute la version
// SVG, prioritaire pour les navigateurs qui la gèrent, et l'icône iOS.
$theme_path = base_path() . \Drupal::service('extension.list.theme')->getPath('leshed') . '/';
$icons = [
'leshed_favicon_svg' => ['rel' => 'icon', 'href' => $theme_path . 'favicon.svg', 'type' => 'image/svg+xml'],
'leshed_apple_touch_icon' => ['rel' => 'apple-touch-icon', 'href' => $theme_path . 'apple-touch-icon.png'],
];
foreach ($icons as $key => $attributes) {
$page['#attached']['html_head'][] = [['#tag' => 'link', '#attributes' => $attributes], $key];
}
}
/**
* Implements hook_preprocess_HOOK() for html.html.twig.