Postleaf / postleaf

Simple, beautiful publishing with Node.js.
https://www.postleaf.org/
MIT License
505 stars 204 forks source link

Special slug/url for posts #67

Open heykaley opened 6 years ago

heykaley commented 6 years ago

Hi,

I love the work you put in so far. There's one thing that I am still missing though. Currently all posts and pages can get a slug e.g. domain.tld/post-name or domain.tld/page-name. It would be great if all posts would go under domain.tld/post/post-name and pages would stay with domain.tld/page-name. It would be even greater if I had the possibility to adjust the parameter for posts (so instead of domain.tld/post/post-name I could go for domain.tld/magazine/post-name). Allowing "/" in slugs would be a simple solution for now (maybe with automatically adding /post/ before /post-name/).

I hope you get the idea. Sorry, it's late and I'm German haha.

Best regards, Kaléy.

claviska commented 6 years ago

I like this idea, and I don't think it would be too difficult to implement. Separating posts from pages is the logical thing to do and for some reason it flew under my radar until you mentioned it.

There's already a slug setting for the blog in .env so we can just tap into that.

Off the top of my head, here's what needs to be done:

There might be more after diving in, but should be pretty straight forward. I'd gladly accept a PR if you're up for the task and want a faster turn around.