I am trying to build a website with 7 pages. Each page is defined using .markdown input. On each page I want a headline with links to all the other pages.
Now this seems impossible, since Hackill 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 a recursive dependency on this fragment.
match "posts/*" $ do
route $ setExtension "html"
compile $ do
posts <- loadAll "posts/*"
let indexCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Home" `mappend`
defaultContext
pandocCompiler >>= loadAndApplyTemplate "templates/post.html" indexCtx
>>= loadAndApplyTemplate "templates/default.html" indexCtx
>>= relativizeUrls
I think the problem is that I am not allowed to match the same template on which the download is being performed.
So, how can I build a context with listField for all messages that will be used when creating messages.
I suggest that an alternative would be to first create links, save them somehow, and then include them in the posts. But how would I do that?