Greg
unread,Oct 4, 2010, 11:53:30 PM10/4/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to hakyll
I really like the capabilities that hakyll brings- creating static
sites with all the logic in the configuration file and nothing more
than simple variable substitution in the templating. But I am going to
keep complaining about the things I don't like :)
On my blog I would like to render a sidebar on each page that is
equivalent to the post listing on the index page
let renderSite template = renderChain (template:["templates/
default.html.hamlet"]) . withSidebar
That looks great!
let withSidebar = flip combine $ do
let list = createPostListing "dummy" (take 3
renderablePosts) [("title", Left "Recent Posts")]
let sidebar = renderAndConcat ["sidebar.html.hamlet"] [list]
createCustomPage "dummy" [("sidebar", Right sidebar)]
where
createPostListing url posts values =
createListing url ["templates/postitem.html.hamlet"] posts
values
Now I have 2 instance of "dummy" in one function, which makes me feel
like a dummy. Also I am using renderAndConcat which takes lits to
render multiple templates, but I only need to render one.
It is very possible that I still don't understand how hakyll is
supposed to be used. From my limited understanding, it seems that
hakyll works great for rendering templates into pages, but does not
work very easily for rendering "partials"- templates that will be
included into other templates.
My config file is dangerously close to violating Hakyll philosophy- it
is at 99 lines! Perhaps some partial rendering tools could help this
out.