AmphiBee / pollen-framework

:closed_book: Laravel & WordPress blend for coding as sweet as honey. Join the hive! https://github.com/AmphiBee/pollen-framework
https://amphibee.fr
Other
5 stars 0 forks source link

Implement Gutenberg’s theme.json in resources/views Directory #4

Open ogorzalka opened 1 year ago

ogorzalka commented 1 year ago

Implement Gutenberg’s theme.json file within the resources/views directory, exploring the possibility of specifying a custom location outside the traditional WordPress theme.

Tasks:

  1. Create a new directory, “resources/views,” within the project structure.
  2. Move the theme.json file to the newly created “resources/views” directory.
  3. Update the necessary configurations or code references to point to the new location of the theme.json file.
  4. Test the implementation to ensure the theme.json file is recognized and applied correctly by Gutenberg.
  5. Document the changes made and update the documentation accordingly to reflect the new location of the theme.json file.

Expected Outcome: Upon completion of this ticket, the theme.json file will be relocated to the “resources/views” directory. The implementation aims to verify whether Gutenberg can recognize and utilize the theme.json file from a custom location outside the traditional WordPress theme structure. This provides an opportunity to organize the theme-related files in a different directory while still leveraging Gutenberg’s configuration capabilities.

ogorzalka commented 1 year ago

Done here : https://github.com/AmphiBee/pollen-framework/commit/b54ddc85d4003c3e04536a28bfffe03273428d59

The theme need to be inside the views theme. Every theme features are available (theme.json, block patterns, block categories ...)

To target the theme view, the blade view need to be prefixed by theme::

Example :

Route::any('page', function () {
    return view('theme::pages.default');
});