Skip to content

Commit

Permalink
fix main
Browse files Browse the repository at this point in the history
  • Loading branch information
falgon committed Aug 25, 2023
1 parent 97fe5a9 commit 6a3f1d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
16 changes: 13 additions & 3 deletions app/site/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ techBlogConf = B.BlogConfig {
, B.blogDescription = TB.blogDesc
, B.blogFont = RokiLog.font
, B.blogPageEntriesNum = 5
, B.blogPrevNextTitleMaxNum = 6
, B.blogFeedRecentNum = 20
, B.blogIsPreview = False
, B.blogHeaderAdditional = mempty
, B.blogBeforeContentBodyAdditional = RokiLog.gAdSenseBeforeContentBody
, B.blogFooterAdditional = RokiLog.footerAdditionalComponent
Expand All @@ -181,7 +183,9 @@ diaryConf = B.BlogConfig {
, B.blogDescription = AB.blogDesc
, B.blogFont = RokiDiary.font
, B.blogPageEntriesNum = 5
, B.blogPrevNextTitleMaxNum = 6
, B.blogFeedRecentNum = 20
, B.blogIsPreview = False
, B.blogHeaderAdditional = RokiDiary.gAdSenseHeader
, B.blogBeforeContentBodyAdditional = RokiDiary.gAdSenseBeforeContentBody
, B.blogFooterAdditional = RokiDiary.gAdSenseFooter
Expand All @@ -208,8 +212,14 @@ main = do
}
writer = if optPreviewFlag opts then writerPreviewOptions else writerOptions
blogConfs = [
techBlogConf { B.blogWriterOptions = writer }
, diaryConf { B.blogWriterOptions = writer }
techBlogConf {
B.blogIsPreview = optPreviewFlag opts
, B.blogWriterOptions = writer
}
, diaryConf {
B.blogIsPreview = optPreviewFlag opts
, B.blogWriterOptions = writer
}
]

hakyllWithArgs conf (Options (optVerbose opts) $ mapIL (optInternalLinks opts) $ optCmd opts $ conf) $ do
Expand All @@ -218,7 +228,7 @@ main = do
*> Style.rules
*> Js.rules
faIcons <- fold <$> preprocess FA.loadFontAwesome
mapM_ (runReaderT $ B.blogRules (optPreviewFlag opts) faIcons) blogConfs
mapM_ (runReaderT $ B.blogRules faIcons) blogConfs
TopPage.rules blogConfs faIcons

match "CNAME" $ route idRoute >> compile copyFileCompiler
Expand Down
5 changes: 3 additions & 2 deletions src/Rules/Blog/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ listPageRules title faIcons tags bc pgs = paginateRules pgs $ \pn pat -> do
>>= relativizeUrls
>>= FA.render faIcons

blogRules :: Bool -> FA.FontAwesomeIcons -> BlogConfReader Rules Rules ()
blogRules isPreview faIcons = do
blogRules :: FA.FontAwesomeIcons -> BlogConfReader Rules Rules ()
blogRules faIcons = do
bc <- ask
tags <- asks blogTagBuilder >>= lift
isPreview <- asks blogIsPreview
postCtx' <- mconcatMapM id [
pure $ postCtx isPreview tags
, BlogCtx.tagCloud
Expand Down

0 comments on commit 6a3f1d4

Please sign in to comment.