Skip to content

Commit

Permalink
Fix for #7, and a note for issue related to retrieving original tag v…
Browse files Browse the repository at this point in the history
…alues and not the downcased ones
  • Loading branch information
sverrirs committed Jan 24, 2017
1 parent 8382cd2 commit c779697
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/jekyll-paginate-v2/autopages/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def self.index_posts_by(all_posts, index_key)
if !index.has_key?(k_split)
index[k_split.to_s] = []
end
# TODO: Need to store the original key value here so that I can present it to the users as a page variable they can use (unmodified, e.g. tags not being 'sci-fi' but "Sci-Fi")
index[k_split.to_s] << post
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/jekyll-paginate-v2/generator/paginationIndexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def self.index_posts_by(all_posts, index_key)
end

for key in post_data
key = key.downcase.strip
key = key.to_s.downcase.strip
# If the key is a delimetered list of values
# (meaning the user didn't use an array but a string with commas)
for k_split in key.split(/;|,/)
k_split = k_split.downcase.strip #Clean whitespace and junk
k_split = k_split.to_s.downcase.strip #Clean whitespace and junk
if !index.has_key?(k_split)
index[k_split.to_s] = []
end
Expand Down Expand Up @@ -80,7 +80,7 @@ def self.read_config_value_and_filter_posts(config, config_key, posts, source_po
# Now for all filter values for the config key, let's remove all items from the posts that
# aren't common for all collections that the user wants to filter on
for key in config_value
key = key.downcase.strip
key = key.to_s.downcase.strip
posts = PaginationIndexer.intersect_arrays(posts, source_posts[key])
end

Expand Down

0 comments on commit c779697

Please sign in to comment.