mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-21 20:04:06 -06:00
fix: dates
This commit is contained in:
parent
5583cf19ca
commit
8a5c8c9d81
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Open-Sourcing Tutor-GPT"
|
title: "Open-Sourcing Tutor-GPT"
|
||||||
|
date: "Jun 2, 2023"
|
||||||
---
|
---
|
||||||
|
|
||||||
![[assets/human_machine_learning.jpeg]]
|
![[assets/human_machine_learning.jpeg]]
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Theory-of-Mind Is All You Need"
|
title: "Theory-of-Mind Is All You Need"
|
||||||
|
date: "Jun 12, 2023"
|
||||||
---
|
---
|
||||||
|
|
||||||
## TL;DR
|
## TL;DR
|
||||||
|
|||||||
@ -3,18 +3,21 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
|||||||
import readingTime from "reading-time"
|
import readingTime from "reading-time"
|
||||||
|
|
||||||
export default (() => {
|
export default (() => {
|
||||||
function ContentMetadata({ cfg, fileData, displayClass }: QuartzComponentProps) {
|
function ContentMetadata({ cfg, fileData }: QuartzComponentProps) {
|
||||||
const text = fileData.text
|
const text = fileData.text
|
||||||
if (text) {
|
if (text) {
|
||||||
const segments: string[] = []
|
const segments: string[] = []
|
||||||
const { text: timeTaken, words: _words } = readingTime(text)
|
const { text: timeTaken, words: _words } = readingTime(text)
|
||||||
|
|
||||||
if (fileData.dates) {
|
if (fileData.dates) {
|
||||||
segments.push(formatDate(getDate(cfg, fileData)!))
|
const createdDate = formatDate(getDate(cfg, fileData)!)
|
||||||
|
const modifiedDate = formatDate(fileData.dates.modified) // Assuming fileData contains a 'dates' object with 'modified' property
|
||||||
|
|
||||||
|
segments.push(`Created: ${createdDate}, Modified: ${modifiedDate}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
segments.push(timeTaken)
|
// segments.push(timeTaken)
|
||||||
return <p class={`content-meta ${displayClass ?? ""}`}>{segments.join(", ")}</p>
|
return <div className="content-meta"><br />{segments.join(", ")}<br />{timeTaken}</div>
|
||||||
} else {
|
} else {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@ -27,4 +30,4 @@ export default (() => {
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
return ContentMetadata
|
return ContentMetadata
|
||||||
}) satisfies QuartzComponentConstructor
|
}) satisfies QuartzComponentConstructor
|
||||||
Loading…
Reference in New Issue
Block a user