quartz icon indicating copy to clipboard operation
quartz copied to clipboard

`Last Updated` updates even without changes on GitHub

Open sspaeti opened this issue 3 years ago • 3 comments

Describe the bug Whenever I add new notes to my glossary, it updates the last updated Date for all notes, although I only touched a couple of notes.

See data catalog.md note that hasn't been touched got updated: image

The https://github.com/airbytehq/glossary/blob/62d7da31a19576f8eb76bf383a3b757bc0fccc16/data/config.yaml seems to be correct, no?

enableGitHubEdit: true
GitHubLink: https://github.com/airbytehq/glossary/tree/hugo/content

Anything I'm missing here? Is it maybe because I renamed the folder inside content to term instead of notes? If so, would you have a pointer where I could fix that?

Additional Info This is also very bad for SEO as the sitemap always updates with all notes changed for re-indexing.

Running it on my localhost it seems to work, only on the deployed website not. Is it a problem when the deployed branch is in a different repo? But even there, the updated date seems to be correct.

Localhost correctly working: image

sspaeti avatar Sep 14 '22 07:09 sspaeti

Maybe it's because the https://github.com/jackyzha0/quartz/blob/hugo/layouts/partials/date-fmt.html#L3 is picking local Lastmodified instead of GitHub once? But during deployment, all files get newly created or copied into a temporary place, which then takes these dates. But then that would never work.

How is it intended to work, then? Does that work for any of you? I quickly checked the showcases, but it seems only to work on your personal one @jackyzha0 and Brandon's one, the others seem to have the same issue, knowingly or not :)

Anything you did there to work around that? :)

sspaeti avatar Sep 14 '22 07:09 sspaeti

Oh hm, might have to do with https://github.com/jackyzha0/quartz/blob/169ef442b9ae1a61af516edc5c90ff0299d91a25/.github/workflows/deploy.yaml#L14 especially if you forked... will poke around some more but this is a starting point

Maybe it's because the https://github.com/jackyzha0/quartz/blob/hugo/layouts/partials/date-fmt.html#L3 is picking local Lastmodified instead of GitHub once? But during deployment, all files get newly created or copied into a temporary place, which then takes these dates. But then that would never work.

seems to be a correct hunch

jackyzha0 avatar Sep 14 '22 17:09 jackyzha0

Thank you jacky! Brandon gave me a hint on how he solved it, I will try that tomorrow:

I fixed the publishing date challenge by updating my template to use the creation_date / date_override instead. It should be in this file: https://github.com/brandonkboswell/quartz/blob/61276c8a5fdb600006296a5dd80f4446b5482ed6/layouts/_default/single.html

Also a nice addition to fix the published date with the frontmatter with this solution: https://twitter.com/brandonkboswell/status/1570130283462262787

Update: I tried adding his code and also removing fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod . Both didn't work for me on the deployed website. Any help would be much appreciated.

sspaeti avatar Sep 14 '22 19:09 sspaeti

I updated to the latest Quartz version and I guess uses: jackyzha0/[email protected] in the deployment.yaml fixed it. In any way, after the update, it works now fine!

sspaeti avatar Sep 23 '22 08:09 sspaeti