hogan-express icon indicating copy to clipboard operation
hogan-express copied to clipboard

Allow custom yield-<name> blocks to occur after they're declared

Open NachoMan opened this issue 10 years ago • 1 comments

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}}

NachoMan avatar Sep 22 '13 18:09 NachoMan

Does this not work for you? We do this, and it works fine.

tandrewnichols avatar Jun 08 '15 16:06 tandrewnichols