Skip to main content
When an event is published to Ghost, Outpost injects structured data into the post’s code injection footer. Your Ghost theme can read this data to render event details, registration CTAs, countdowns, and more.

Code Injection JSON

Outpost adds a <script> tag with JSON data to every event post:

Reading Data in Your Theme

JavaScript

Handlebars (with inline script)

Since Handlebars templates run server-side and the JSON is in code injection (rendered client-side), you’ll typically use JavaScript to read the data and update the DOM:

Standard Field Reference

Access Levels

The access field indicates who can register for the event:

Example: Conditional Rendering by Access

Event States

The event_state field reflects the event’s current lifecycle position:

Example: State-Based UI

Custom Fields

Custom fields defined in the manifest are nested under the custom_fields object. The keys match what you defined in your outpost-manifest.yaml:

Custom Field Value Types

Event Defaults Partial

Outpost also injects messaging defaults and portal URLs via the outpost-event-defaults.hbs partial during theme processing:
This provides:
  • Messaging: Default CTA text and button labels for each audience state
  • URLs: Ghost portal links for sign-in, sign-up, and account/upgrade

Reading Event Defaults

Complete Theme Example

Here’s a complete example of rendering event data in a custom Ghost template:

Ghost Post Properties

In addition to code injection, Outpost sets these Ghost post properties: Tags are written once, when Outpost first creates the Ghost post for an event. Changing any of the three sources afterwards does not retag events that already have posts. These are accessible via standard Ghost Handlebars helpers:

Event Ordering and Publish Dates

Ghost orders posts by publish date, so Outpost automatically adjusts event posts’ published_at values to keep publish-date order in sync with event-date order. The reorder runs every time an event is published or its date changes. Two consequences for theme authors:
  1. Events listings need no special sorting. A collection or channel of event posts in Ghost’s default published_at desc order shows events in event-date order: the latest-dated event first, with past events sinking to the bottom. Don’t try to sort by event date yourself; the data isn’t available in listing context anyway.
  2. Don’t display publish dates on event posts or event cards. Because Outpost manages these timestamps, {{date published_at}} on an event can show a date unrelated to when it was actually published. Hide the publication date in your event post template and on event cards, and show the event date from the code injection JSON instead:

API Endpoint for Registration

The event widget uses Outpost’s plugin API for registration. If you’re building a custom registration UI:
The apiKey is your site’s Outpost GUID (available in the outpost-api-key.hbs partial). The memberUid is the logged-in member’s Ghost UUID.