修复筛选模式
This commit is contained in:
parent
8ec3fe5df0
commit
6e96b59245
@ -112,7 +112,8 @@ const breadcrumbs: Breadcrumb[] = pathSegments
|
|||||||
<div class="flex items-center overflow-hidden">
|
<div class="flex items-center overflow-hidden">
|
||||||
<span class="mx-2 text-secondary-300 dark:text-secondary-600 flex-shrink-0">/</span>
|
<span class="mx-2 text-secondary-300 dark:text-secondary-600 flex-shrink-0">/</span>
|
||||||
<span class="text-secondary-600 dark:text-secondary-400 truncate max-w-[120px] sm:max-w-[180px] md:max-w-[250px]">
|
<span class="text-secondary-600 dark:text-secondary-400 truncate max-w-[120px] sm:max-w-[180px] md:max-w-[250px]">
|
||||||
搜索结果
|
筛选
|
||||||
|
{searchParams.toString() && <span class="ml-1">- 搜索结果</span>}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -129,7 +130,7 @@ const breadcrumbs: Breadcrumb[] = pathSegments
|
|||||||
<!-- 视图切换按钮 - 仅在文章列表页面显示 -->
|
<!-- 视图切换按钮 - 仅在文章列表页面显示 -->
|
||||||
{(pageType === 'filter' || pageType === 'grid') && (
|
{(pageType === 'filter' || pageType === 'grid') && (
|
||||||
<div class="flex items-center gap-px flex-shrink-0 ml-auto">
|
<div class="flex items-center gap-px flex-shrink-0 ml-auto">
|
||||||
<a href={`/articles${searchParams.toString() ? `?${searchParams.toString()}` : ''}`}
|
<a href={`/filtered${searchParams.toString() ? `?${searchParams.toString()}` : ''}`}
|
||||||
class={`px-3 py-1.5 flex items-center gap-1 ${
|
class={`px-3 py-1.5 flex items-center gap-1 ${
|
||||||
pageType === 'filter'
|
pageType === 'filter'
|
||||||
? 'text-primary-600 dark:text-primary-400 font-medium'
|
? 'text-primary-600 dark:text-primary-400 font-medium'
|
||||||
@ -288,7 +289,7 @@ const breadcrumbs: Breadcrumb[] = pathSegments
|
|||||||
// 检查URL中是否有查询参数
|
// 检查URL中是否有查询参数
|
||||||
if (searchParams) {
|
if (searchParams) {
|
||||||
// 有查询参数,返回筛选页面
|
// 有查询参数,返回筛选页面
|
||||||
window.location.href = `/articles${searchParams}`;
|
window.location.href = `/filtered${searchParams}`;
|
||||||
} else {
|
} else {
|
||||||
// 没有查询参数,返回默认路径
|
// 没有查询参数,返回默认路径
|
||||||
const defaultPath = backButton.getAttribute('data-path') || '';
|
const defaultPath = backButton.getAttribute('data-path') || '';
|
||||||
|
@ -5,6 +5,7 @@ export const SITE_DESCRIPTION = "记录生活,分享所思";
|
|||||||
export const NAV_LINKS = [
|
export const NAV_LINKS = [
|
||||||
{ href: '/', text: '首页' },
|
{ href: '/', text: '首页' },
|
||||||
{ href: '/articles', text: '文章' },
|
{ href: '/articles', text: '文章' },
|
||||||
|
{ href: '/filtered', text: '筛选' },
|
||||||
{ href: '/movies', text: '观影' },
|
{ href: '/movies', text: '观影' },
|
||||||
{ href: '/books', text: '读书' },
|
{ href: '/books', text: '读书' },
|
||||||
{ href: '/projects', text: '项目' },
|
{ href: '/projects', text: '项目' },
|
||||||
|
File diff suppressed because it is too large
Load Diff
1416
src/pages/filtered/index.astro
Normal file
1416
src/pages/filtered/index.astro
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user