web: simplify static path definitions
This commit is contained in:
parent
c3b5bcb37b
commit
5c07a465da
@ -22,7 +22,6 @@ module Hledger.Web.Settings
|
|||||||
, defbaseurl
|
, defbaseurl
|
||||||
, hledgerorgurl
|
, hledgerorgurl
|
||||||
, manualurl
|
, manualurl
|
||||||
-- , datadir
|
|
||||||
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
@ -106,12 +105,7 @@ loadConfig env = do
|
|||||||
-- | The location of static files on your system. This is a file system
|
-- | The location of static files on your system. This is a file system
|
||||||
-- path. The default value works properly with your scaffolded site.
|
-- path. The default value works properly with your scaffolded site.
|
||||||
staticDir :: FilePath
|
staticDir :: FilePath
|
||||||
--staticDir = "static"
|
staticDir = "static"
|
||||||
staticDir = datadir++"static"
|
|
||||||
|
|
||||||
datadir :: FilePath
|
|
||||||
datadir = "./"
|
|
||||||
-- datadir = "./.hledger/web/"
|
|
||||||
|
|
||||||
-- | The base URL for your static files. As you can see by the default
|
-- | The base URL for your static files. As you can see by the default
|
||||||
-- value, this can simply be "static" appended to your application root.
|
-- value, this can simply be "static" appended to your application root.
|
||||||
@ -148,7 +142,7 @@ staticRoot conf = [st|#{appRoot conf}/static|]
|
|||||||
-- | expects a root folder for each type, e.g: hamlet/ lucius/ julius/
|
-- | expects a root folder for each type, e.g: hamlet/ lucius/ julius/
|
||||||
globFile :: String -> String -> FilePath
|
globFile :: String -> String -> FilePath
|
||||||
-- globFile kind x = kind ++ "/" ++ x ++ "." ++ kind
|
-- globFile kind x = kind ++ "/" ++ x ++ "." ++ kind
|
||||||
globFile kind x = datadir ++ "templates/" ++ x ++ "." ++ kind
|
globFile kind x = "templates/" ++ x ++ "." ++ kind
|
||||||
|
|
||||||
hamletFile :: FilePath -> Q Exp
|
hamletFile :: FilePath -> Q Exp
|
||||||
hamletFile = S.hamletFile . globFile "hamlet"
|
hamletFile = S.hamletFile . globFile "hamlet"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user