Skip to content

Commit

Permalink
fix: dates
Browse files Browse the repository at this point in the history
  • Loading branch information
vintrocode committed Dec 14, 2023
1 parent 5583cf1 commit 8a5c8c9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions content/blog/Open-Sourcing Tutor-GPT.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Open-Sourcing Tutor-GPT"
date: "Jun 2, 2023"
---

![[assets/human_machine_learning.jpeg]]
Expand Down
1 change: 1 addition & 0 deletions content/blog/Theory-of-Mind Is All You Need.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Theory-of-Mind Is All You Need"
date: "Jun 12, 2023"
---

## TL;DR
Expand Down
13 changes: 8 additions & 5 deletions quartz/components/ContentMeta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
import readingTime from "reading-time"

export default (() => {
function ContentMetadata({ cfg, fileData, displayClass }: QuartzComponentProps) {
function ContentMetadata({ cfg, fileData }: QuartzComponentProps) {
const text = fileData.text
if (text) {
const segments: string[] = []
const { text: timeTaken, words: _words } = readingTime(text)

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)
return <p class={`content-meta ${displayClass ?? ""}`}>{segments.join(", ")}</p>
// segments.push(timeTaken)
return <div className="content-meta"><br />{segments.join(", ")}<br />{timeTaken}</div>
} else {
return null
}
Expand All @@ -27,4 +30,4 @@ export default (() => {
}
`
return ContentMetadata
}) satisfies QuartzComponentConstructor
}) satisfies QuartzComponentConstructor

0 comments on commit 8a5c8c9

Please sign in to comment.