sagold / handlebars-webpack-plugin

Renders your html-template at build time
161 stars 45 forks source link

Pages from subdirectories #16

Open RuBAN-GT opened 7 years ago

RuBAN-GT commented 7 years ago

Good afternoon! Can I generate pages from subdirectories from entry point with this plugin? I want to keep directory structure from entry and move it to output destination.

Thank you for your answer.

sagold commented 7 years ago

Hi RuBAN.

You can set an entry file in any directory. Since version v1.0.0 you can also add multiple entry files as seen in the README:

new HandlebarsPlugin({
    // path to hbs entry file(s)
    entry: path.join(process.cwd(), "app", "src", "*.hbs"),

If this does not help, a more detailed description of your problem would be helpful.

Regards. sagold

francbelak commented 6 years ago

Hi @sagold,

what do you think about adding the possibility to return a filename too with resultHtml in onBeforeSave hook like I tested here: https://github.com/francbelak/handlebars-webpack-plugin/commit/09e21068bab045a4ed4f6146bceaf4d0a46908e5

I am having multiple entry files and need to keep a certain structure in my output destination. Is there a reason why it is not possible to overwrite the filepath currently?

Regards, Franky