Preprocess assets as Django management command
Rather than directly invoke command-line Python (and Mako) from the assets Rakefile, or call an external Python script, use a Django management command to preprocess all asset template files. An "asset template file" is defined as a static asset file with a file extension indicating that it needs to be run through a template engine prior to Sass/CoffeeScript compilation or packaging with other assets. The preprocess_assets management command will look through all of the files listed in the `STATICFILES_DIRS`, preprocessing each as needed. Preprocessing strips off the special template file extension, creating a new file in the process. Currently, the only variable accessible in an asset template file is the `THEME_NAME`, defined in the settings.
Showing
- cms/envs/common.py 1 addition, 0 deletionscms/envs/common.py
- common/djangoapps/mitxmako/management/__init__.py 0 additions, 0 deletionscommon/djangoapps/mitxmako/management/__init__.py
- common/djangoapps/mitxmako/management/commands/__init__.py 0 additions, 0 deletionscommon/djangoapps/mitxmako/management/commands/__init__.py
- common/djangoapps/mitxmako/management/commands/preprocess_assets.py 65 additions, 0 deletions...ngoapps/mitxmako/management/commands/preprocess_assets.py
- lms/envs/common.py 1 addition, 0 deletionslms/envs/common.py
- rakefiles/assets.rake 21 additions, 36 deletionsrakefiles/assets.rake
Loading
Please register or sign in to comment