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

decide right post url by permalink format #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

decide right post url by permalink format #1

wants to merge 1 commit into from

Conversation

jhshi
Copy link

@jhshi jhshi commented May 4, 2013

Try to figure out the proper url format by site.confi['permalink']. May need further polish.

Reference:
Jekyll permalink schema

@dhcole
Copy link
Contributor

dhcole commented May 20, 2013

I think post.url should already take into account configuration level permalink settings: https://github.com/mojombo/jekyll/blob/master/lib/jekyll/post.rb#L206

Are you not seeing that work correctly?

post.data.merge!("_ga" => results[post.url + '/'].to_i)
if site.config['permalink'] == 'pretty' || site.config['permalink'].end_with?('/')
url = post.url + 'index.html'
elsif !site.confi['permalink'].end_with?('/')
Copy link
Author

Choose a reason for hiding this comment

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

typo: confi->config

@jhshi
Copy link
Author

jhshi commented May 20, 2013

According to the code, When permalink is set, post.url is set to permalink, which is not necessarily the final url.

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.

2 participants