Skip to content

Commit f280154

Browse files
committed
Initial repository setup
0 parents  commit f280154

File tree

6 files changed

+236
-0
lines changed

6 files changed

+236
-0
lines changed

.github/workflows/reindex.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Reindex Blueprints after changes
2+
3+
on:
4+
push:
5+
branches:
6+
- trunk
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python 3.8
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.8
18+
- name: Run make_index.py
19+
run: python make_index.py
20+
- name: Check for uncommitted changes
21+
id: changes
22+
run: |
23+
if [ -z "$(git status --porcelain)" ]; then
24+
echo "No changes"
25+
echo 'CHANGES=0' >> $GITHUB_OUTPUT
26+
else
27+
echo "Changes detected"
28+
echo 'CHANGES=1' >> $GITHUB_OUTPUT
29+
fi
30+
- name: Push rebuilt WordPress to GitHub
31+
if: steps.changes.outputs.CHANGES == '1'
32+
run: |
33+
git config --global user.name "deployment_bot"
34+
git config --global user.email "deployment_bot@users.noreply.github.com"
35+
git remote set-url origin https://${{ secrets.GH_ACTOR }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}
36+
git add -A
37+
git commit -a -m "Reindex Blueprints"
38+
git pull --rebase
39+
if [ $? -eq 0 ]; then
40+
git push origin HEAD:trunk
41+
fi;

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# WordPress Blueprints Community Gallery
2+
3+
Welcome to the WordPress Blueprints Community Gallery!
4+
This is a space for WordPress developers to share and explore pre-configured WordPress setups, also known as Blueprints.
5+
6+
Here you'll find a collection of Blueprints for various purposes, from pre-configured WooCommerce stores to custom development environments.
7+
8+
Ready to jump in?
9+
10+
* Browse Blueprints – See the current list of available Blueprints below.
11+
* Create your first Blueprint – Get started by following the official guide on creating Blueprints.
12+
13+
## Available Blueprints
14+
15+
* Latest Gutenberg plugin – [Preview](https://playground.wordpress.net/blueprint-url?url=https://raw.githubusercontent.com/adamziel/blueprints/trunk/v1-examples/latest-gutenberg/blueprint.json) | [Source](https://github.com/adamziel/blueprints/blob/trunk/v1-examples/latest-gutenberg/blueprint.json)
16+
17+
18+
## Contributing your Blueprint
19+
20+
We encourage you to contribute your own Blueprints to this repository! To make the process smooth, follow these guidelines:
21+
22+
* Create a Pull Request: Submit a Pull Request to this repository.
23+
* Blueprint Structure: Each Blueprint should reside in a new directory within the v1-examples folder. This directory must include a blueprint.json file.
24+
* Include Static Files: Any static files your Blueprint uses (like WXR, ZIP, or JPG files) should be included within your submitted directory and referenced using the raw.githubusercontent.com domain.
25+
* Licensing: By submitting a Blueprint, you agree to license it under the GPLv2 or later license.
26+
27+
See [getting started with Blueprints](https://w.org/@TODO) for more information on how to create one.
28+
29+
## Publishing guidelines
30+
31+
To add a Blueprint to this repository, submit it as a Pull Request to this repository.
32+
33+
Your Pull Request must contain a single, new directory created in the `v1-examples` with a `blueprint.json` file in it.
34+
35+
All static files (WXR, ZIP, JPG etc.) referenced by the Blueprint must be included in the submitted directory in your Pull Request and referenced via the `raw.githubusercontent.com` domain.
36+
37+
By submitting a Blueprint, you agree to license it under GPLv2 or later license.
38+
39+
### Blueprint Metadata
40+
41+
Each Blueprint should include some basic metadata within the top-level "meta" key in the blueprint.json file. Here's what's required:
42+
43+
* Title: A clear and concise name for your Blueprint.
44+
* Author (GitHub Username): Let others know who created the Blueprint.
45+
46+
Optionally, you can also include:
47+
48+
* Description: Provide a brief explanation of what your Blueprint offers.
49+
* Categories: Specify relevant categories to help users find your Blueprint in the future Blueprints section on WordPress.org.
50+
51+
Here's an example:
52+
53+
```json
54+
{
55+
"meta": {
56+
"title": "WooCommerce Developer Environment",
57+
"description": "A local development environment for WooCommerce that includes WP-CLI.",
58+
"author": "zieladam",
59+
"categories": ["woocommerce", "developer environment"]
60+
}
61+
}
62+
```
63+
64+
## Needing Help?
65+
66+
If you have questions or need assistance, feel free to start a new issue in this repository: @TODO.
67+
68+
## Let's Build the Blueprint Community Together!
69+
70+
This is a minimal version 1 (v1) to get the community space up and running quickly. We plan to build upon this foundation based on your feedback. So, explore, create, and share your Blueprints!

README.md.template

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# WordPress Blueprints Community Gallery
2+
3+
Welcome to the WordPress Blueprints Community Gallery!
4+
This is a space for WordPress developers to share and explore pre-configured WordPress setups, also known as Blueprints.
5+
6+
Here you'll find a collection of Blueprints for various purposes, from pre-configured WooCommerce stores to custom development environments.
7+
8+
Ready to jump in?
9+
10+
* Browse Blueprints – See the current list of available Blueprints below.
11+
* Create your first Blueprint – Get started by following the official guide on creating Blueprints.
12+
13+
## Available Blueprints
14+
15+
{BLUEPRINTS_LIST}
16+
17+
## Contributing your Blueprint
18+
19+
We encourage you to contribute your own Blueprints to this repository! To make the process smooth, follow these guidelines:
20+
21+
* Create a Pull Request: Submit a Pull Request to this repository.
22+
* Blueprint Structure: Each Blueprint should reside in a new directory within the v1-examples folder. This directory must include a blueprint.json file.
23+
* Include Static Files: Any static files your Blueprint uses (like WXR, ZIP, or JPG files) should be included within your submitted directory and referenced using the raw.githubusercontent.com domain.
24+
* Licensing: By submitting a Blueprint, you agree to license it under the GPLv2 or later license.
25+
26+
See [getting started with Blueprints](https://w.org/@TODO) for more information on how to create one.
27+
28+
## Publishing guidelines
29+
30+
To add a Blueprint to this repository, submit it as a Pull Request to this repository.
31+
32+
Your Pull Request must contain a single, new directory created in the `v1-examples` with a `blueprint.json` file in it.
33+
34+
All static files (WXR, ZIP, JPG etc.) referenced by the Blueprint must be included in the submitted directory in your Pull Request and referenced via the `raw.githubusercontent.com` domain.
35+
36+
By submitting a Blueprint, you agree to license it under GPLv2 or later license.
37+
38+
### Blueprint Metadata
39+
40+
Each Blueprint should include some basic metadata within the top-level "meta" key in the blueprint.json file. Here's what's required:
41+
42+
* Title: A clear and concise name for your Blueprint.
43+
* Author (GitHub Username): Let others know who created the Blueprint.
44+
45+
Optionally, you can also include:
46+
47+
* Description: Provide a brief explanation of what your Blueprint offers.
48+
* Categories: Specify relevant categories to help users find your Blueprint in the future Blueprints section on WordPress.org.
49+
50+
Here's an example:
51+
52+
```json
53+
{
54+
"meta": {
55+
"title": "WooCommerce Developer Environment",
56+
"description": "A local development environment for WooCommerce that includes WP-CLI.",
57+
"author": "zieladam",
58+
"categories": ["woocommerce", "developer environment"]
59+
}
60+
}
61+
```
62+
63+
## Needing Help?
64+
65+
If you have questions or need assistance, feel free to start a new issue in this repository: @TODO.
66+
67+
## Let's Build the Blueprint Community Together!
68+
69+
This is a minimal version 1 (v1) to get the community space up and running quickly. We plan to build upon this foundation based on your feedback. So, explore, create, and share your Blueprints!

index.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"v1-examples/latest-gutenberg/blueprint.json": {
3+
"title": "Latest Gutenberg plugin",
4+
"description": "A preview of the latest version of the Gutenberg plugin.",
5+
"author": "zieladam",
6+
"categories": [
7+
"plugins"
8+
]
9+
}
10+
}

make_index.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import json
2+
import os
3+
import re
4+
5+
def build_json_index():
6+
index = {}
7+
for root, dirs, files in os.walk('v1-examples'):
8+
for file in files:
9+
if file == 'blueprint.json':
10+
path = os.path.join(root, file)
11+
with open(path, 'r') as f:
12+
data = json.load(f)
13+
meta = data.get('meta', {})
14+
index[path] = meta
15+
with open('index.json', 'w') as f:
16+
json.dump(index, f, indent=2)
17+
18+
build_json_index()
19+
20+
def build_markdown_index():
21+
with open('index.json', 'r') as f:
22+
index = json.load(f)
23+
blueprints_list = []
24+
for path, meta in index.items():
25+
blueprints_list.append('* {0} – [Preview]({1}) | [Source]({2})\n'.format(
26+
meta.get('title', ''),
27+
'https://playground.wordpress.net/blueprint-url?url=https://raw.githubusercontent.com/adamziel/blueprints/trunk/' + path,
28+
'https://github.com/adamziel/blueprints/blob/trunk/' + path
29+
))
30+
# Replace "{BLUEPRINTS_LIST}" in README.md.template and save to README.md
31+
with open('README.md.template', 'r') as f:
32+
template = f.read()
33+
with open('README.md', 'w') as f:
34+
f.write(re.sub(r'{BLUEPRINTS_LIST}', ''.join(blueprints_list), template))
35+
36+
build_markdown_index()
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"meta": {
3+
"title": "Latest Gutenberg plugin",
4+
"description": "A preview of the latest version of the Gutenberg plugin.",
5+
"author": "zieladam",
6+
"categories": ["plugins"]
7+
},
8+
"plugins": ["gutenberg"]
9+
}
10+

0 commit comments

Comments
 (0)