From 80136ac414d9cc8b29a9f1d9f9eb5ec71c9166dc Mon Sep 17 00:00:00 2001 From: "weicw1996@qq.com" Date: Tue, 29 Sep 2026 05:18:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(search):=20=E6=90=9C=E7=B4=A2=E9=A1=B5?= =?UTF-8?q?=E4=B8=80=E5=BE=8B=20noindex=EF=BC=8C=E5=B9=B6=E6=8A=8A?= =?UTF-8?q?=E9=85=8D=E8=89=B2=E5=AF=B9=E9=BD=90=20template-07?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 两处收尾,均针对当前启用的 template-07。 1) SEO 收口(ticket 05) 原实现只在带关键词时 noindex,不带关键词时输出 index,follow——等于邀请 搜索引擎收录一个只有「请输入关键词」的空页。改为无条件 noindex,follow: - 带关键词:同一批内容有无数种关键词组合入口,典型低质量/易重复页面 (沿用 useModuleRoute.ts 对 /article?keywords= 的既有约定) - 不带关键词:空页,对搜索引擎和用户都是垃圾页 - 保留 follow 而非 nofollow,让爬虫仍能顺着结果链接爬到详情页 无关键词时空页保持显示引导文案,不 404、不重定向——被索引才是问题, 而它已被 noindex 解决。canonical 维持指向 /search;sitemap 经运行时验证 本就不含搜索页(269 条 URL 无命中)。 明确不做:不把 /search 加进 robots.txt 的 Disallow。Disallow 是「禁止抓取」, 爬虫遵守后就不会去读页面里的 noindex,URL 仍可能出现在结果里(只是没有标题 摘要)——反而更糟。故 server/api/robots.txt.ts 未改动。 2) 配色对齐 template-07 搜索页原用 navy #1E2A47,与本模板不符:template-07 主色是 #1a6dff, 其 TenderList 用 text-blue-600 渲染价格。已改为: - 主色(按钮/聚焦边框/选中 Tab/计数)#1E2A47 -> #1a6dff - 标书价格 red #E5472E -> #2563eb(对齐 TenderList 的 text-blue-600) - 链接蓝统一为小写 #2563eb 实测:带/不带关键词两种情况的 robots 均为 noindex,follow;页面总数与三个 Tab 渲染正常;eslint 0 error / 0 warning。 --- app/components/SearchResult.vue | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/components/SearchResult.vue b/app/components/SearchResult.vue index ad43528..fd558fa 100644 --- a/app/components/SearchResult.vue +++ b/app/components/SearchResult.vue @@ -7,11 +7,11 @@ v-model="inputKeyword" type="text" placeholder="请输入关键词..." - class="min-w-0 flex-1 rounded-full border border-gray-300 bg-[#F9FAFB] px-4 py-2.5 text-sm outline-none transition-colors focus:border-[#1E2A47] focus:bg-white" + class="min-w-0 flex-1 rounded-full border border-gray-300 bg-[#F9FAFB] px-4 py-2.5 text-sm outline-none transition-colors focus:border-[#1a6dff] focus:bg-white" > @@ -25,7 +25,7 @@