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: Guide "WordPress Playground for Theme Developers" #1663

Closed
juanmaguitar opened this issue Jul 31, 2024 · 6 comments
Closed

Docs: Guide "WordPress Playground for Theme Developers" #1663

juanmaguitar opened this issue Jul 31, 2024 · 6 comments
Labels
[Type] Documentation Improvements or additions to documentation

Comments

@juanmaguitar
Copy link
Collaborator

juanmaguitar commented Jul 31, 2024

As part of #1602 there are plans to create a guides section where specific guides to tackle specific needs can be added to the docs.

Screenshot 2024-07-31 at 15 52 32

To inaugurate this "Guides" section, I think a "WordPress Playground for Theme Developers" guide could be a good candidate. These are some of the ideas I think could be included as guidance for theme developers to leverage WordPress Playground for their work.

Playground for Theme Developers

see blueprint.json
{
	"$schema": "https://playground.wordpress.net/blueprint-schema.json",
	"landingPage": "/wp-admin/post.php",
	"preferredVersions": {
		"php": "8.0",
		"wp": "beta"
	},
	"features": {
        "networking": true
    },
	"steps": [
		{
			"step": "installTheme",
			"themeZipFile": {
				"resource": "url",
				"url": "https://github-proxy.com/proxy/?repo=wordpress-juanmaguitar/tt4-dh-alternatives-custom-blocks&branch=main"
			},
			"options": {
				"activate": true
			}
		},
		{
			"step": "login",
			"username": "admin",
			"password": "password"
		}
	]
}
see blueprint.json
{
	"$schema": "https://playground.wordpress.net/blueprint-schema.json",
	"preferredVersions": {
		"php": "8.3",
		"wp": "latest"
	},
	"features": {
		"networking": true
	},
	"steps": [
		{
			"step": "login"
		},
		{
			"step": "installTheme",
			"themeZipFile": {
				"resource": "url",
				"url": "https://raw.githubusercontent.com/wptrainingteam/tt4-book-reviews/master/_playground/tt4-book-reviews.zip"
			},
			"options": {
				"activate": true
			}
		},
		{
			"step": "runPHP",
			"code": "<?php require '/wordpress/wp-load.php'; $wpdb->query('delete from wp_posts');"
		},
		{
			"step": "importWxr",
			"file": {
				"resource": "url",
				"url": "https://raw.githubusercontent.com/wptrainingteam/tt4-book-reviews/master/_playground/site-content.xml"
			}
		}
	]
}

Which key ideas should be reflected in this guide for Theme Developers?
cc: @richtabor @ndiego @justintadlock @bph @mikachan

@juanmaguitar juanmaguitar added the [Type] Documentation Improvements or additions to documentation label Jul 31, 2024
@richtabor
Copy link
Member

Which key ideas should be reflected in this guide for Theme Developers?

When thinking about blueprints for themes, we should consider all the small parts that pull a theme demo together in full. Like setting show_on_front, assigning the page_on_front and page_for_posts, site logo (if it's possible), importWxr best practices, etc. Also installing related plugins (like blocks that a theme may leverage).

I did this for my blog's theme: https://github.com/richtabor/kanso/blob/main/blueprint.json (but not logo yet, it's not super clear the easiest way to do that).

Basically setting up a demo site only with playground.

@bph
Copy link
Collaborator

bph commented Aug 1, 2024

There is also a dev blog article in the works. The issue has a few discussion points. How to build a theme demo with WP Playground blueprints. It's on my to-do list for September.

@bph
Copy link
Collaborator

bph commented Aug 1, 2024

The Recap Hallway Hangout: Theme Building with Playground, Create-block-theme plugin, and GitHub has a video and some instructions on how to use Playground, CBT and GItHub for version control.

@adamziel
Copy link
Collaborator

adamziel commented Aug 1, 2024

Surfacing:

Major points:

  • You can preview a theme from the theme directory, GitHub repo, GitHub PR, or a local directory. If you set up the automated "Preview in Playground" comments you'll get a nice review workflow.
  • You can make changes to that theme (via the create-block-theme plugin) and either export a zip or directly create / update a PR on GitHub.

CCing @beafialho @mikachan @vcanales

@adamziel
Copy link
Collaborator

adamziel commented Aug 1, 2024

Here's a Playground-based theme development workflow:

Theme.editing.mp4

bgrgicak pushed a commit that referenced this issue Sep 12, 2024
As both #1664
and #1663
require info about how to provide content for a demo in Playground I
think it's best to create a separate guide with this topic that can be
referenced from these guides

This PR belong to a set of three guides that are meant to be published
together
- WordPress Playground for Theme Developers
#1732
- WordPress Playground for Plugin Developers
#1750
- Providing content for your demo
#1747
bgrgicak pushed a commit that referenced this issue Sep 12, 2024
This PR addresses
#1663

This PR belong to a set of three guides that are meant to be published
together
- WordPress Playground for Theme Developers
#1732
- WordPress Playground for Plugin Developers
#1750
- Providing content for your demo
#1747
@juanmaguitar
Copy link
Collaborator Author

Closing this issue as per #1747 and #1732

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants