Comments (8)
Would the Grunt 0.4 pattern of '/path/to/dest': ['path/to/src/'] solve this for you? You can find the implementation at https://github.com/phated/grunt-jade/tree/grunt0.4
from grunt-jade.
That'll solve it for me.
I'll use richardbutler's branch till I can upgrade to Grunt 0.4.
from grunt-jade.
I will look into back-porting the changes to master branch as I move to the 0.4 release of this plugin.
from grunt-jade.
What I need is Ruchard Butlers commit. I'll explain my use case:
I have a jade template in
/app/view/jade/list/detail.jade
and I want it to be compiled to
/app/view/list/detail.html
Right now the jade grunt plugin compiles it to
/app/view/detail.html
so I lose the the folder structure (/list/).
With Butler's commit I use this configuration:
jade: {
html: {
src: ['app/views/jade/**/*.jade'],
dest: 'app/views',
options: {
basePath: 'app/views/jade',
client: false
}
}
},
This works thanks to the changes:
35 - , files = grunt.file.expandFiles(this.file.src);
35 + , files = grunt.file.expandFiles(this.file.src)
36 + , basePath = options.basePath;
and
44 + , outputDir = basePath ? path.dirname(path.relative(basePath, filepath )) + "/" : ""
43 45 , src = grunt.file.read(filepath)
44 - , outputFilename = path.basename(filepath, fileExtname)
46 + , outputFilename = outputDir + path.basename(filepath, fileExtname)
from grunt-jade.
With the new syntax, you could do:
jade: {
html: {
files: {
'app/views': ['app/views/jade/*.jade'],
'app/views/list': ['app/views/jade/list/*.jade']
},
options: {
client: false
}
}
}
But I see how that might be a pain to specify multiple or multi-level structures, so I will take a look at implementing basePath.
from grunt-jade.
Shouldn't the following just keep the folder structure?
jade: {
html: {
files: {
'app/views/**/*.js': 'app/views/jade/**/*.jade'
}
}
}
from grunt-jade.
Yes! Glad I found this. Would love to see it merged in.
from grunt-jade.
Added and published to NPM, thanks to everyone that participated on this issue.
from grunt-jade.
Related Issues (13)
- window declaration on jade template? HOT 1
- FYI HOT 1
- grunt.template.process on options HOT 2
- Rewrite for 0.4.0rc7 HOT 2
- Catch compile errors a little more gracefully.... HOT 1
- Grunt 0.4 Release HOT 6
- dependencies parameter in node template HOT 6
- HTML Compilation and Maintain Directory Structure HOT 19
- runtime.js HOT 1
- It does not fail on syntax error HOT 1
- How do I compile mutliple HTML Jade templates that use the same mixin HOT 1
- Says "unexpected identifier although it shouldn't HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-jade.