Discussion:
[hakyll] Couldn't load html files
Yun-Yan Chi
2016-04-01 01:14:57 UTC
Permalink
Hi,

I have some html files (my slides actually) I'd like to load into hakyll.
So I've tried something like this,

create ["slides.html"] $ do
route idRoute
compile $ do
ss <- loadAll "slides/*.html" :: Compiler [Item String]
let archiveCtx = constField "plpl" (show $ length ss) <>
defaultContext
makeItem ""
= loadAndApplyTemplate "templates/slideList.html"
archiveCtx
= loadAndApplyTemplate "templates/default.html"
defaultContext
= relativizeUrls
But, it doesn't work... p_q
The `ss` is always an empty list.
What did i do wrong?
Is there a better way for loading html files?
Or, is there a better way to create a list for html files?

Thanks,
Jaiyalas
--
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-04-01 12:04:56 UTC
Permalink
Hi Yun-Yan,

The loading code looks correct to me, so I'm not really sure what is
going wrong. Is the full repository available anywhere, so I can
reproduce the problem?

Peace,
Jasper
Post by Yun-Yan Chi
Hi,
I have some html files (my slides actually) I'd like to load into hakyll.
So I've tried something like this,
create ["slides.html"] $ do
route idRoute
compile $ do
ss <- loadAll "slides/*.html" :: Compiler [Item String]
let archiveCtx = constField "plpl" (show $ length ss) <>
defaultContext
makeItem ""
= loadAndApplyTemplate "templates/slideList.html"
archiveCtx
= loadAndApplyTemplate "templates/default.html"
defaultContext
= relativizeUrls
But, it doesn't work... p_q
The `ss` is always an empty list.
What did i do wrong?
Is there a better way for loading html files?
Or, is there a better way to create a list for html files?
Thanks,
Jaiyalas
--
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.
k***@eunchan.net
2016-05-11 07:28:10 UTC
Permalink
Hi Yun-Yan,

I think somewhere else in the code, it should reads all the html files
under slide directory like below:

match "slides/*.html" $ compile getResourceBody


Regards,
Eunchan
Post by Yun-Yan Chi
Hi,
I have some html files (my slides actually) I'd like to load into hakyll.
So I've tried something like this,
create ["slides.html"] $ do
route idRoute
compile $ do
ss <- loadAll "slides/*.html" :: Compiler [Item String]
let archiveCtx = constField "plpl" (show $ length ss) <>
defaultContext
makeItem ""
= loadAndApplyTemplate "templates/slideList.html"
archiveCtx
= loadAndApplyTemplate "templates/default.html"
defaultContext
= relativizeUrls
But, it doesn't work... p_q
The `ss` is always an empty list.
What did i do wrong?
Is there a better way for loading html files?
Or, is there a better way to create a list for html files?
Thanks,
Jaiyalas
--
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...