WeSearch

How I build an unpublish and archive workflow in Sanity

·5 min read · 0 reactions · 0 comments · 1 view
How I build an unpublish and archive workflow in Sanity

Step-by-step: custom Sanity document actions to unpublish, archive, and restore content without deleting, plus Next.js front-end handling for archived docs.

Original article
DEV.to (Top)
Read full at DEV.to (Top) →
Opening excerpt (first ~120 words) tap to expand

try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 2638501) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Nayan Kyada Posted on Jun 30 • Originally published at nayankyada.com How I build an unpublish and archive workflow in Sanity #sanitycms #groq #sanitystudio #nextjs The default Sanity unpublish document action does one thing: it unpublishes and leaves a draft sitting in the Studio. That's fine for a quick takedown, but it doesn't tell you why the document is off the site, and it gives editors no way to distinguish 'needs rework' from 'permanently retired'.

Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from DEV.to (Top)