Update WordPress Playground integration to use HTML files
This commit is contained in:
@@ -150,7 +150,21 @@ EOF
|
|||||||
|
|
||||||
# Start WordPress Playground
|
# Start WordPress Playground
|
||||||
echo "Starting WordPress Playground..."
|
echo "Starting WordPress Playground..."
|
||||||
npx @wp-playground/client start --blueprint playground/blueprint.json --port 8888 &
|
if command_exists python3; then
|
||||||
|
python3 -m http.server 8888 --directory playground &
|
||||||
|
echo "Opening WordPress Playground in your browser..."
|
||||||
|
if command_exists open; then
|
||||||
|
open http://localhost:8888/index.html
|
||||||
|
elif command_exists xdg-open; then
|
||||||
|
xdg-open http://localhost:8888/index.html
|
||||||
|
elif command_exists start; then
|
||||||
|
start http://localhost:8888/index.html
|
||||||
|
else
|
||||||
|
echo "Please open http://localhost:8888/index.html in your browser"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Python3 is not installed. Please open playground/index.html in your browser."
|
||||||
|
fi
|
||||||
|
|
||||||
# Wait for WordPress Playground to be ready
|
# Wait for WordPress Playground to be ready
|
||||||
echo "Waiting for WordPress Playground to be ready..."
|
echo "Waiting for WordPress Playground to be ready..."
|
||||||
@@ -243,7 +257,21 @@ EOF
|
|||||||
|
|
||||||
# Start WordPress Playground
|
# Start WordPress Playground
|
||||||
echo "Starting WordPress Playground..."
|
echo "Starting WordPress Playground..."
|
||||||
npx @wp-playground/client start --blueprint playground/multisite-blueprint.json --port 8888 &
|
if command_exists python3; then
|
||||||
|
python3 -m http.server 8888 --directory playground &
|
||||||
|
echo "Opening WordPress Playground in your browser..."
|
||||||
|
if command_exists open; then
|
||||||
|
open http://localhost:8888/multisite.html
|
||||||
|
elif command_exists xdg-open; then
|
||||||
|
xdg-open http://localhost:8888/multisite.html
|
||||||
|
elif command_exists start; then
|
||||||
|
start http://localhost:8888/multisite.html
|
||||||
|
else
|
||||||
|
echo "Please open http://localhost:8888/multisite.html in your browser"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Python3 is not installed. Please open playground/multisite.html in your browser."
|
||||||
|
fi
|
||||||
|
|
||||||
# Wait for WordPress Playground to be ready
|
# Wait for WordPress Playground to be ready
|
||||||
echo "Waiting for WordPress Playground to be ready..."
|
echo "Waiting for WordPress Playground to be ready..."
|
||||||
|
|||||||
25
playground/index.html
Normal file
25
playground/index.html
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>WordPress Playground</title>
|
||||||
|
<style>
|
||||||
|
body, html {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
iframe {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<iframe src="https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json"></iframe>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
25
playground/multisite.html
Normal file
25
playground/multisite.html
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>WordPress Playground - Multisite</title>
|
||||||
|
<style>
|
||||||
|
body, html {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
iframe {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<iframe src="https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json"></iframe>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user