hakyll

How do I avoid a dependency cycle when generating a list of recent posts on posts?

我是研究僧i 提交于 2020-01-03 09:45:34
问题 So this works: create ["archive.html"] $ do route idRoute compile $ do posts <- (myRecentFirst gitTimes) =<< loadAll "posts/**" let archiveCtx = listField "posts" (postCtx allTags allCategories gitTimes) (return posts) `mappend` constField "title" "Archives" `mappend` (postCtx allTags allCategories gitTimes) makeItem "" >>= loadAndApplyTemplate "templates/archive.html" archiveCtx >>= loadAndApplyTemplate "templates/default.html" archiveCtx >>= relativizeUrls to create a list of recent posts

Git: fatal: Pathspec is in submodule

ぃ、小莉子 提交于 2019-12-28 03:18:11
问题 I'm trying to get TravisCI to automatically deploy my Hakyll static site, according to this guide. Here's how my repo is set up. I have my source branch, which contains my hakyll and markdown files. It builds the html into the _site directory, which is set up as a submodule, linked to my master branch. I build the site without problem, then cd into the _site directory. However, when I try to git add ./* the newly generated HTML files, I get the following error: fatal: Pathspec './about.html'

Hakyll says “Dependency cycle detected: …”

五迷三道 提交于 2019-12-24 00:15:35
问题 I'm trying to construct a site with 7 pages. Each page is defined using a .markdown input. On each page I want a header with links to all the other pages. Now, this seems to be impossible since Hakyll tells me that I have a recursive dependency. [ERROR] Hakyll.Core.Runtime.chase: Dependency cycle detected: posts/page1.markdown depends on posts/page1.markdown I have identified the recursive dependency to this snippet. match "posts/*" $ do route $ setExtension "html" compile $ do posts <-

M.Map sudden expected type error

柔情痞子 提交于 2019-12-18 09:08:32
问题 Everything was working great up until about a month or so ago... Suddenly I'm getting berkson.github.io/source/blog.hs: 333, 42 • Couldn't match type ‘unordered-containers-0.2.7.1:Data.HashMap.Base.HashMap text-1.2.2.1:Data.Text.Internal.Text aeson-0.11.2.0:Data.Aeson.Types.Internal.Value’ with ‘M.Map [Char] [Char]’ Expected type: M.Map [Char] [Char] Actual type: Metadata • In the first argument of ‘(M.!)’, namely ‘md’ In the first argument of ‘(++)’, namely ‘(md M.! "author")’ In the second

What's the root of a Hakyll site?

半腔热情 提交于 2019-12-10 13:30:08
问题 I see the create function takes a list of Identifiers. ghci λ> :t create create :: [Identifier] -> Rules () -> Rules () What list of identifier should I use to match the root of the site? Eg, I just want to make a single html page that appears on "www.example.com" without "/posts" or "/archives" or any other domain parts. I've tried a few: create "/" $ do route idRoute compile $ pandocCompiler >>= loadAndApplyTemplate "templates/default.html" defaultContext >>= relativizeUrls and create "/*"

Git: fatal: Pathspec is in submodule

耗尽温柔 提交于 2019-11-27 10:21:54
I'm trying to get TravisCI to automatically deploy my Hakyll static site, according to this guide . Here's how my repo is set up. I have my source branch, which contains my hakyll and markdown files. It builds the html into the _site directory, which is set up as a submodule, linked to my master branch. I build the site without problem, then cd into the _site directory. However, when I try to git add ./* the newly generated HTML files, I get the following error: fatal: Pathspec './about.html' is in submodule '_site' When I try git add --all , I get this error: git: pathspec.c:317: prefix