sanity
sanity copied to clipboard
Provide _firstPublishedAt
Currently there are two timestamps on a post I have created with sanity, _createdAt and _updatedAt. Both of these are helpful, but none of them contain information when the post was first published. _createdAt can be long before the post was published, if its been lying as a draft for a long time, and _updatedAt can be long after the post was first published if it has been updated many times.
I would like every post (or other item) to have a field called something like _firstPublishedAt, so that I can show my visitors when this post was actually first made available to them.
Thanks for the input @Jakst! We can totally see the need for this and will discuss this internally.
@Jakst You could also solve this by creating a webhook and patching the documents returned in the created array. Though I see how a such solution depends on your set up.
Hmm okay, thanks @alevroub . I'll look into that meanwhile.
From what I can tell the _createdAt-field behaves like a _firstPublishedAt-field (see https://github.com/sanity-io/sanity/issues/3232). Do you have the same experience?
Any update on this? Maybe v3 can fix this if it requires breaking changes?
@bline This is now easier to accomplish using Document actions. Have you looked into it?
Thanks for reporting all! This issue ties into how the drafts model works, and is something we're planning to look into. We'll close this issue since this is already tracked internally.