Skip to content

Commit

Permalink
wp-now: Clean up the README a bit (WordPress#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Jun 29, 2023
1 parent 02f25d4 commit bfeec20
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/wp-now/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ Of these, `wp-now php` currently supports the `--path=<path>` and `--php=<versio

## Using Blueprints

Blueprints are JSON files with a list of steps to execute after starting wp-now. They can be used to automate the setup of a WordPress site, including defining wp-config constants, installing plugins, themes, and content.
Blueprints are JSON files with a list of steps to execute after starting wp-now. They can be used to automate the setup of a WordPress site, including defining wp-config constants, installing plugins, themes, and content. [Learn more about Blueprints.](https://wordpress.github.io/wordpress-playground/blueprints-api/index)

## Defining a custom URL
### Defining Custom URLs

Here is an example of a blueprint that defines custom URL constant. `wp-now` will automatically detect the blueprint and execute it after starting the server. In consequence, the site will be available at `http://myurl.wpnow`. Make sure myurl.wpnow is added to your hosts file.
Here is an example of a Blueprint that defines custom URL constant. `wp-now` will automatically detect the blueprint and execute it after starting the server. In consequence, the site will be available at `http://myurl.wpnow`. Make sure myurl.wpnow is added to your hosts file.

To execute this blueprint, create a file named `blueprint-example.json` and run `wp-now start --blueprint=path/to/blueprint-example.json`. Note that the `virtualize` is set to `true` to avoid modifying the `wp-config.php` file that is shared between all the projects.
To execute this Blueprint, create a file named `blueprint-example.json` and run `wp-now start --blueprint=path/to/blueprint-example.json`. Note that the `virtualize` is set to `true` to avoid modifying the `wp-config.php` file that is shared between all the projects.

```json
{
Expand Down Expand Up @@ -113,7 +113,7 @@ The Blueprint to listen on port `80` will look like this:
}
```

## Debugging
### Defining Debugging Constants

In the similar way we can define `WP_DEBUG` constants and read the debug logs.

Expand All @@ -135,7 +135,9 @@ Run `wp-now start --blueprint=path/to/blueprint-example.json` where `blueprint-e
```

This will enable the debug logs and will create a `debug.log` file in the `~/wp-now/wp-content/${project}/debug.log` directory.

If you prefer to set a custom path for the debug log file, you can set `WP_DEBUG_LOG` to be a directory. Remember that the `php-wasm` server runs udner a VFS (virtual file system) where the default documentRoot is always `/var/www/html`.

For example, if you run `wp-now start --blueprint=path/to/blueprint-example.json` from a theme named `atlas` you could use this directory: `/var/www/html/wp-content/themes/atlas/example.log` and you will find the `example.log` file in your project directory.

```json
Expand Down

0 comments on commit bfeec20

Please sign in to comment.