mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-24 23:15:46 -05:00
Add modified date support
This commit is contained in:
parent
453bb336a8
commit
b40f8165d0
@ -18,6 +18,7 @@ const config: QuartzConfig = {
|
||||
baseUrl: "ash-wiki.bluewitch.app",
|
||||
ignorePatterns: ["private", "templates", ".obsidian"],
|
||||
defaultDateType: "created",
|
||||
displayDateType:["created","modified"],
|
||||
theme: {
|
||||
cdnCaching: true,
|
||||
typography: {
|
||||
|
||||
@ -35,6 +35,8 @@ export interface GlobalConfiguration {
|
||||
/** Base URL to use for CNAME files, sitemaps, and RSS feeds that require an absolute URL.
|
||||
* Quartz will avoid using this as much as possible and use relative URLs most of the time
|
||||
*/
|
||||
/**Display Data Type options! */
|
||||
displayDateType: string[]
|
||||
baseUrl?: string
|
||||
theme: Theme
|
||||
/**
|
||||
|
||||
@ -26,7 +26,11 @@ export default ((opts?: Partial<ContentMetaOptions>) => {
|
||||
const segments: string[] = []
|
||||
|
||||
if (fileData.dates) {
|
||||
segments.push(formatDate(getDate(cfg, fileData)!, cfg.locale))
|
||||
cfg.displayDateType.forEach((dateType) => {
|
||||
let dateTypeLabel = (dateType == "created") ? "Created:" : "Modified:";
|
||||
segments.push(`${dateTypeLabel} ${formatDate(fileData.dates?.[dateType as keyof typeof fileData.dates]!, cfg.locale)}`)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Display reading time if enabled
|
||||
|
||||
Loading…
Reference in New Issue
Block a user