Skip to content

Commit

Permalink
refactor: replace mappend to <>
Browse files Browse the repository at this point in the history
`mappend` will be deprecated and it suggests to use `<>` instead.
  • Loading branch information
kimminss0 committed Nov 24, 2024
1 parent eb3eb00 commit 73d1b16
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ main = hakyll $ do
posts <- recentFirst =<< loadAll "posts/*"
let archiveCtx =
listField "posts" postCtx (return posts)
`mappend` constField "title" "Posts"
`mappend` defaultContext
<> constField "title" "Posts"
<> defaultContext

makeItem ""
>>= loadAndApplyTemplate "templates/posts.html" archiveCtx
Expand All @@ -61,7 +61,7 @@ main = hakyll $ do
posts <- recentFirst =<< loadAll "posts/*"
let sitemapCtx =
listField "posts" postCtx (return posts)
`mappend` defaultContext
<> defaultContext

makeItem ""
>>= loadAndApplyTemplate "templates/sitemap.xml" sitemapCtx
Expand All @@ -78,7 +78,7 @@ main = hakyll $ do
posts <- recentFirst =<< loadAll "posts/*"
let indexCtx =
listField "posts" postCtx (return posts)
`mappend` defaultContext
<> defaultContext

getResourceBody
>>= applyAsTemplate indexCtx
Expand All @@ -101,11 +101,11 @@ dropIndexHtml key = mapContext transform (urlField key)
postCtx :: Context String
postCtx =
dateFieldWithZone zone "date" "%F"
`mappend` dateFieldWithZone zone "datetime" "%Y-%m-%dT%H:%M:%S%Ez"
`mappend` updateFieldWithZone zone "lastmodDate" "%F"
`mappend` updateFieldWithZone zone "lastmodDatetime" "%Y-%m-%dT%H:%M:%S%Ez"
`mappend` dropIndexHtml "url"
`mappend` defaultContext
<> dateFieldWithZone zone "datetime" "%Y-%m-%dT%H:%M:%S%Ez"
<> updateFieldWithZone zone "lastmodDate" "%F"
<> updateFieldWithZone zone "lastmodDatetime" "%Y-%m-%dT%H:%M:%S%Ez"
<> dropIndexHtml "url"
<> defaultContext
where
zone = DT.TimeZone (9 * 60) False "KST"

Expand Down

0 comments on commit 73d1b16

Please sign in to comment.