summaryrefslogtreecommitdiff
path: root/Settings.hs
diff options
context:
space:
mode:
authorDaniel Gnoutcheff <gnoutchd@softwarefreedom.org>2016-05-27 16:00:00 -0400
committerDaniel Gnoutcheff <gnoutchd@softwarefreedom.org>2018-09-26 18:11:11 -0400
commita1a17acb326020f1b57f587230cb439e901784df (patch)
tree358a1ea916a242609a981ff46e2a6814a2208cec /Settings.hs
parentf1a294e5ddb8ae0ccdcef1a12561e603ff996cfe (diff)
Ported to Debian jessie
Most of the churn here comes from rebasing the Yesod boilerplate.
Diffstat (limited to 'Settings.hs')
-rw-r--r--Settings.hs32
1 files changed, 20 insertions, 12 deletions
diff --git a/Settings.hs b/Settings.hs
index f9f7075..87173c1 100644
--- a/Settings.hs
+++ b/Settings.hs
@@ -3,28 +3,23 @@
-- In addition, you can configure a number of different aspects of Yesod
-- by overriding methods in the Yesod typeclass. That instance is
-- declared in the Foundation.hs file.
-module Settings
- ( widgetFile
- , PersistConfig
- , staticRoot
- , staticDir
- , Extra (..)
- , parseExtra
- ) where
+module Settings where
import Prelude
import Text.Shakespeare.Text (st)
import Language.Haskell.TH.Syntax
import Database.Persist.Sqlite (SqliteConf)
import Yesod.Default.Config
-import qualified Yesod.Default.Util
+import Yesod.Default.Util
import Data.Text (Text)
import Data.Yaml
import Control.Applicative
import Settings.Development
+import Data.Default (def)
+import Text.Hamlet
-- | Which Persistent backend this site is using.
-type PersistConfig = SqliteConf
+type PersistConf = SqliteConf
-- Static setting below. Changing these requires a recompile
@@ -49,13 +44,26 @@ staticDir = "static"
staticRoot :: AppConfig DefaultEnv x -> Text
staticRoot conf = [st|#{appRoot conf}/static|]
+-- | Settings for 'widgetFile', such as which template languages to support and
+-- default Hamlet settings.
+--
+-- For more information on modifying behavior, see:
+--
+-- https://github.com/yesodweb/yesod/wiki/Overriding-widgetFile
+widgetFileSettings :: WidgetFileSettings
+widgetFileSettings = def
+ { wfsHamletSettings = defaultHamletSettings
+ { hamletNewlines = AlwaysNewlines
+ }
+ }
-- The rest of this file contains settings which rarely need changing by a
-- user.
widgetFile :: String -> Q Exp
-widgetFile = if development then Yesod.Default.Util.widgetFileReload
- else Yesod.Default.Util.widgetFileNoReload
+widgetFile = (if development then widgetFileReload
+ else widgetFileNoReload)
+ widgetFileSettings
data Extra = Extra
{ extraCopyright :: Text