diff options
author | Clint Adams <clint@softwarefreedom.org> | 2013-07-19 15:25:08 -0400 |
---|---|---|
committer | Clint Adams <clint@softwarefreedom.org> | 2013-07-19 15:25:08 -0400 |
commit | f8b325748a3631df00841f3524b6e1f95a4e30f4 (patch) | |
tree | 3eb0d418d8a2ece33774f770e6086108c3ef6c86 /Settings.hs | |
parent | 10f6e8f4cce3303f53df359e0f40fcb5d584e85d (diff) |
Update to newer Yesod.
Diffstat (limited to 'Settings.hs')
-rw-r--r-- | Settings.hs | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/Settings.hs b/Settings.hs index f9f7075..bd1e0ab 100644 --- a/Settings.hs +++ b/Settings.hs @@ -3,25 +3,20 @@ -- 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 @@ -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 |