mirror of
https://github.com/aljazceru/njump.git
synced 2026-01-11 10:34:44 +01:00
49 lines
1.9 KiB
Plaintext
49 lines
1.9 KiB
Plaintext
package main
|
|
|
|
import "fmt"
|
|
|
|
templ archiveTemplate(params ArchivePageParams) {
|
|
<!DOCTYPE html>
|
|
<html class="theme--default text-lg font-light print:text-base sm:text-xl">
|
|
<meta charset="UTF-8"/>
|
|
<head>
|
|
<title>{ params.Title }</title>
|
|
@headCommonTemplate(params.HeadParams)
|
|
</head>
|
|
<body class="mb-16 bg-white text-gray-600 dark:bg-neutral-900 dark:text-neutral-50 print:text-black">
|
|
@topTemplate(params.HeadParams)
|
|
<div class="mx-auto block px-4 sm:flex sm:items-center sm:justify-center sm:px-0">
|
|
<div class="w-full max-w-screen-2xl gap-10 overflow-visible print:w-full sm:flex sm:w-11/12 sm:px-4 md:w-10/12 lg:w-9/12 lg:gap-48vw">
|
|
<div class="relative top-auto flex basis-1/5 sm:max-w-[20%] items-center self-start sm:sticky sm:top-8 sm:mt-8 sm:block sm:items-start">
|
|
<div
|
|
class="hidden text-2xl"
|
|
_="on load or scroll from window or resize from window get #page_name then measure its top, height then if top is less than height / -2 or height is 0 remove .hidden otherwise add .hidden"
|
|
>{ params.Title }</div>
|
|
</div>
|
|
<div class="w-full break-words break-all print:w-full basis-3/5">
|
|
<div id="page_name" class="mb-6 leading-5">
|
|
<h1 class="hidden sm:block text-2xl">{ params.Title }</h1>
|
|
</div>
|
|
<div class="mb-6 leading-5">
|
|
for _, v:= range params.Data {
|
|
<a class="block" href={ templ.URL("/" + params.PathPrefix + v) }>
|
|
{ v }
|
|
</a>
|
|
}
|
|
</div>
|
|
<div class="flex justify-between">
|
|
if params.PrevPage != 0 {
|
|
<a href={ templ.URL(fmt.Sprintf("/%s/%d", params.PaginationUrl, params.PrevPage)) }><< Prev page</a>
|
|
}
|
|
if params.NextPage != 0 {
|
|
<a href={ templ.URL(fmt.Sprintf("/%s/%d", params.PaginationUrl, params.NextPage)) }>Next page >></a>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@footerTemplate()
|
|
</body>
|
|
</html>
|
|
}
|