module Web.View.Layout (defaultLayout, Html) where import IHP.ViewPrelude import IHP.Environment import Generated.Types import IHP.Controller.RequestContext import Web.Types import Web.Routes import Application.Helper.View defaultLayout :: Html -> Html defaultLayout inner = [hsx| {metaTags} {stylesheets} {scripts} {pageTitleOrDefault "App"}
{renderFlashMessages} {inner}
|] -- The 'assetPath' function used below appends a `?v=SOME_VERSION` to the static assets in production -- This is useful to avoid users having old CSS and JS files in their browser cache once a new version is deployed -- See https://ihp.digitallyinduced.com/Guide/assets.html for more details stylesheets :: Html stylesheets = [hsx| |] scripts :: Html scripts = [hsx| {when isDevelopment devScripts} |] devScripts :: Html devScripts = [hsx| |] metaTags :: Html metaTags = [hsx| {autoRefreshMeta} |]