<!DOCTYPE html>
<html lang="fr">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>
    <?= e($page->isHomePage() != true, $page->title() . ' - ') . $site->title() ?>
  </title>

  <link rel="stylesheet" href="<?= url('assets/css/style.css') ?>">
  <link rel="stylesheet" href="<?= url('assets/css/pagedjs-interface.css') ?>">

  <!-- À SUPPRIMER EN PRODUCTION -->
  <meta name="robots" content="noindex, nofollow, noarchive">

  <!-- CSRF Token for API calls -->
  <?php if ($kirby->user()): ?>
  <meta name="csrf" content="<?= csrf() ?>">
  <?php endif ?>

  <!-- APP -->
  <?php if (Dir::exists('assets/dist')): ?>
    <script type="module"
      src="<?= url('assets/dist/index.js') ?>" defer></script>
    <link rel="stylesheet"
      href="<?= url('assets/dist/index.css') ?>">
  <?php else: ?>
    <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 ?>
</head>

<body data-template="<?= $page->template() ?>"<?php if (isset($narrativeJsonUrl)): ?> data-narrative-url="<?= $narrativeJsonUrl ?>"<?php endif ?>>
<div id="app">