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

Fix category path when placed on root #1526

Closed
wants to merge 3 commits into from
Closed

Fix category path when placed on root #1526

wants to merge 3 commits into from

Conversation

giuseppelt
Copy link
Contributor

This patch fixes the double slashes (i.e. http://site.com//cat1) in the category path, when you configure category_dir with '/' or ''

This patch fixes the double slashes (http://site.com//cat1) in the category path, when you configure `category_dir` with '/' or ''
@@ -30,7 +30,8 @@ module.exports = function(ctx) {

Category.virtual('path').get(function() {
var catDir = ctx.config.category_dir;
if (catDir[catDir.length - 1] !== '/') catDir += '/';
if (catDir === '/') catDir = '';
if (catDir.length > 0 && catDir[catDir.length - 1] !== '/') catDir += '/';
Copy link
Member

Choose a reason for hiding this comment

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

catDir.length > 0 can be catDir.length.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what you mean? I know the evaluation is the same, I used explicit comparison for better reading.
Have I remove > 0? If Y, no prob.

Copy link
Contributor

Choose a reason for hiding this comment

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

Look like to keep code style?

@kbaley
Copy link

kbaley commented Dec 18, 2015

Wondering when this will be merged. We're looking to go live with a site we've converted from Jekyll and we need this to match our existing URLs.

@leesei
Copy link
Member

leesei commented Feb 20, 2016

Sorry we are a bit slow in merging the PR.
Please use npm install your own repo for your release.

@leesei
Copy link
Member

leesei commented Feb 20, 2016

Merged via 9aca27b.
Thanks.

@leesei leesei closed this Feb 20, 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.

5 participants