styleguidist/mini-html-webpack-plugin

Let's add `body` field to default template?

bebraw opened this issue ยท 4 comments

Now the default template looks like this:

<!DOCTYPE html>
<html${htmlAttrs}>
    <head>
      <meta charset="UTF-8">
      <title>${title}</title>
      ${cssTags}
    </head>
    <body>
      ${jsTags}
    </body>
</html>

For my use case, I want to inject extra content within body (I'm processing some markdown and want to inject the resulting HTML). What if we extended the template like this?

...
<body>
  ${body}
  ${jsTags}
</body>

With this small change, you could pass extra content to body directly through context without having to rewrite the entire template.

Yeah, make sense! The only question is the order: should it be before scripts or after or should we have two separate variables or it doesn't matter at all?

Given the best practice seems to be to run JS after content, I would go with the ordering above. If inverse order is needed, then a bigger template change would be needed by the user but I would expect that to be the exceptional case.

Make sense!

๐ŸŽ‰ This issue has been resolved in version 2.2.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€