Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve routing #100
Here's a bunch of improvements to content routing that I find useful.
1. Blog index
I want my index.html to be a static page and, if I do so now, the first page of the numeric index gets overwritten. This is because coleslaw creates a symlink from index.html to the first page of the numeric index. This change allows you to specify a custom name or
2. Point the blog index to the first page of the numeric index irrespective of the routing settings
This fixes the bug where the code assumes that the first page of the numeric index is always called
3. Allow for lambdas in routing settings
I really like having something like this:
:routing ((:post (lambda (document) (format nil "posts/~a-~a" (subseq (coleslaw:date-of document) 0 7) (coleslaw:slugify (coleslaw:title-of document))))) (:tag-index "tag/~a") (:month-index "date/~a") (:numeric-index "post-index-~d") (:feed "~a.xml") (:tag-feed "tag/~a.xml"))
This is interesting (and good functionality) but I'm wondering about better solutions to two issues:
A) The fact that we give numeric indexes special treatment in the first place. (E.g. instead of having a
I'm going to spend a little time thinking about these. Thanks for sparking this discussion.
a) I am not sure what you mean. I think it's pretty good the way it is, because it gives you quite a bit of flexibility in defining the layout of the rendered result. I don't really see how you could unify the routes and not pay the cost of limiting the flexibility.
b) Well, you could use either functions or templates (I mean something like: