Update quartz.layout.ts

This commit is contained in:
enneaa 2025-03-13 01:55:20 +08:00 committed by GitHub
parent 6e6af43a72
commit 6d7e6aedfb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,33 +4,12 @@ import * as Component from "./quartz/components"
// components shared across all pages // components shared across all pages
export const sharedPageComponents: SharedLayout = { export const sharedPageComponents: SharedLayout = {
head: Component.Head(), head: Component.Head(),
header: [],  header: [],
afterBody: [Component.RecentNotes({  afterBody: [],
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
}
})], 
footer: Component.Footer({ footer: Component.Footer({
links: { links: {
GitHub: "https://github.com/jackyzha0/quartz", GitHub: "https://github.com/jackyzha0/quartz",
"Scroll to top ↑": "#", "Discord Community": "https://discord.gg/cRFFHYye7t",
}, },
}), }),
} }