Next/Prev stuff

This commit is contained in:
Simon Martens
2025-03-30 18:12:52 +02:00
parent 316e8e3f58
commit 0e2c6360bf
25 changed files with 355 additions and 67 deletions

View File

@@ -1,53 +0,0 @@
<!doctype html>
<html class="w-full h-full" {{ if .lang }}lang="{{ .lang }}"{{ end }}>
<head>
<meta charset="UTF-8" />
<meta
name="htmx-config"
content='{"defaultSwapStyle":"outerHTML", "scrollBehavior": "instant"}' />
{{ block "head" . }}
<!-- Default Head elements -->
{{ end }}
{{ if .isDev }}
<link rel="icon" href="/assets/logo/dev_favicon.png" />
<meta name="robots" content="noindex" />
{{ else }}
{{ if .url }}
<link rel="canonical" href="{{ .url }}" />
{{ end }}
<link rel="icon" href="/assets/logo/favicon.png" />
{{ end }}
<script src="/assets/js/alpine.min.js" defer></script>
<script src="/assets/js/htmx.min.js" defer></script>
<script src="/assets/js/htmx-response-targets.js" defer></script>
<script src="/assets/js/mark.min.js" defer></script>
<script type="module" src="/assets/scripts.js"></script>
<link href="/assets/css/remixicon.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="/assets/css/fonts.css" />
<link rel="stylesheet" type="text/css" href="/assets/style.css" />
<script type="module">
document.body.addEventListener("htmx:responseError", function (event) {
const config = event.detail.requestConfig;
if (config.boosted) {
document.body.innerHTML = event.detail.xhr.responseText;
const newUrl = event.detail.xhr.responseURL || config.url;
window.history.pushState(null, "", newUrl);
}
});
</script>
</head>
<body class="w-full min-h-full" hx-ext="response-targets" hx-boost="true">
<div class="pb-12">
{{ block "body" . }}
<!-- Default app body... -->
{{ end }}
</div>
</body>
</html>

View File

@@ -1 +1,10 @@
{{ $model := . }}
<nav class="flex flex-row gap-x-1 justify-between">
<div>
<a class="inline-block px-0.5" href="/"> J.M.R. Lenz: Kritische Briefausgabe </a>
</div>
<a href="/jahrgang/1765" class="inline-block px-0.5">Jahrgänge </a>
{{ .path }}
</nav>

View File

@@ -23,6 +23,7 @@
<script type="module" src="/assets/scripts.js"></script>
<link rel="stylesheet" type="text/css" href="/assets/style.css" />
<link rel="stylesheet" type="text/css" href="/assets/css/remixicon.css" />
</head>
<body class="w-full text-lg" hx-ext="response-targets" hx-boost="true">
@@ -33,7 +34,7 @@
{{ end }}
</header>
<main class="grow">
<main class="grow container-normal" id="main">
{{ block "body" . }}
<!-- Default app body... -->
{{ end }}