我希望修改以下代码,以便不是生成网站上最新三个帖子的链接,而是完全重现帖子的正文,就像在传统博客中一样.我在理解下面发生的事情时遇到了一些困难,以及必要的改变是什么.
match "index.html" $ do
route idRoute
compile $ do
let indexCtx = field "posts" $ \_ ->
postList $ fmap (take 3) . recentFirst
getResourceBody
>>= applyAsTemplate indexCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls
Run Code Online (Sandbox Code Playgroud)