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

Add new permalink param: post_title #1258

Merged
merged 1 commit into from
May 7, 2015

Conversation

nt3rp
Copy link
Contributor

@nt3rp nt3rp commented May 6, 2015

To avoid breaking any existing setups, create a new param which represents the title of a post.

Also, addresses #881 (as far as the problem I described there)

To avoid breaking any existing setups, create a new param which represents the title of a post.
@@ -13,6 +13,7 @@ function postPermalinkFilter(data){
id: data.id || data._id,
title: data.slug,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the proper fix would be to change this line, to this:

title: util.slugize(data.title, {transform: 1}),

... but that could break existing setups 😞

@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.41% when pulling 054b2b4 on nt3rp:permalink_postname into eff1429 on hexojs:master.

@tommy351
Copy link
Member

tommy351 commented May 7, 2015

What's different between slug and post_title?

@nt3rp
Copy link
Contributor Author

nt3rp commented May 7, 2015

From my understanding, slug in the permalink is equivalent to new_post_name minus the file extension. post_title is the slugized version of the actual post title.

The problem mostly arises in cases like #881.

@tommy351
Copy link
Member

tommy351 commented May 7, 2015

I see.

tommy351 added a commit that referenced this pull request May 7, 2015
Add new permalink param: `post_title`
@tommy351 tommy351 merged commit d531c10 into hexojs:master May 7, 2015
@leesei leesei mentioned this pull request Mar 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants