Closed vendethiel closed 11 years ago
Basically with this change, if your template is
src/blog/templates/articles/index.jade
instead of slicing some bits and then adding only the last part, I'm slicing some bits and adding everything after @modulesFolder
(and removing it). The virtual path will then be :
blog/articles/index.html
which seems the best to me.
@GulinSS could you consider generating only one templates.js
file ?
I created jade-angularjs-brunch2 for that but I'd rather not duplicate efforts and just have one package for that.
I can probably PR if yes.
I think that the best solution would be to generate one javascript file for many jade files per folder. Example:
.../templates/1.jade
.../templates/2.jade
.../templates/folder1/1-1.jade
.../templates/folder1/1-2.jade
.../templates/folder1/folder1-1/1-1-1.jade
.../templates/folder1/folder1-1/1-1-2.jade
.../templates/folder1/folder1-2/1-2-1.jade
.../templates/folder2/2-1.jade
Result:
/js/templates.js (contains jade files 1 and 2 with angular module 'templates')
/js/templates.folder1.js (contains jade files 1-1 and 1-2 with angular module 'templates.folder1')
/js/templates.folder1.folder1-1.js (contains jade files 1-1-1 and 1-1-2 with angular module 'templates.folder1.folder1-1')
/js/templates.folder1.folder1-2.js (contains jade file 1-2-1 with angular module 'templates.folder1.folder1-2')
/js/templates.folder2.js (contains jade file 2-1 with angular module 'templates.folder2')
etc...
If our ideas are similar, please start PR.
Why do you want separate files?
Separating files is very useful if your static html application consisits of SPA-parts. In this case with separated template files you can upload to client templates only needed by current SPA-section of large static javascipt/html application.
Example:
/section1/index.html
/section2/index.html
In section 1 we attach only templates.section1.js file, but in section 2 we attach only templates.section2.js. It is very usefull for large static client-side applications when your client's Internet channel is limited and loading time of pages is important.
I see, that makes sense. I'd still like to be able to choose.
It seems to has two modes:
And your PR will implements first. So, please select and keep a place to implement second mode.
Oke. What should the option name be?
May be, hierarchy with boolean type?
That doesn't seem very descriptive. Maybe just "single_file"?
Okay. Sorry for waiting.
resolve #11