Discussion:
[hakyll] Is it possible to have both images and markdown in the posts folder?
s***@gmail.com
2016-07-02 00:37:17 UTC
Permalink
I would like to include post-related images in the posts folder, so I tried
to use the following rules:

match "posts/*.png" $ do
route idRoute
compile copyFileCompiler

match "posts/*.markdown" $ do
route $ setExtension "html"
compile $ pandocCompiler
= loadAndApplyTemplate "templates/post.html" postCtx
= loadAndApplyTemplate "templates/default.html" postCtx
= relativizeUrls
But Hakyll doesn't like this and gives me the following error when
rebuilding the web site:

[ERROR] Hakyll.Core.Compiler.Require.load: posts/image.png (snapshot
_final) was found in the cache, but does not have the right type: expected
[Char] but got CopyFile

Is this expected behaviour, am I doing something wrong, or is this some
sort of bug?
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hakyll+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jasper Van der Jeugt
2016-07-02 20:20:32 UTC
Permalink
Hello,

The code you have is correct. From the error, I assume you probably
have some other code that loads the posts like this:

loadAll "posts/*"

If you change this to "posts/*.markdown", it should work again.

Hope this helps,
Peace,
Jasper
Post by s***@gmail.com
I would like to include post-related images in the posts folder, so I tried
match "posts/*.png" $ do
route idRoute
compile copyFileCompiler
match "posts/*.markdown" $ do
route $ setExtension "html"
compile $ pandocCompiler
= loadAndApplyTemplate "templates/post.html" postCtx
= loadAndApplyTemplate "templates/default.html" postCtx
= relativizeUrls
But Hakyll doesn't like this and gives me the following error when
[ERROR] Hakyll.Core.Compiler.Require.load: posts/image.png (snapshot
_final) was found in the cache, but does not have the right type: expected
[Char] but got CopyFile
Is this expected behaviour, am I doing something wrong, or is this some
sort of bug?
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hakyll+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...