diff options
| author | 2026-05-16 14:01:14 +0700 | |
|---|---|---|
| committer | 2026-05-16 14:01:14 +0700 | |
| commit | ed476a1f0d3f970f977626688ac316f8b251d3a0 (patch) | |
| tree | 8c63d6d01adff1ba0ac510d860753a6a64bf7998 /views | |
| parent | 44b72cbc80fb89788470bda75eeb9c0bb3dee2f5 (diff) | |
| download | web-ed476a1f0d3f970f977626688ac316f8b251d3a0.tar.gz web-ed476a1f0d3f970f977626688ac316f8b251d3a0.zip | |
feat: highlight the blog page visited earlier in blog catalogue
Diffstat (limited to 'views')
| -rw-r--r-- | views/layouts/general-page.html | 1 | ||||
| -rw-r--r-- | views/pages/blog-catalogue.html | 2 | ||||
| -rw-r--r-- | views/pages/blog-page.html | 1 | ||||
| -rw-r--r-- | views/partials/general-page-body.html | 1 |
4 files changed, 4 insertions, 1 deletions
diff --git a/views/layouts/general-page.html b/views/layouts/general-page.html index 491c652..3392ff7 100644 --- a/views/layouts/general-page.html +++ b/views/layouts/general-page.html @@ -659,6 +659,7 @@ hx-trigger="popstate from:window" hx-target="#general-page-body" hx-swap="innerHTML" + hx-include="#general-page-body .htmx-exit-trigger" ></div> <footer diff --git a/views/pages/blog-catalogue.html b/views/pages/blog-catalogue.html index 4a7d9bf..97917d6 100644 --- a/views/pages/blog-catalogue.html +++ b/views/pages/blog-catalogue.html @@ -128,7 +128,7 @@ <div class="relative flex grow h-full"> <div class="absolute w-full h-full inset-0 inset-shadow-[0_0_0.4rem_black] pointer-events-none z-20"></div> - <div hx-get="/api/v1/blog-search" hx-vals='js:{lang: "{{ .Lang }}", tz: clientTimeZone}' hx-target="this" hx-swap="innerHTML" hx-trigger="load" hx-include=".tags-list" + <div hx-get="/api/v1/blog-search" hx-vals='js:{lang: "{{ .Lang }}", tz: clientTimeZone, highlight: "{{ .PreviousBlogPage }}"}' hx-target="this" hx-swap="innerHTML" hx-trigger="load" hx-include=".tags-list" class="blog-cards relative grow flex flex-col overflow-y-auto bg-paper bg-background-light pr-2"> Loading... </div> diff --git a/views/pages/blog-page.html b/views/pages/blog-page.html index 2a1d5d4..a14d85c 100644 --- a/views/pages/blog-page.html +++ b/views/pages/blog-page.html @@ -1,4 +1,5 @@ {{ define "body" }} +<input class="htmx-exit-trigger" type="hidden" name="codename" value="{{ .Codename }}"> <div class="sticky top-0 left-0 w-full h-[100cqb] -mb-[100cqb] inset-shadow-[0_0_0.4rem_black] pointer-events-none z-20"></div> <article class="relative bg-paper bg-background-light flex flex-col px-8 py-4 overflow-y-auto"> <div class="flex flex-col sm:flex-row h-[30cqb] sm:h-[15cqb]"> diff --git a/views/partials/general-page-body.html b/views/partials/general-page-body.html index d697c14..b71a0d1 100644 --- a/views/partials/general-page-body.html +++ b/views/partials/general-page-body.html @@ -1 +1,2 @@ +<input class="htmx-exit-trigger" type="hidden" name="dummy" value=""> {{ block "body" . }}{{ end }}
\ No newline at end of file |