From 058807dd2a0b7f06643399b24ac61d9a6b996d59 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Mon, 2 Oct 2017 21:39:17 +1100 Subject: [PATCH] Insist on lots of newlines in the generated HTML --- src/Settings.hs | 5 +++-- templates/default-layout-wrapper.hamlet | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Settings.hs b/src/Settings.hs index 7e4aecb..baa97e7 100644 --- a/src/Settings.hs +++ b/src/Settings.hs @@ -19,8 +19,9 @@ import Data.Yaml (decodeEither') import Database.Persist.MySQL (MySQLConf (..)) import Language.Haskell.TH.Syntax (Exp, Name, Q) import Network.Wai.Handler.Warp (HostPreference) +import Text.Hamlet (HamletSettings(hamletNewlines), NewlineStyle(AlwaysNewlines), defaultHamletSettings) import Yesod.Default.Config2 (applyEnvValue, configSettingsYml) -import Yesod.Default.Util (WidgetFileSettings, widgetFileNoReload, +import Yesod.Default.Util (WidgetFileSettings(wfsHamletSettings), widgetFileNoReload, widgetFileReload) import qualified Database.MySQL.Base as MySQL @@ -112,7 +113,7 @@ instance FromJSON AppSettings where -- -- https://github.com/yesodweb/yesod/wiki/Overriding-widgetFile widgetFileSettings :: WidgetFileSettings -widgetFileSettings = def +widgetFileSettings = def { wfsHamletSettings = defaultHamletSettings { hamletNewlines = AlwaysNewlines } } -- | How static files should be combined. combineSettings :: CombineSettings diff --git a/templates/default-layout-wrapper.hamlet b/templates/default-layout-wrapper.hamlet index 1737670..23975d9 100644 --- a/templates/default-layout-wrapper.hamlet +++ b/templates/default-layout-wrapper.hamlet @@ -1,5 +1,4 @@ -$newline never -\ +$doctype 5 \ \ \