From 8d8773917f474033ad4d54fe245ec5749d704dde Mon Sep 17 00:00:00 2001 From: nonylene Date: Tue, 9 Jan 2024 00:52:38 +0900 Subject: [PATCH] Add query to title Close #4 --- app/routes/search.pukiwiki/route.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/routes/search.pukiwiki/route.tsx b/app/routes/search.pukiwiki/route.tsx index 03fcd57..c90bba6 100644 --- a/app/routes/search.pukiwiki/route.tsx +++ b/app/routes/search.pukiwiki/route.tsx @@ -24,8 +24,9 @@ import { StatusIndicator } from "~/components/status-indicator"; import { ELASTIC_SEARCH_MAX_SEARCH_WINDOW } from "~/utils"; import { parseSearchParams, setNewOrder, setNewPage } from "~/utils/pukiwiki"; -export const meta: MetaFunction = () => { - return [{ title: "PukiWiki - Heineken" }]; +export const meta: MetaFunction = ({ location }) => { + const { query } = parseSearchParams(new URLSearchParams(location.search)); + return [{ title: `${query ? `${query} - ` : ""}PukiWiki - Heineken` }]; }; export const links: LinksFunction = () => [