jsantell / poet

A node.js blog engine
jsantell.github.io/poet
MIT License
605 stars 146 forks source link

Post title for display vs for URL? #100

Open protobi opened 10 years ago

protobi commented 10 years ago

Crossposting here from StackOverflow. New to Poet, the post title is not behaving as I'd expect from the example.

I expect that if a post were in the file hello.md and had the configuration {{{ title: 'hello-world', ...}}} that this would be available at the route http://hostname/post/hello and have the display render the title to the reader as <h1>hello-world</h1>. That's the way it seems to be working in the reference blog, e.g.:

However, in my case it seems to be using the title attribute for both the URL and the display string. In my case, the post is accessible only at http://hostname/posts/hello-world and the page title is also rendered as <h1>hello-world</h1>.

What might I be doing wrong?

jsantell commented 10 years ago

The url is generated from either the slug property, or the title, updated in 73712ba1d73de68c48a7ffef9120cc93e69dd372 from back in January in 1.0.0rc4 -- so that'll fix the issue (so there's no coupling with filename and url). Leaving this open to update the docs

protobi commented 10 years ago

Perfect, thanks so much! The aha for me:

So without the slug property, the slug would be "this-is-the-title-I-want"

jsantell commented 10 years ago

Hmm it should also convert to lowercase, I'll make a separate bug for that -- thanks for the report!