Metadrop / drupal-boilerplate

Drupal projects up and running with Docker and many other tools in minutes
28 stars 23 forks source link

Improve the way to work with multiple themes #79

Closed omarlopesino closed 1 year ago

omarlopesino commented 1 year ago

Problem description

Currently, to build/watch themes assets, it is used the make frontend command. This command works on the theme defined in the .env THEME_PATH variable. While this works in most cases, when a DRupal site has more than one theme, it requires to changes the THEME_PATH variable in the .env file.

This may be a bit uncomfortable because it requires changing a file managed by GIT but it does not need to be committed. Plus, .env variables must be changed when to change the environment features, and not to parameterise a command, which is this case.

Proposed resolution

The resolution si to delegate all the theme variables into the make frontend command through these steps:

Boilerplate

  1. Remove the THEME_PATH from .env 2 In the Makefile, add two variables:
    • FRONTEND_THEMES_PATH: Base path of the themes (s.e.: /var/www/html/web/themes/custom).
    • FRONTEND_THEME: Name of the theme that needs to be worked on: (s.e.: metadrop_radix).

Scripthor

Scripthor must be adapted to replace the values of the FRONTEND_THEME variable in the Makefile with the custom theme created in the `composer create-project' process.

omarlopesino commented 1 year ago

Work in progress have been done in scriptor at branch fb-frontend-themes-path. Also, a work in progress is done in the boilerplate in the following pull request: https://github.com/Metadrop/drupal-boilerplate/pull/80

omarlopesino commented 1 year ago

Please may someone review these PR: https://github.com/Metadrop/scripthor/pull/46 https://github.com/Metadrop/drupal-boilerplate/pull/80 ?

AliagaDev commented 1 year ago

LGTM!

omarlopesino commented 1 year ago

This is already merged and released. Closing.