jackyzha0 / quartz

🌱 a fast, batteries-included static-site generator that transforms Markdown content into fully functional websites
https://quartz.jzhao.xyz
MIT License
7.13k stars 2.51k forks source link

Include both published and updated dates #1015

Open bbohling opened 7 months ago

bbohling commented 7 months ago

Is your feature request related to a problem? Please describe.

It would be great (at least an option) to include both the published and updated dates on a post. The data is already available in ContentMeta.tsx, but just needs to be modified to push both into the segments.

Describe the solution you'd like

See above.

Describe alternatives you've considered

Edit myself, but that makes keeping in sync with upstream more of a challenge

aarnphm commented 7 months ago

Feel free to modify the ContentMeta.tsx yourself. I think the default should be good enough and it is pretty easy to add more to it :)

But I'm not opposed to adding this as well.

Edit myself, but that makes keeping in sync with upstream more of a challenge

I think this aligns with Quartz's philosophy :)

bbohling commented 7 months ago

Well, it's not the cleanest way to implement, but it does work. However, because it does re-render all the pages (because it adds the modified date) it does completely wreck any real history when each page in my vault was truly last modified.

quartz-date-mod

So maybe the better approach is to leave Quartz as-is and just use a callout at the top of a page I update:

> [!info]
> updated YYYY-MM-DD: blah blah blah

¯_(ツ)_/¯

saberzero1 commented 7 months ago

@bbohling one option could be to use the YAML Timestamp options from the Obsidian Linter plugin.

image

The above setup results in two values inside the file frontmatter: date_created and date_modified. The date_created uses the Obsidian metadata of file creation and the date_modified uses the last time Obsidian Linter ran to make changes. (Which usually is when you save the file with changes)

image

Maybe this could be useful to create the desired effect?

qv1et commented 1 month ago

I would like this feature as well. I feel like it is pretty essential to the whole digital garden concept where pages are usually not published in their final form, but updated over time. So both the created and modified dates are relevant to display.