mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-26 22:34:06 -06:00
Update quartz.config.ts
This commit is contained in:
parent
6bae7046c1
commit
ba292983a1
@ -1,12 +1,13 @@
|
|||||||
import { QuartzConfig } from "./quartz/cfg"
|
import { QuartzConfig } from "./quartz/cfg"
|
||||||
import * as Plugin from "./quartz/plugins"
|
import * as Plugin from "./quartz/plugins"
|
||||||
|
import * as Component from "./quartz/components" // 添加这行
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Quartz 4 Configuration
|
* Quartz 4 Configuration
|
||||||
*
|
*
|
||||||
* See https://quartz.jzhao.xyz/configuration for more information.
|
* See https://quartz.jzhao.xyz/configuration for more information.
|
||||||
*/
|
*/
|
||||||
const config: QuartzConfig = {
|
const config: QuartzConfig = {
|
||||||
configuration: {
|
configuration: {
|
||||||
pageTitle: "是話說",
|
pageTitle: "是話說",
|
||||||
pageTitleSuffix: "",
|
pageTitleSuffix: "",
|
||||||
@ -90,32 +91,32 @@ const config: QuartzConfig = {
|
|||||||
Plugin.NotFoundPage(),
|
Plugin.NotFoundPage(),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
beforeBody: [
|
beforeBody: [
|
||||||
Component.RecentNotes({
|
Component.RecentNotes({
|
||||||
title: "最近更新",
|
title: "最近更新",
|
||||||
showTags: false,
|
showTags: false,
|
||||||
limit: 4,
|
limit: 4,
|
||||||
filter: (f) => {
|
filter: (f) => {
|
||||||
if (f.filePath?.endsWith("index.md")) {
|
if (f.filePath?.endsWith("index.md")) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
sort: (f1, f2) => {
|
sort: (f1, f2) => {
|
||||||
if (f1.dates && f2.dates) {
|
if (f1.dates && f2.dates) {
|
||||||
if (Math.abs(f2.dates.modified.getDay() - f1.dates.modified.getDay())<=3) {
|
if (Math.abs(f2.dates.modified.getDay() - f1.dates.modified.getDay())<=3) {
|
||||||
return f2.dates.created.getTime() - f1.dates.created.getTime()
|
return f2.dates.created.getTime() - f1.dates.created.getTime()
|
||||||
}
|
}
|
||||||
return f2.dates.modified.getTime() - f1.dates.modified.getTime()
|
return f2.dates.modified.getTime() - f1.dates.modified.getTime()
|
||||||
} else if (f1.dates && !f2.dates) {
|
} else if (f1.dates && !f2.dates) {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user