Fixes for templates folder

This commit is contained in:
Michael Snoyman 2011-10-14 10:10:05 +02:00
parent 23139a579d
commit 39692f8379
2 changed files with 11 additions and 11 deletions

View File

@ -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

View File

@ -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