Skip to content

Preview future dated content with hugo server - #207

Closed
alamb wants to merge 1 commit into
apache:productionfrom
alamb:alamb/build_future_content
Closed

alamb wants to merge 1 commit into
apache:productionfrom
alamb:alamb/build_future_content

Conversation

@alamb

@alamb alamb commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Which issue does this PR close?

N/A

Rationale for this change

When a blog post is written ahead of time with a future date in its front matter, Hugo leaves it out of the build entirely, so there is no way to preview it locally before its publication date.

What changes are included in this PR?

Publishes future content in dev build
Also documents the behavior in the README.

Are these changes tested?

Manually: with a temporary post dated in the future added to
content/en/blog/features/, hugo --environment development renders it and
hugo (production) does not.

Add a `development` environment config that sets `buildFuture = true`, so
content whose front matter `date` is in the future is rendered when previewing
the site locally with `hugo server`.

This makes it possible to review a blog post that is scheduled for a future
publication date before that date arrives. The production build
(`hugo --minify`, run by the deploy workflow) is unaffected, so such a post is
still left out of the published site until its date arrives.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@alamb alamb closed this Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant