Brave is a template for making WordPress sites. It is primarily a combination of Bedrock, Acorn and Sage, with a few modifications and additional features.
This project includes scaffolding commands for commonly used content types to help you get started quickly. The best way to get familiar with this project is by running the following commands and exploring the generated files:
More information: Brave Scaffold
wp acorn scaffold:news
wp acorn scaffold:person
wp acorn scaffold:project
wp acorn scaffold:knowledgebase
wp acorn scaffold:events- To create a child theme you can run the following command. This will create a child theme directory in
web/app/themes/{slug}that has Sage as the parent theme.
wp acorn scaffold:sage-child {slug}- Add PSR-4 autoloading for your child theme to your (root)
composer.json:
"autoload": {
"psr-4": {
"App\\": "web/app/themes/sage/app/",
+ "ChildTheme\\App\\": "web/app/themes/{slug}/app/",
}
},
More information: Sage Child Theme Support.
Brave comes with a set of default components. Component views can be published with the following command:
wp acorn vendor:publish --provider="Yard\Brave\ComponentsServiceProvider" --tag="views"More information: Brave Components
- Run
nvm useto automatically use the correct Node version - Run
pnpm installto install dependencies - Run
pnpm startto compile assets
pnpm link <package-path>For example: pnpm link /Users/<user>/Packages/brave-frontend-kit
Note: if you encounter errors with missing dependencies, add this to pnpm-workspace.yaml. For example:
overrides:
'@yardinternet/toolkit': link:../../../../Packages/yard-toolkit/packages/toolkit
shamefullyHoist: true # Add this line