Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple routes for posts #49

Open
kiinoo opened this issue Aug 18, 2013 · 4 comments
Open

Multiple routes for posts #49

kiinoo opened this issue Aug 18, 2013 · 4 comments

Comments

@kiinoo
Copy link

kiinoo commented Aug 18, 2013

Is it possible to create multiple instances of peot?

What I need is to put different posts (.md or .jade) in different folders, and route them with different urls.
e.g.
'/article/:article' direct to articles in my site
'/news/:news' direct to news
'/product/:product' direct to products.

any idea?

thanks.

@jsantell
Copy link
Owner

Multiple instances are not necessary -- easiest thing to do is probably defining custom routes, like in this example, but instead of returning all of the posts, return just posts tagged with 'article', 'news', and so forth.

@jsantell
Copy link
Owner

@kiinoo did this work for you?

@kiinoo
Copy link
Author

kiinoo commented Oct 28, 2013

@jsantell
thanks for your tips. Seems there are some other problems, take below for example:

poet.addRoute('/article/:post', function (req, res) {

poet.addRoute('/news/:post', function (req, res) {

'/news/n1' can route to news 'n1' properly, but the "more link" is still 'post/n1'

@jsantell
Copy link
Owner

Hmm, looks like a readmore link issue, will check it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants