Skip to content

About

Static Astro demo backed by WordPress and built for Spacefast

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Astro + WordPress on Spacefast

A fully static Astro site that reads public content from WordPress at build time with @spacefast/wordpress, then publishes the generated dist/ directory on Spacefast.

The demo defaults to https://staticspacefastdemo.mystagingwebsite.com for local development. Set WORDPRESS_URL to use another WordPress site. On Spacefast, configure the WordPress site in Space settings → Data sources; the SDK automatically uses the injected SPACEFAST_DATA_SOURCES value.

Run locally

bun install
bun run dev

Production output is static HTML:

bun run build

Connect the rebuild loop

  1. Create a Space from this repository. Build command: bun run build; output directory: dist.
  2. Add the WordPress origin as the default public WordPress data source in the Spacefast dashboard.
  3. In WordPress, install the Spacefast plugin, choose Headless CMS, continue to Spacefast, authorize the Team, and select this Space.
  4. Publish or edit public content. The plugin waits until changes have been quiet for 60 seconds, then starts one production build. Build now in WordPress or the Spacefast dashboard remains immediate.

Drafts, autosaves, revisions, and wp-admin page navigation do not trigger builds. The repository contains no WordPress or Spacefast credentials.

Generated routes

  • / — WordPress-backed home and latest posts
  • /blog/ and /blog/[slug]/ — all published posts
  • /category/[slug]/ — published categories
  • /[slug]/ — published WordPress pages
  • /case-studies/[slug]/ — the custom case_study REST collection
  • /resources/[slug]/ — the custom resource REST collection
  • /launch-notes/[slug]/ — the custom launch_note REST collection

About

Static Astro demo backed by WordPress and built for Spacefast

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages