favicon
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user