- HTML 68.6%
- Dockerfile 16.7%
- CSS 14.7%
| parts | ||
| templates | ||
| .cliff.toml | ||
| .containerignore | ||
| .dockerignore | ||
| CHANGELOG.md | ||
| compose.dev.yaml | ||
| compose.yaml | ||
| Containerfile | ||
| LICENSE | ||
| README.md | ||
| screenshot.png | ||
| style.css | ||
| theme.json | ||
WordPress Boilerplate Block Theme
Boilerplate starting point for WordPress block-based themes with support for a container-based local development workflow.
Local development environment
Note
While this environment is developed using
docker-composewith rootlesspodmanas docker context, any properly configuredcomposesetup should work. For example, docker compose could be installed using Docker Desktop--but please beware that there are many considerations, including security and licensing, worth evaluating when picking a container engine.
Prerequisites
- Knowledge of
gitbest practices and workflows. - Container engine of your choice (
podman,docker, etc.). - Compose provider configured properly for your container engine.
Quickstart
1. Building and starting local development containers
docker compose build
docker compose -f compose.dev.yaml up --detach
docker compose logs -f db
2. Configuring WordPress in local development containers
After /usr/sbin/mysqld: ready for connections appears in the logs, you should be ready to complete your setup.
- Navigate to
http://localhost:8080/wp-admin/install.php. - Follow the on-screen prompts to set site details for your development site. Note: This site is configured to be removed entirely when you stop your local development containers.
- Navigate to
http://localhost:8080/wp-admin/themes.phpand activate your boilerplate theme.
3. Developing your theme
Tip
Looking for something more in-depth? Any edits you make manually should be reflected straight to WorpPress when using the
compose.dev.yamlconfiguration! If needed, I recommend Full Site Editing's guides for a quick primer on block themes. The rest of this quickstart will focus on best practices for developing a theme using the WordPress UI.
- Navigate to
http://localhost:8080/wp-admin/plugins.phpto enable the "Create Block Theme" plugin. - Navigate to
http://localhost:8080/wp-admin/site-editor.phpto edit styles, navigation, templates, patterns, etc. - Navigate to
http://localhost:8080/wp-admin/site-editor.php?canvas=editwhen you're ready to save your changes to the repository. - Select the "Create Block Theme" panel in the upper right of the editor.
- Select "Save Changes to Theme" and ensure all appropriate options are selected.
- Commit the changes to your repository using
git.
4. Stopping local development containers
Tip
By default, data is not persisted in your local development containers. This means that when you stop your containers, any changes not saved to the repository will be deleted. If you wish to persist data between restarts of your development containers, consider mounting a volume or local directory to
/var/lib/mysqlon thedbservice.
docker compose down
Resources used in this theme
Create Block Theme plugin, License: GNU General Public License v2.0 or later https://github.com/WordPress/create-block-theme