Blog Post without /post/ slug ?

42 views
Skip to first unread message

akun...@gmail.com

unread,
Jun 11, 2014, 6:01:59 AM6/11/14
to keyst...@googlegroups.com
Hi all, i'm trying to get my blog posts without /post/ slug in keystone.
I mean like http://domain.com/blog/my-post without having /post slug befor /mypost.

Can anyone give me an example how can i do that in keyston routes, views & .jade template?
Thanks ini advance.

Zuzanna Wolnik

unread,
Jun 11, 2014, 6:19:50 AM6/11/14
to keyst...@googlegroups.com
Hi, I'm not an expert (yet! ;) ), but I would try to do it similar to category route.
so instead of this in index.js:

app.get('/blog/:category?', routes.views.blog);
 app
.get('/blog/post/:post', routes.views.post);

I would put

app.get('/blog/:category?', routes.views.blog);
app.get('/blog/:post?', routes.views.post);

but I'm not sure, would have to try it :)

akun...@gmail.com

unread,
Jun 11, 2014, 6:36:55 AM6/11/14
to keyst...@googlegroups.com
I do that already, but it wasn't that simple.
I should modify the blog.js views & blog.jade template which is "still" looks so complicated for me :)
I'll try it again & give some result.
Reply all
Reply to author
Forward
0 new messages