Publishing & Scheduling

Control content visibility with publishing controls: published, draft, and scheduled states.

Publishing Status

Content Mode provides three states for controlling content visibility:

Published

Content with published: true (or when the field is omitted, as it defaults to true):

  • Is included in build output
  • Appears in collection loops
  • Is visible on the site
  • Is the default state
---
title: "Published Post"
published: true
date: "2024-01-15T10:00:00Z"
---

Draft

Content with published: false and no scheduledDate:

  • Is excluded from build output
  • Is not included in collection loops
  • File remains in source directory
  • Use for work-in-progress content
---
title: "Draft Post"
published: false
---

Scheduled

Content with published: false and a scheduledDate:

  • Is excluded if scheduled date is in the future
  • Auto-publishes when scheduled date passes (on next build)
  • Once date passes, content is included as if published
---
title: "Future Post"
published: false
scheduledDate: "2024-12-25T09:00:00Z"
---

Managing Publishing in UI

The Content tab in Hammer provides UI controls for managing publishing status:

Status Badge

Click the status badge on any content entry to change its status:

  • Published: Green badge with checkmark - Sets published: true, removes scheduledDate
  • Draft: Orange badge with pause icon - Sets published: false, removes scheduledDate
  • Scheduled: Blue badge with calendar icon - Opens date picker, sets published: false and scheduledDate

Scheduling

To schedule content:

  1. Click the status badge
  2. Select "Scheduled"
  3. Choose a date and time using the date picker
  4. Changes are immediately saved to the content file's front matter
Tip: All publishing changes made in the UI are immediately saved to your content files' front matter, so you can also edit them manually if preferred.

Publishing Behavior

Understanding how publishing works during builds:

During Build

When Hammer builds your site:

  • Only published content (or scheduled content with passed dates) is processed
  • Draft content is completely excluded from the build
  • Scheduled content with future dates is excluded
  • Scheduled content with past dates is included as published

Collection Loops

When looping through collections in templates:

  • Only published content appears in loops
  • Draft content is not accessible
  • Scheduled content follows the same rules as during build

Template Context

In templates:

  • Only published content is available in collections
  • Draft content cannot be accessed
  • You can check doc.published status in templates

Auto-Publishing

Scheduled content automatically publishes when:

  • The scheduled date has passed
  • You run a build after the scheduled date
  • The content is then included as if it were published

Best Practices

Draft Workflow

  • Use drafts for work-in-progress content
  • Keep drafts in your source directory for easy editing
  • Set published: false to exclude from builds
  • Change to published when content is ready

Scheduling

  • Schedule future content for time-sensitive releases
  • Use ISO 8601 format for dates
  • Use UTC timezone (Z suffix) for consistency
  • Review scheduled content regularly to ensure dates are correct

Default Behavior

  • Omit published field for immediate publishing (defaults to true)
  • Only set published: false when you want to exclude content
  • Use scheduled dates for future publishing, not just drafts

Next Steps

Now that you understand publishing, learn about: