mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-25 22:04:06 -06:00
Update quartz.layout.ts
This commit is contained in:
parent
9668be4be1
commit
90a487f07a
@ -5,12 +5,29 @@ import * as Component from "./quartz/components"
|
|||||||
export const sharedPageComponents: SharedLayout = {
|
export const sharedPageComponents: SharedLayout = {
|
||||||
head: Component.Head(),
|
head: Component.Head(),
|
||||||
header: [],
|
header: [],
|
||||||
afterBody: [],
|
afterBody: [],
|
||||||
left: [Component.RecentNotes({
|
left: [Component.RecentNotes({
|
||||||
title: "最近笔记",
|
title: "最近更新",
|
||||||
limit: 5,
|
showTags: false,
|
||||||
showTags: true
|
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
|
||||||
|
}
|
||||||
|
})],
|
||||||
footer: Component.Footer({
|
footer: Component.Footer({
|
||||||
links: {
|
links: {
|
||||||
GitHub: "https://github.com/jackyzha0/quartz",
|
GitHub: "https://github.com/jackyzha0/quartz",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user