hogan-express
hogan-express copied to clipboard
Allow custom yield-<name> blocks to occur after they're declared
For layouts that place the <script> tags at the end of the HTML (for loading performance reasons), it would be nice to declare the {{#yield-scripts}} block before the {{{yield-scripts}}} area is defined. For example:
layout: <head> {{{yield-styles}}} </head> <body> ..... {{{yield}}} ..... <script src="/path/to/jquery.js"/> {{{yield-scripts}}} </body> index: <div>Some text that will be embedded in the middle of the HTML</div> {{#yield-scripts}} <script>Some javascript placed at the end of the page</script> {{/yield-scripts}}
Does this not work for you? We do this, and it works fine.