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

PermalinkGenerator: Keep title_path as-is with preserve_title_path #90

Merged
merged 1 commit into from Jun 5, 2016

Conversation

jjk-jacky
Copy link
Contributor

This ensures e.g. dots are kept (instead of replaced with dashes) and case is
preserved.

This ensures e.g. dots are kept (instead of replaced with dashes) and case is
preserved.
@@ -226,7 +226,7 @@ private function getTitleSlugified(ItemInterface $item)
$preservePathTitle = $this->getPreservePathTitleAttribute($item);

if ($preservePathTitle === true && isset($attributes['title_path']) === true) {
return (new StringWrapper($attributes['title_path']))->slug();
return $attributes['title_path'];
Copy link
Member

@yosymfony yosymfony Jun 4, 2016

Choose a reason for hiding this comment

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

In this case, if you are using certain characters such as spaces, you'll get a bad permalink but I understand that if you turn on preserve_title_path feature is because you want to preserver the title from the path and it is under your risk

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, well then maybe use urlencode() instead of slug(), so e.g.
spaces are turned to %20 and such, to try and ensure good/valid URLs,
but nothing else.

@yosymfony
Copy link
Member

I'll update the documentation of this attribute in http://spress.yosymfony.com/docs/writing-posts/

@yosymfony yosymfony merged commit aadeddb into spress:master Jun 5, 2016
yosymfony added a commit that referenced this pull request Jun 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants