Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/Guides: WordPress Playground for theme developers #1732

Merged
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
be65fc9
add tips to using URL fragments to load blueprints
juanmaguitar Sep 6, 2024
9aef47a
guide for theme developers - initial commit
juanmaguitar Sep 6, 2024
af20b4a
Merge branch 'trunk' into docs/guide-for-theme-developers
juanmaguitar Sep 6, 2024
cd40e73
finished setting up a demo and Local Theme Development with Playground
juanmaguitar Sep 9, 2024
a6599e3
Merge branch 'docs/guide-for-theme-developers' of github.com:wordpres…
juanmaguitar Sep 9, 2024
eb220e1
Merge branch 'trunk' into docs/guide-for-theme-developers
juanmaguitar Sep 9, 2024
74e55fa
Design your theme using the WordPress UI and save your changes as Pul…
juanmaguitar Sep 9, 2024
8dc1de2
grammar check
juanmaguitar Sep 9, 2024
c1c2714
Merge branch 'trunk' into docs/guide-for-theme-developers
juanmaguitar Sep 9, 2024
b701218
Justin's feedback addressed
juanmaguitar Sep 10, 2024
97c9089
Merge branch 'docs/guide-for-theme-developers' of github.com:wordpres…
juanmaguitar Sep 10, 2024
4a4041f
Merge branch 'trunk' into docs/guide-for-theme-developers
juanmaguitar Sep 10, 2024
7fb8d82
Reference to example for block theme developers
juanmaguitar Sep 10, 2024
5137274
Merge branch 'docs/guide-for-theme-developers' of github.com:wordpres…
juanmaguitar Sep 10, 2024
db85ad7
Importing content for your demo and live demo links
juanmaguitar Sep 10, 2024
299d662
Fine tuned content Guide
juanmaguitar Sep 10, 2024
190c209
wp-cli
juanmaguitar Sep 11, 2024
d4dfcb0
more wp-cli use cases
juanmaguitar Sep 11, 2024
4b06bbb
Extracted providing content for your demo
juanmaguitar Sep 11, 2024
305b75c
Added reference to "Providing content for your demo" guide
juanmaguitar Sep 11, 2024
b62430d
Shorter sentence
juanmaguitar Sep 11, 2024
71aee09
Merge branch 'trunk' into docs/guide-for-theme-developers
juanmaguitar Sep 11, 2024
53255a4
Merge branch 'trunk' into docs/guide-for-theme-developers
juanmaguitar Sep 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion packages/docs/site/docs/blueprints/02-using-blueprints.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,24 @@ For example, to create a Playground with specific versions of WordPress and PHP
```

And then you would go to
`https://playground.wordpress.net/#{"preferredVersions": {"php":"7.4", "wp":"6.5"}}`.
`https://playground.wordpress.net/#{"preferredVersions":{"php":"7.4","wp":"6.5"}}`.

:::tip
In Javascript, you can get a compact version of any blueprint JSON with [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) and [`JSON.parse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse)
Example:

```js
const blueprintJson = `{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"preferredVersions": {
"php": "7.4",
"wp": "6.5"
}
}`;
const minifiedBlueprintJson = JSON.stringify(JSON.parse(blueprintJson)); // {"preferredVersions":{"php":"7.4","wp":"6.5"}}
```

:::

You won't have to paste links to follow along. We'll use code examples with a "Try it out" button that will automatically run the examples for you:

Expand All @@ -45,6 +62,24 @@ Some tools, including GitHub, might not format the Blueprint correctly when past

To run it, go to https://playground.wordpress.net/#eyIkc2NoZW1hIjogImh0dHBzOi8vcGxheWdyb3VuZC53b3JkcHJlc3MubmV0L2JsdWVwcmludC1zY2hlbWEuanNvbiIsInByZWZlcnJlZFZlcnNpb25zIjogeyJwaHAiOiAiNy40Iiwid3AiOiAiNi41In19

:::tip
In JavaScript, You can get any blueprint JSON in [Base64 format](https://developer.mozilla.org/en-US/docs/Glossary/Base64#javascript_support) with global function `btoa()`.

Example:

```js
const blueprintJson = `{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"preferredVersions": {
"php": "7.4",
"wp": "6.5"
}
}`;
const minifiedBlueprintJson = btoa(blueprintJson); // eyIkc2NoZW1hIjogImh0dHBzOi8vcGxheWdyb3VuZC53b3JkcHJlc3MubmV0L2JsdWVwcmludC1zY2hlbWEuanNvbiIsInByZWZlcnJlZFZlcnNpb25zIjogeyJwaHAiOiAiNy40Iiwid3AiOiAiNi41In19
```

:::

### Load Blueprint from a URL

When your Blueprint gets too wieldy, you can load it via the `?blueprint-url` query parameter in the URL, like this:
Expand Down
Loading
Loading