Add modified date support

This commit is contained in:
wych 2024-05-01 14:02:20 -05:00
parent 453bb336a8
commit b40f8165d0
3 changed files with 8 additions and 1 deletions

View File

@ -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: {

View File

@ -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
/**

View File

@ -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