handlebars-lang / handlebars.js

Minimal templating on steroids.
http://handlebarsjs.com
MIT License
17.82k stars 2.04k forks source link

Pass JS/CSS from page to template handlebars #1900

Closed tiagocaus closed 1 year ago

tiagocaus commented 1 year ago

Is it possible to pass specific script/stylesheet that are on the page to the template?

Similar to what happens with {{{body}}}

Let's suppose that on page X, I need to pass some specific script, which will only be used on page X.

There is something like (illustrative example):

{script start}
      <script src="assets/js/customX.min.js"></script>
     <script>
       Bla bla bla bla bla
     <script>
{script end}

There in the template file, I capture everything that is in the session of the example above.

There is something like (illustrative example):

{{script}}