<script src="/pagefind/pagefind-ui.js"></script>

{{ $js := resources.Get "js/main.js" | resources.Minify | resources.Fingerprint }}
<script src="{{ $js.RelPermalink }}" defer></script>


<script>
  window.addEventListener("DOMContentLoaded", (event) => {
    new PagefindUI({ element: "#search", showSubResults: true,highlightParam: "highlight" });
  });
</script>

<script>
  const dialog = document.querySelector("dialog");
  const showButton = document.getElementById("createStoryBtn");
  const closeButton = document.getElementById("closeStoryModal");

  // "Show the dialog" button opens the dialog modally
  showButton.addEventListener("click", () => {
    dialog.showModal();
  });

  // "Close" button closes the dialog
  closeButton.addEventListener("click", () => {
    dialog.close();
  });
</script>
