Skip to content

Commit

Permalink
fix(template): Start using {{asset}} Ghost helper. Close #61
Browse files Browse the repository at this point in the history
  • Loading branch information
oswaldoacauan committed Mar 7, 2014
1 parent 416fa04 commit d26b706
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,20 @@ module.exports = function(grunt) {
html: ['<%= dir.build %>/**/*.hbs']
},

/**
* Replace html assets path to Ghost handlebars {{assets}} helper
*/
replace: {
build: {
src: ['<%= dir.build %>/**/*.hbs'],
overwrite: true,
replacements: [{
from: /[\"\']\/assets\/(.*?)[\"\']/gi,
to: '"{{asset \'$1\'}}"'
}]
}
},

/**
* Copy all files to build/release folder
*/
Expand Down Expand Up @@ -397,6 +411,7 @@ module.exports = function(grunt) {
'rev',
'copy:build',
'usemin',
'replace:build',
'imagemin:build',
'svgmin:build',
'autoprefixer:build',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"grunt-usemin": "~2.0.0",
"grunt-push-release": "~0.1.1",
"grunt-conventional-changelog": "~1.0.0",
"grunt-csso": "~0.5.0"
"grunt-csso": "~0.5.0",
"grunt-text-replace": "~0.3.11"
},
"engines": {
"node": ">=0.10.0"
Expand Down

0 comments on commit d26b706

Please sign in to comment.