You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mostly useful if you are only inserting URLs and no variables. Any variables will only be rendered once. This example is using coffeescript.
defaultLayout widget =do
y <- getYesod
mroute <- liftIO $ readIORef $ staticRenders y
coffeeUrl <-case mroute ofJust r ->return r
Nothing->do
renderUrl <- getUrlRenderParams
c <- liftIO $ renderCoffee renderUrl $(Settings.coffeeFile "search")
Just (Right (u, p)) <- addStaticContent "js""text/javascript; charset=utf-8"$ encodeUtf8 c
let r = renderUrl u p
liftIO $ writeIORef (staticRenders y) (Just r)
return r