v3: search engine, responsive header with compact user menu

This commit is contained in:
khannurien
2026-03-29 11:56:31 +00:00
parent f0f6472db6
commit cbb3505139
31 changed files with 1206 additions and 178 deletions

View File

@@ -1,3 +1,8 @@
import {
PAGINATION_DEFAULT_LIMIT,
PAGINATION_MAX_LIMIT,
} from "../config.ts";
/**
* Parses page/limit query parameters with sensible defaults and bounds.
* page: clamped to [1, ∞)
@@ -5,7 +10,7 @@
*/
export function parsePagination(
params: URLSearchParams,
defaultLimit = 20,
defaultLimit = PAGINATION_DEFAULT_LIMIT,
): { page: number; limit: number } {
const page = Math.max(
1,
@@ -16,7 +21,7 @@ export function parsePagination(
1,
parseInt(params.get("limit") ?? String(defaultLimit)) || defaultLimit,
),
100,
PAGINATION_MAX_LIMIT,
);
return { page, limit };
}