How can I sort Julius files in a merged javascript file in Yesod?

With the esod scaffolding site, is there a reason the default-layout.julius appears after my other julius files in the generated "autogen-XXX.js"?

Is there a way to change this order so that default-layout.julius is displayed first?

+3


source to share


1 answer


Widget

it is essentially just a transformer WriterT

, and when you add a template, it is added after all other previously added templates. If you look at the implementation of scaffolddefaultLayout

, you can see that it just uses widgetFile

on default-layout

. This ends up including part hamlet

to part julius

, and part hamlet

includes the entire widget of a single page (if that makes sense ... it's really early here right now).



Simple solution: put the content default-layout.julius

in another file (for example default-layout-early.julius

) and then add $(widgetFile "default-layout-early")

before "default-layout". This should do the trick.

+4


source







All Articles