Skip to content

Commit 8e483d3

Browse files
committed
Fix read method
1 parent a557af8 commit 8e483d3

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lib/jekyll-archives.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ def generate(site)
4444

4545
# Read archive data from posts
4646
def read
47-
tags.each do |tag|
48-
@archives << Archive.new(@site, tag[1], "tag", tag[0])
47+
tags.each do |name, posts|
48+
@archives << Archive.new(@site, name, "tag", posts)
4949
end
50-
categories.each do |category|
51-
@archives << Archive.new(@site, category[1], "category", category[0])
50+
categories.each do |name, posts|
51+
@archives << Archive.new(@site, name, "category", posts)
5252
end
53-
years.each do |year|
54-
@archives << Archive.new(@site, year[1], "year", year[0])
53+
years.each do |name, posts|
54+
@archives << Archive.new(@site, name, "year", posts)
5555
end
5656
end
5757

lib/jekyll-archives/archive.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ class Archive
1717
# Initialize a new Archive page
1818
#
1919
# site - The Site object.
20-
# posts - The array of posts that belong in this archive.
21-
# type - The type of archive. Can be one of "year", "category", or "tag"
2220
# name - The name of the archive (e.g. "2014" or "my-category" or "my-tag").
23-
def initialize(site, posts, type, name)
21+
# type - The type of archive. Can be one of "year", "category", or "tag"
22+
# posts - The array of posts that belong in this archive.
23+
def initialize(site, name, type, posts)
2424
@site = site
2525
@posts = posts
2626
@type = type

0 commit comments

Comments
 (0)