From 7d79eba75641387ceb42b993324d5fb877cde74c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=A2=E6=9D=A1?= Date: Mon, 27 Apr 2026 19:34:13 +0800 Subject: [PATCH] refactor: update tag search URLs to use query parameters --- README.zh-cn.md | 2 +- src/components/item.astro | 5 +++-- src/lib/telegram/index.ts | 2 +- src/middleware.ts | 28 ++++++++++++++++++++++++---- src/pages/tags.astro | 12 ++++++++---- 5 files changed, 37 insertions(+), 12 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 387007e..cc3f61c 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -48,7 +48,7 @@ - [Abner's memos](https://memos.abnerz6.top/) - [小众软件的发现](https://talk.appinn.net/) - [小报童优惠与排行榜](https://youhui.xiaobaoto.com/) -- [热干面拌 10 号土豆泥](https://memo.moran.im/) +- [热干面拌 10 号土豆泥](https://memo.moran.im/) ### 平台 diff --git a/src/components/item.astro b/src/components/item.astro index d09f30f..4144045 100644 --- a/src/components/item.astro +++ b/src/components/item.astro @@ -39,6 +39,7 @@ const tagStandaloneClass = 'pt-[30px]' const tagLinkClass = 'inline-block rounded-[4px] border border-line px-[10px] py-[2px] text-muted no-underline hover:border-accent hover:text-accent hover:no-underline' const commentsClass = 'ml-[3px] border-l-2 border-line pb-6 pl-[15px] pt-[6px] sm:pl-[30px]' +const getTagHref = (tag: string) => `/search/result?q=${encodeURIComponent(`#${tag}`)}` ---
@@ -84,8 +85,8 @@ const commentsClass = 'ml-[3px] border-l-2 border-line pb-6 pl-[15px] pt-[6px] s hasTags && (