小编pga*_*gay的帖子

修改Hakyll示例站点

我希望修改以下代码,以便不是生成网站上最新三个帖子的链接,而是完全重现帖子的正文,就像在传统博客中一样.我在理解下面发生的事情时遇到了一些困难,以及必要的改变是什么.

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)

blogs haskell web hakyll

6
推荐指数
1
解决办法
592
查看次数

标签 统计

blogs ×1

hakyll ×1

haskell ×1

web ×1