Fixes for templates folder
This commit is contained in:
parent
23139a579d
commit
39692f8379
@ -52,24 +52,24 @@ addStaticContentExternal minify hash staticDir toRoute ext' _ content = do
|
||||
| ext' == "js" = either (const content) id $ minify content
|
||||
| otherwise = content
|
||||
|
||||
-- | expects a root folder for each type, e.g: hamlet/ lucius/ julius/
|
||||
-- | expects a file extension for each type, e.g: hamlet lucius julius
|
||||
globFile :: String -> String -> FilePath
|
||||
globFile kind x = kind ++ "/" ++ x ++ "." ++ kind
|
||||
globFile kind x = "templates/" ++ x ++ "." ++ kind
|
||||
|
||||
widgetFileProduction :: FilePath -> Q Exp
|
||||
widgetFileProduction x = do
|
||||
let h = whenExists x "templates" whamletFile
|
||||
let c = whenExists x "templates" cassiusFile
|
||||
let j = whenExists x "templates" juliusFile
|
||||
let l = whenExists x "templates" luciusFile
|
||||
let h = whenExists x "hamlet" whamletFile
|
||||
let c = whenExists x "cassius" cassiusFile
|
||||
let j = whenExists x "julius" juliusFile
|
||||
let l = whenExists x "lucius" luciusFile
|
||||
[|$h >> addCassius $c >> addJulius $j >> addLucius $l|]
|
||||
|
||||
widgetFileDebug :: FilePath -> Q Exp
|
||||
widgetFileDebug x = do
|
||||
let h = whenExists x "templates" whamletFile
|
||||
let c = whenExists x "templates" cassiusFileDebug
|
||||
let j = whenExists x "templates" juliusFileDebug
|
||||
let l = whenExists x "templates" luciusFileDebug
|
||||
let h = whenExists x "hamlet" whamletFile
|
||||
let c = whenExists x "cassius" cassiusFileDebug
|
||||
let j = whenExists x "julius" juliusFileDebug
|
||||
let l = whenExists x "lucius" luciusFileDebug
|
||||
[|$h >> addCassius $c >> addJulius $j >> addLucius $l|]
|
||||
|
||||
whenExists :: String -> String -> (FilePath -> Q Exp) -> Q Exp
|
||||
|
||||
@ -125,7 +125,7 @@ determineHamletDeps x = do
|
||||
A.Fail{} -> return []
|
||||
A.Done _ r -> mapM go r >>= filterM doesFileExist . concat
|
||||
where
|
||||
go (Just (Hamlet, f)) = return [f, "hamlet/" ++ f ++ ".hamlet"]
|
||||
go (Just (Hamlet, f)) = return [f, "templates/" ++ f ++ ".hamlet"]
|
||||
go (Just (Verbatim, f)) = return [f]
|
||||
go (Just (Messages f, _)) = return [f]
|
||||
go (Just (StaticFiles fp, _)) = getFolderContents fp
|
||||
|
||||
Loading…
Reference in New Issue
Block a user