Preview production drafts locally
Draft posts stay out of production
We now set ELEVENTY_ENV for each npm script that ships with Subspace Builder. When you run npm run build, Eleventy filters out any Markdown files marked with draft: true. That keeps unfinished stories from leaking onto the live site.
Need to double-check how the site behaves in production? Use the new npm run prod command. It spins up Eleventy’s dev server with the production environment, so you can review the published experience locally while still enjoying hot reloads.
What changed
- Eleventy computes
eleventyExcludeFromCollectionsusing the currentELEVENTY_ENV, skipping draft templates whenever the value isproduction. package.jsonscripts now cover the full workflow:npm run devfor drafting,npm run prodfor production previews, andnpm run buildfor deployable output.- The README calls out the new scripts so the environment-driven behaviour is easy to adopt.
This groundwork sets us up for smoother release testing—and it keeps your editorial pipeline tidy.