|
21 | 21 |
|
22 | 22 | ## Requirements |
23 | 23 |
|
24 | | -- PHP >= 8.1 |
25 | | -- [Acorn](https://github.com/roots/acorn) ^4.3 |
| 24 | +- PHP >= 8.2 |
| 25 | +- [Acorn](https://github.com/roots/acorn) ^5.0 |
26 | 26 | - Composer |
27 | 27 |
|
28 | 28 | ## Installation |
|
55 | 55 | 1. **Child Theme Setup** |
56 | 56 | - Create a child theme with Sage as the parent theme. See [WordPress Child Themes](https://developer.wordpress.org/themes/advanced-topics/child-themes/#how-to-create-a-child-theme). |
57 | 57 |
|
58 | | - Example `style.css`: |
59 | | - |
60 | | - ```css |
61 | | - /** |
62 | | - * Theme Name: Sage Child Theme |
63 | | - * Template: sage |
64 | | - * Theme URI: https://www.example.com/sage-child/ |
65 | | - * Description: Sage child theme |
66 | | - * Version: 1.0.0 |
67 | | - * Author: Example Inc. |
68 | | - * Author URI: http://www.example.com/ |
69 | | - * Text Domain: sage |
70 | | - * License: MIT License |
71 | | - * License URI: https://opensource.org/licenses/MIT |
72 | | - * Requires PHP: 8.2 |
73 | | - * Requires at least: 5.9 |
74 | | - */ |
75 | | - ``` |
| 58 | + Example `style.css`: |
| 59 | + |
| 60 | + ````css |
| 61 | + /** |
| 62 | + * Theme Name: Sage Child Theme |
| 63 | + * Template: sage |
| 64 | + * Theme URI: https://www.example.com/sage-child/ |
| 65 | + * Description: Sage child theme |
| 66 | + * Version: 1.0.0 |
| 67 | + * Author: Example Inc. |
| 68 | + * Author URI: http://www.example.com/ |
| 69 | + * Text Domain: sage |
| 70 | + * License: MIT License |
| 71 | + * License URI: https://opensource.org/licenses/MIT |
| 72 | + * Requires PHP: 8.2 |
| 73 | + * Requires at least: 5.9 |
| 74 | + */ |
| 75 | + ``` |
| 76 | + |
| 77 | + ```` |
76 | 78 |
|
77 | 79 | - Place your configuration files in `config/` within your child theme directory. These will be merged with the parent configuration where child theme configuration takes precedence. To unset a configuration option from the parent theme in the child theme you can pass an empty array for that configuration option. |
78 | 80 |
|
79 | 81 | 2. **Update Acorn Bootloader** |
80 | | - |
81 | 82 | - In your theme's `functions.php`, use the `Yard\Nutshell\bootloader()` helper to bootstrap Acorn with Nutshell's enhancements. |
82 | 83 |
|
83 | | - ```diff |
84 | | - -\Roots\Acorn\Application::configure()->boot(); |
85 | | - +\Yard\Nutshell\bootloader(__DIR__)->boot(); |
86 | | - ``` |
| 84 | + ```diff |
| 85 | + -\Roots\Acorn\Application::configure()->boot(); |
| 86 | + +\Yard\Nutshell\bootloader(__DIR__)->boot(); |
| 87 | + ``` |
87 | 88 |
|
88 | 89 | 3. **Update app config** |
89 | | - |
90 | 90 | - In your themes `config/app.php' replace Acorn's ServiceProvider with Nutshell's ServiceProvider |
91 | 91 |
|
92 | | - ```diff |
93 | | - -use Roots\Acorn\ServiceProvider; |
94 | | - +use Yard\Nutshell\ServiceProvider; |
95 | | - ``` |
| 92 | + ```diff |
| 93 | + -use Roots\Acorn\ServiceProvider; |
| 94 | + +use Yard\Nutshell\ServiceProvider; |
| 95 | + ``` |
96 | 96 |
|
97 | 97 | 4. **Register View Composers** |
98 | 98 | - Add your view composers to `config/view.php` under the `composers` key. Automatic discovery is disabled for explicit control. |
99 | 99 |
|
100 | | - ```diff |
101 | | - - 'composers' => [], |
102 | | - + 'composers => [ |
103 | | - + 'app' => App\View\Composers\App::class, |
104 | | - + 'comments' => App\View\Composers\Comments::class, |
105 | | - + 'post' => App\View\Composers\Post::class, |
106 | | - + ], |
107 | | - ``` |
| 100 | + ```diff |
| 101 | + - 'composers' => [], |
| 102 | + + 'composers => [ |
| 103 | + + 'app' => App\View\Composers\App::class, |
| 104 | + + 'comments' => App\View\Composers\Comments::class, |
| 105 | + + 'post' => App\View\Composers\Post::class, |
| 106 | + + ], |
| 107 | + ``` |
108 | 108 |
|
109 | 109 | 5. **Register Console Commands** |
110 | 110 | - Add custom Artisan commands to `config/console.php` under the `commands` key. |
111 | 111 |
|
112 | | - ```diff |
113 | | - + 'commands => [ |
114 | | - + 'test' => App\Console\Commands\Test::class, |
115 | | - + ], |
116 | | - ``` |
| 112 | + ```diff |
| 113 | + + 'commands => [ |
| 114 | + + 'test' => App\Console\Commands\Test::class, |
| 115 | + + ], |
| 116 | + ``` |
117 | 117 |
|
118 | 118 | 6. **Vite Integration** |
119 | 119 | - Vite is enabled by default. Use the provided `Yard\Nutshell\Assets\Vite` class for asset management. |
|
132 | 132 | ## About us |
133 | 133 |
|
134 | 134 | [](https://www.yard.nl/werken-bij/) |
135 | | - |
0 commit comments