Skip to content

Commit 13bed5f

Browse files
committed
chore: update astro previews readme
1 parent d35f81d commit 13bed5f

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

examples/astro/previews/.wp-env.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"phpVersion": "8.3",
33
"plugins": [
44
"https://github.com/wp-graphql/wp-graphql/releases/latest/download/wp-graphql.zip",
5-
"https://github.com/wpengine/hwptoolkit/releases/download/%40wpengine%2Fhwp-previews-wordpress-plugin-0.0.8/hwp-previews.zip",
5+
"https://github.com/wpengine/hwptoolkit/releases/download/%40wpengine%2Fhwp-previews-wordpress-plugin-0.0.12/hwp-previews.zip",
66
"https://github.com/wp-graphql/wpgraphql-ide/releases/latest/download/wpgraphql-ide.zip"
77
],
88
"themes": ["https://downloads.wordpress.org/theme/nude.1.2.zip"],

examples/astro/previews/README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1-
# Astro Template HIerarchy and Data fetching w/URQL Example
1+
# Astro Headless WordPress Previews Example 🚀
22

3-
In this example we show how to implement the WP Template Hierarchy in Astro for use with a Headless WordPress backend using WPGraphQL. We use URQL for all routing and fetching page content.
3+
In this example, we show how to implement **Headless WordPress Previews in Astro** using the **`hwp-previews`** plugin and WPGraphQL. This setup allows content creators to preview draft posts directly in the Astro frontend from the WordPress admin panel. We use **URQL** for all routing and fetching page content.
44

55
## Getting Started
66

77
> [!IMPORTANT]
8-
> Docker Desktop needs to be installed to run WordPress locally.
8+
> **Docker Desktop** needs to be installed to run WordPress locally.
99
1010
1. Run `npm run example:setup` to install dependencies and configure the local WP server.
1111
2. Run `npm run example:start` to start the WP server and Astro development server.
1212

1313
> [!NOTE]
1414
> When you kill the long running process this will not shutdown the local WP instance, only Astro. You must run `npm run example:stop` to kill the local WP server.
1515
16-
## Trouble Shooting
16+
## How to Test Previews
1717

18-
To reset the WP server and re-run setup you can run `npm run example:prune` and confirm "Yes" at any prompts.
18+
1. After running `npm run example:start`, navigate to the WordPress Admin at **http://localhost:8888/wp-admin**.
19+
2. Log in using the credentials specified in the example's `wp-env.json`.
20+
3. Edit any draft post.
21+
4. In the editor, click the **"Preview"** button. The post should open in the Astro frontend, displaying the draft content.
22+
23+
## Trouble Shooting 🛠️
24+
25+
To reset the WP server and re-run setup you can run `npm run example:prune` and confirm "Yes" at any prompts.

0 commit comments

Comments
 (0)