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

Projects
None yet
2 participants
@jjk-jacky
Copy link
Contributor

jjk-jacky commented Jun 3, 2016

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

PermalinkGenerator: Keep title_path as-is with preserve_title_path
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'];

This comment has been minimized.

@yosymfony

yosymfony Jun 4, 2016

Member

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

This comment has been minimized.

@jjk-jacky

jjk-jacky Jun 4, 2016

Contributor

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

This comment has been minimized.

Copy link
Member

yosymfony commented Jun 4, 2016

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

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

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