|
|
|
@ -152,19 +152,19 @@ instance YesodPersist Dfsek where |
|
|
|
|
runSqlPool f pool |
|
|
|
|
|
|
|
|
|
getHomeR :: Handler Html |
|
|
|
|
getHomeR = defaultLayout $(whamletFile "pages/home.hamlet") |
|
|
|
|
getHomeR = defaultLayout (setTitle "dfsek.com" >> $(whamletFile "pages/home.hamlet")) |
|
|
|
|
|
|
|
|
|
getAboutR :: Handler Html |
|
|
|
|
getAboutR = defaultLayout $(whamletFile "pages/about.hamlet") |
|
|
|
|
getAboutR = defaultLayout (setTitle "dfsek.com - About" >> $(whamletFile "pages/about.hamlet")) |
|
|
|
|
|
|
|
|
|
getProjectsR :: Handler Html |
|
|
|
|
getProjectsR = defaultLayout $(whamletFile "pages/projects.hamlet") |
|
|
|
|
getProjectsR = defaultLayout (setTitle "dfsek.com - My Project" >> $(whamletFile "pages/projects.hamlet")) |
|
|
|
|
|
|
|
|
|
getBlogR :: Handler Html |
|
|
|
|
getBlogR = defaultLayout $(whamletFile "pages/blog.hamlet") |
|
|
|
|
getBlogR = defaultLayout (setTitle "dfsek.com - Blog" >> $(whamletFile "pages/blog.hamlet")) |
|
|
|
|
|
|
|
|
|
getBlogTEMP_RIVERS :: Handler Html |
|
|
|
|
getBlogTEMP_RIVERS = defaultLayout $(whamletFile "static_blog/noise_rivers.hamlet") |
|
|
|
|
getBlogTEMP_RIVERS = defaultLayout (setTitle "dfsek.com - Blog - Procedural River Generation" >> $(whamletFile "static_blog/noise_rivers.hamlet")) |
|
|
|
|
|
|
|
|
|
appMain :: IO () |
|
|
|
|
appMain = do |
|
|
|
@ -172,12 +172,12 @@ appMain = do |
|
|
|
|
case c' of |
|
|
|
|
Left e -> error $ "Could not parse config file: " <> show e |
|
|
|
|
Right conf -> do |
|
|
|
|
pool <- runStdoutLoggingT $ createSqlitePool "images.db3" $ connection_count (database conf) |
|
|
|
|
pool <- runStdoutLoggingT $ createSqlitePool (sqlite_file (database conf)) $ connection_count (database conf) |
|
|
|
|
runSqlPersistMPool (runMigration migrateAll) pool |
|
|
|
|
|
|
|
|
|
let contentDir = content_directory conf |
|
|
|
|
createDirectoryIfMissing True contentDir |
|
|
|
|
putStrLn $ "Images will be saved to " <> contentDir |
|
|
|
|
putStrLn $ "Static directory: " <> contentDir |
|
|
|
|
|
|
|
|
|
staticRoute <- static contentDir |
|
|
|
|
staticWellKnown <- static contentDir |
|
|
|
|