File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ main = do
105105
106106 -- start the server
107107 simpleHTTPWithSocket sock serverConf $ msum [ wiki conf
108- , dir " _reloadTemplates" reloadTemplates
108+ , dir " _reloadTemplates" ( reloadTemplates conf)
109109 ]
110110
111111data ExitOpt
Original file line number Diff line number Diff line change @@ -210,9 +210,9 @@ wikiHandlers =
210210 ]
211211
212212-- | Recompiles the gitit templates.
213- reloadTemplates :: ServerPart Response
214- reloadTemplates = do
215- liftIO recompilePageTemplate
213+ reloadTemplates :: Config -> ServerPart Response
214+ reloadTemplates cfg = do
215+ liftIO $ recompilePageTemplate cfg
216216 ok $ toResponse " Page templates have been recompiled."
217217
218218-- | Converts a gitit Handler into a standard happstack ServerPart.
Original file line number Diff line number Diff line change @@ -63,15 +63,13 @@ initializeGititState conf = do
6363
6464 updateGititState $ \ s -> s { sessions = Sessions M. empty
6565 , users = users'
66- , templatesPath = templatesDir conf
6766 , renderPage = defaultRenderPage templ
6867 , plugins = plugins' }
6968
7069-- | Recompile the page template.
71- recompilePageTemplate :: IO ()
72- recompilePageTemplate = do
73- tempsDir <- queryGititState templatesPath
74- ct <- compilePageTemplate tempsDir
70+ recompilePageTemplate :: Config -> IO ()
71+ recompilePageTemplate cfg = do
72+ ct <- compilePageTemplate (templatesDir cfg)
7573 updateGititState $ \ st -> st{renderPage = defaultRenderPage ct}
7674
7775--- | Compile a master page template named @page.st@ in the directory specified.
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ import Network.Gitit.Types
3939gititstate :: IORef GititState
4040gititstate = unsafePerformIO $ newIORef GititState { sessions = undefined
4141 , users = undefined
42- , templatesPath = undefined
4342 , renderPage = undefined
4443 , plugins = undefined }
4544
Original file line number Diff line number Diff line change @@ -263,7 +263,6 @@ data User = User {
263263data GititState = GititState {
264264 sessions :: Sessions SessionData ,
265265 users :: M. Map String User ,
266- templatesPath :: FilePath ,
267266 renderPage :: PageLayout -> Html -> Handler ,
268267 plugins :: [Plugin ]
269268}
You can’t perform that action at this time.
0 commit comments