world-game/site/snippets/header.php
isUnknown 88bc02b9cf
All checks were successful
Deploy / Deploy to Production (push) Successful in 20s
site panel : add dynamic favicon
2026-03-26 11:38:19 +01:00

33 lines
1.3 KiB
PHP

<!DOCTYPE html>
<html lang="<?= $kirby->language()?->code() ?? 'fr' ?>">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php snippet('seo/head') ?>
<!-- Favicon -->
<link rel="icon" type="image/png" href="<?= url('assets/favicon.png') ?>">
<?php if (file_exists('assets/dist')): ?>
<!-- Production: Load compiled assets -->
<script type="module" src="<?= url('assets/dist/index.js') ?>" defer></script>
<link rel="stylesheet" href="<?= url('assets/dist/main.css') ?>">
<?php else: ?>
<!-- Development: Load from Vite dev server -->
<script type="module" src="http://localhost:5173/@vite/client" defer></script>
<script type="module" src="http://localhost:5173/src/main.js" defer></script>
<?php endif ?>
<?php if ($site->faviconPNG()->isNotEmpty()): ?>
<link rel="icon" type="image/png" href="<?= $site->faviconPNG()->toFile()->url() ?>" sizes="96x96" />
<?php endif ?>
<?php if ($site->faviconSVG()->isNotEmpty()): ?>
<link rel="icon" type="image/svg+xml" href="<?= $site->faviconSVG()->toFile()->url() ?>" />
<?php endif ?>
<?php if ($site->faviconICO()->isNotEmpty()): ?>
<link rel="shortcut icon" href="<?= $site->faviconICO()->toFile()->url() ?>" />
<?php endif ?>
</head>
<body>
<div id="app"></div>