appends static files sha1 checksum as a get param for versioning
This plugin requires Grunt ~0.4.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-django-static-hash-append --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-switch-to-minified');
In your project's Gruntfile, add a section named switch_to_minified
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
switch_to_minified: {
django_app1: {
files: [{
expand: true,
cwd: 'django_app/templates/django_app/', //path to your html files
src: '*.html'
sourceTypes: 'js|css',
pathToReplace: 'non_min_folder',
targetPath: 'minified_folder',
exclude: []
}]
}
}
});
grunt.initConfig({
django_static_hash_append: {
main: {
files: [{
expand: true,
cwd: 'main/templates/',
src: '*.html',
sourceTypes: 'js|css',
pathToReplace: 'orig_',
targetPath: '_',
exclude: []
}]
},
content: {
files: [{
expand: true,
cwd: 'content/templates/content/',
src: '*.html',
sourceTypes: 'js|css',
pathToReplace: 'orig_',
targetPath: '_',
exclude: []
}]
},
},
});
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
initial release