diff --git a/jekyll-ga.rb b/jekyll-ga.rb index 0baaed4..5442ee0 100644 --- a/jekyll-ga.rb +++ b/jekyll-ga.rb @@ -52,8 +52,15 @@ def generate(site) results = Hash[response.data.rows] site.posts.each { |post| - if results[post.url + '/'] - 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?('/') + url = post.url + 'index' + else + url = post.url + end + if results[url] + post.data.merge!("_ga" => results[url].to_i) end } end