Update quartz.layout.ts

This commit is contained in:
enneaa 2025-03-15 09:01:11 +08:00 committed by GitHub
parent 2af1eee575
commit be091a7352
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,13 +33,35 @@ export const defaultContentPageLayout: PageLayout = {   
{ Component: Component.Darkmode() },  { Component: Component.Darkmode() }, 
], ],
}), }),
Component.DesktopOnly(Component.TableOfContents()), Component.DesktopOnly(Component.RecentNotes({
Component.DesktopOnly(Component.Graph()),    title: "最近更新",
showTags: false,
limit: 10,
linkToMore: "recent",
filter: (f) => {
if (f.filePath?.endsWith("index.md")) {
return false
}
return true
},
sort: (f1, f2) => {
if (f1.dates && f2.dates) {
if (Math.abs(f2.dates.modified.getDay() - f1.dates.modified.getDay())<=3) {
return f2.dates.created.getTime() - f1.dates.created.getTime()
}
return f2.dates.modified.getTime() - f1.dates.modified.getTime()
} else if (f1.dates && !f2.dates) {
return -1
}
return 1
}
})),
// Component.Explorer(),      // Component.Explorer(),     
], ],
right: [ right: [
Component.DesktopOnly(Component.TableOfContents()),
Component.Backlinks(),  Component.Backlinks(), 
Component.RecentNotes({ Component.MobileOnly(Component.RecentNotes({
title: "最近更新", title: "最近更新",
showTags: false, showTags: false,
limit: 4, limit: 4,
@ -61,7 +83,7 @@ export const defaultContentPageLayout: PageLayout = {   
} }
return 1 return 1
} }
}), })),
// Component.Graph(),        // Component.Graph(),       
],  ], 
afterBody: [], afterBody: [],
@ -73,14 +95,42 @@ export const defaultListPageLayout: PageLayout = {    
left: [ left: [
Component.PageTitle(), Component.PageTitle(),
Component.MobileOnly(Component.Spacer()),     Component.MobileOnly(Component.Spacer()),    
Component.Search(),   Component.Flex({ 
Component.Darkmode(),   components: [ 
Component.DesktopOnly(Component.TableOfContents()), {
Component.DesktopOnly(Component.Graph()),  Component: Component.Search(), 
grow: true, 
},
{ Component: Component.Darkmode() }, 
],
}),
Component.DesktopOnly(Component.RecentNotes({
title: "最近更新",
showTags: false,
limit: 10,
linkToMore: "recent",
filter: (f) => {
if (f.filePath?.endsWith("index.md")) {
return false
}
return true
},
sort: (f1, f2) => {
if (f1.dates && f2.dates) {
if (Math.abs(f2.dates.modified.getDay() - f1.dates.modified.getDay())<=3) {
return f2.dates.created.getTime() - f1.dates.created.getTime()
}
return f2.dates.modified.getTime() - f1.dates.modified.getTime()
} else if (f1.dates && !f2.dates) {
return -1
}
return 1
}
})),
// Component.Explorer(),     // Component.Explorer(),    
], ],
right: [ right: [
Component.RecentNotes({ Component.MobileOnly(Component.RecentNotes({
title: "最近更新", title: "最近更新",
showTags: false, showTags: false,
limit: 4, limit: 4,
@ -102,6 +152,6 @@ export const defaultListPageLayout: PageLayout = {    
} }
return 1 return 1
} }
}), })),
], ],
} }