Skip to content

Commit 4d9adad

Browse files
committed
feat: add example theme with carbon fields and front-end structure
Front-end includes typescript, tailwind, eslint and prettier.
1 parent e18cfdd commit 4d9adad

32 files changed

+12695
-6713
lines changed

.env.example

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
# ${WORDPRESS_DB_NAME} and ${WORDPRESS_DB_PASSWORD} are passed from the environment variables
2-
# Docker Compose adds when the `wordpress` container is launched
3-
# In a production environment we should set them directly
4-
DB_NAME=${WORDPRESS_DB_NAME}
1+
DB_NAME=wordpress-starter-template
52
DB_USER=root
6-
DB_PASSWORD=${WORDPRESS_DB_PASSWORD}
3+
DB_PASSWORD=password
74

85
# Optionally, you can use a data source name (DSN)
96
# When using a DSN, you can remove the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST variables
107
# DATABASE_URL='mysql://database_user:database_password@database_host:database_port/database_name'
118

12-
# ${WORDPRESS_DB_HOST} and ${WORDPRESS_TABLE_PREFIX} are passed from the environment variables
13-
# Docker Compose adds when the `wordpress` container is launched
14-
# In a production environment we should set them directly
15-
DB_HOST=${WORDPRESS_DB_HOST}
16-
DB_PREFIX=${WORDPRESS_TABLE_PREFIX}
9+
DB_HOST=mysql
10+
DB_PREFIX=wp_
1711

1812
# Make sure that WP_HOME url does not have a trailing slash after it
1913
WP_ENV='development'
2014
WP_HOME='http://localhost:8082'
2115
WP_SITEURL="${WP_HOME}/wp"
22-
WP_DEBUG_LOG=/path/to/debug.log
16+
WP_DEBUG_LOG=/var/www/html/web/app/debug.log
2317

2418
# Generate your keys here: https://roots.io/salts.html
2519
AUTH_KEY='generateme'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ web/.htaccess
2121

2222
# Composer
2323
/vendor
24+
/web/app/vendor
2425

2526
# WP-CLI
2627
wp-cli.local.yml

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ This folder structure uses the [Bedrock](https://roots.io/bedrock/) pattern, a m
1111

1212
## Run locally
1313

14-
1. [Generate a repository](https://github.com/commonknowledge/groundwork-starter-template/generate) from this template
14+
1. [Clone This Repository](https://github.com/commonknowledge/wordpress-starter-template)
15+
2. Search and replace all instances of `wordpress-starter-template` and `WordpressStarterTemplate` with the name of the new project, in kebab and camel case respectfully. Also rename the theme folder `web/app/themes/wordpress-starter-template` to the name of the new project.
1516
2. If you have PHP and Composer installed locally you can run from this directory `composer install`. Otherwise run `composer install` via Docker with `docker compose run composer install`.
1617
3. Copy `.env.example` to `.env`, running `cp .env.example .env`. The example file contains variables required for this Docker Compose setup but modify details appropriately [as per the Bedrock documentation](https://roots.io/bedrock/docs/environment-variables/) as required.
1718
4. Start up all containers with:

composer.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,31 @@
2525
"roots/wp-password-bcrypt": "1.1.0",
2626
"wpackagist-plugin/wordpress-importer": "^0.8.0",
2727
"wpackagist-plugin/wordfence": "^8.0",
28-
"wpackagist-plugin/safe-svg": "^2.1.1"
28+
"wpackagist-plugin/safe-svg": "^2.1.1",
29+
"htmlburger/carbon-fields": "^3.6"
2930
},
3031
"require-dev": {
3132
"squizlabs/php_codesniffer": "^3.7.2",
3233
"roave/security-advisories": "dev-latest",
3334
"smgladkovskiy/phpcs-git-pre-commit": "dev-master",
34-
"wpackagist-plugin/create-block-theme": "2.4.0",
35+
"wpackagist-plugin/create-block-theme": "^2.6.0",
3536
"wpackagist-plugin/pattern-manager": "^0.3.0",
3637
"wpackagist-plugin/duplicate-post": "^4.5",
37-
"wpackagist-plugin/fakerpress": "^0.6.1"
38+
"wpackagist-plugin/fakerpress": "^0.6.1",
39+
"mnsami/composer-custom-directory-installer": "^2.0"
40+
},
41+
"autoload": {
42+
"psr-4": {
43+
"CommonKnowledge\\WordpressStarterTemplate\\": "web/app/themes/wordpress-starter-template/src/"
44+
}
3845
},
3946
"config": {
4047
"optimize-autoloader": true,
4148
"preferred-install": "dist",
4249
"allow-plugins": {
4350
"composer/installers": true,
44-
"roots/wordpress-core-installer": true
51+
"roots/wordpress-core-installer": true,
52+
"mnsami/composer-custom-directory-installer": true
4553
}
4654
},
4755
"minimum-stability": "dev",
@@ -56,6 +64,9 @@
5664
],
5765
"web/app/themes/{$name}/": [
5866
"type:wordpress-theme"
67+
],
68+
"web/app/vendor/{$vendor}/{$name}/": [
69+
"htmlburger/carbon-fields"
5970
]
6071
},
6172
"wordpress-install-dir": "web/wp"

0 commit comments

Comments
 (0)