dciccale / grunt-processhtml

Process html files at build time to modify them depending on the release environment
MIT License
407 stars 30 forks source link

How do you build html file that exist in a subfolder? #79

Closed guntherkoo closed 9 years ago

guntherkoo commented 9 years ago

All the root .html files get built with include but the subfolder doesn't have the same effect. Need help! :)

This is my Grunt.js file:

processhtml: { dist: { options: { process: true }, files: [{ expand: true, cwd: 'app/', src: ['*/.html'], dest: 'public/', ext: '.html' }] } },

Thanks in advance!

dciccale commented 9 years ago

what about tis **/*.html ?

guntherkoo commented 9 years ago

Nah, it still doesn't seem to read the file for me.. :(

guntherkoo commented 9 years ago

Seems to only be reading only the .html files in the root but not any in the subfolders.. please help!

dciccale commented 9 years ago

try passing the recursive option

dist: {
options: {
recursive: true,
process: true
},
``
dciccale commented 9 years ago

if this doesn't work, please explain better what's the issue, are you trying to include nested files? or just process through subfolders?

try give an example of the issue

guntherkoo commented 9 years ago

I tried that as well, so basically what I'm trying to do is to include the header and footer for this website I'm building. HTML files that exist on the root of the app/ works with including header.html and footer.html but any HTML files that exist inside a folder isn't getting the included tag files like header.html and footer.html after I run the build grunt task.

Since the HTML file is inside a folder, I've tried changing the include tag to be /include/header.html but that still isn't working for me.

guntherkoo commented 9 years ago

Hi @dciccale, any idea on how to fix this? Sorry to bother you, just want to get this working :)

guntherkoo commented 9 years ago

@dciccale I just figured it out! Maybe something you want to include in your documentation. You need to include the option:includeBase

in order for subfolder .html items to be built with processhtml.

Removing the folder the include files are in, just having

Hope that can help the next person who comes across this issue.

Thanks for your help none the less!

dciccale commented 9 years ago

ok thanks!