fix: dates

This commit is contained in:
vintro 2023-12-14 17:55:40 -05:00
parent 5583cf19ca
commit 8a5c8c9d81
No known key found for this signature in database
3 changed files with 10 additions and 5 deletions

View File

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

View File

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

View File

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