Question about processing list of files twice

39 views
Skip to first unread message

David J. Weller-Fahy

unread,
Jan 15, 2013, 10:48:35 PM1/15/13
to hak...@googlegroups.com
I'm trying to get my index.md files to copy without processing as well
as being used to build the index.html files.

My most recent attempt was to create the following.

#+
-- Render posts
match "posts/*/*/*/*/*.md" $ do
route $ setExtension ".html"
compile $ pageCompiler
>>> arr(renderDateField "formatteddate"
"%Y-%m-%d %H:%M" "Unknown Date")
>>> applyTemplateCompiler "templates/post.html"
>>> applyTemplateCompiler "templates/default.html"
>>> relativizeUrlsCompiler
>>> removeIndex'

-- Copy posts' source
match "posts/*/*/*/*/*.md" $ do
route $ idRoute
compile $ copyFileCompiler
#-

This didn't work (the second match never triggered), although the
website was created.

To be clear, if I have a single index.md file in the root. I would
expect there to be an index.html and index.md file in _site/ after
rebuilding the site if this were to work properly. So, can anyone give
me a clue how to do this? I'm still working through the haskell
tutorials, but I'm not done yet.

Regards,
--
dave [ please don't CC me ]

David J. Weller-Fahy

unread,
Jan 15, 2013, 10:53:03 PM1/15/13
to hak...@googlegroups.com
* David J. Weller-Fahy <dave-lis...@weller-fahy.com> [2013-01-15 22:49 -0500]:
> I'm trying to get my index.md files to copy without processing as well
> as being used to build the index.html files.

Note: I just found this URL [1].

[1]: https://groups.google.com/forum/?fromgroups=#!topic/hakyll/OZpggt3SaBw

Which makes it clear this can be done in Hakyll 4, and narrows my
question: Is there a way to do this in Hakyll 3?

Jasper Van der Jeugt

unread,
Jan 16, 2013, 4:55:13 AM1/16/13
to hakyll
Hello,

This approach should work:

https://groups.google.com/forum/#!msg/hakyll/vQpijNtTG5M/5xyi6EtERcUJ

Peace,
Jasper

David J. Weller-Fahy

unread,
Jan 16, 2013, 8:21:09 PM1/16/13
to hakyll
* Jasper Van der Jeugt <m...@jaspervdj.be> [2013-01-16 04:56 -0500]:
> > * David J. Weller-Fahy <dave-lis...@weller-fahy.com> [2013-01-15 22:49 -0500]:
> >> I'm trying to get my index.md files to copy without processing as well
> >> as being used to build the index.html files.
> >
Hrm... it compiles fine, but adding that simply gave me the following
error on rebuild:

#v+
[ ERROR] Hakyll.Core.Compiler.getDependency:
posts/1998/02/21/Land_o_clay/index.md (raw) was found in the cache, but
does not have the right type: expected Page [Char] but got CopyFile
#v-

Odd... however, given that you've released Hakyll 4, and I know this can
be done using that, I believe I'll simply upgrade to Hakyll 4 and ignore
this.

If you do want me to try something else (if this is a problem and not
just me doing something wrong) to narrow this down, then let me know.

Thank you!
Reply all
Reply to author
Forward
0 new messages