mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
Update quartz.layout.ts
This commit is contained in:
parent
6dd0d39a05
commit
5fb66f09f2
@ -33,7 +33,28 @@ export const defaultContentPageLayout: PageLayout = {
|
|||||||
{ Component: Component.Darkmode() },
|
{ Component: Component.Darkmode() },
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
Component.DesktopOnly(Component.RecentNotes({ limit: 10, showTags: false, linkToMore: "recent" })),
|
Component.RecentNotes({
|
||||||
|
title: "最近更新",
|
||||||
|
showTags: false,
|
||||||
|
limit: 4,
|
||||||
|
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: [
|
||||||
@ -52,7 +73,28 @@ export const defaultListPageLayout: PageLayout = {
|
|||||||
Component.MobileOnly(Component.Spacer()),
|
Component.MobileOnly(Component.Spacer()),
|
||||||
Component.Search(),
|
Component.Search(),
|
||||||
Component.Darkmode(),
|
Component.Darkmode(),
|
||||||
Component.DesktopOnly(Component.RecentNotes({ limit: 10, showTags: false,linkToMore: "recent" })),
|
Component.RecentNotes({
|
||||||
|
title: "最近更新",
|
||||||
|
showTags: false,
|
||||||
|
limit: 4,
|
||||||
|
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: [],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user