Skip to content

Commit ca98dcc

Browse files
committed
Fix up attributes
1 parent 90bc1d4 commit ca98dcc

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lib/jekyll-archives.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ def read
5454

5555
def read_tags
5656
if enabled? "tags"
57-
tags.each do |name, posts|
58-
@archives << Archive.new(@site, name, "tag", posts)
57+
tags.each do |title, posts|
58+
@archives << Archive.new(@site, title, "tag", posts)
5959
end
6060
end
6161
end
6262

6363
def read_categories
6464
if enabled? "categories"
65-
categories.each do |name, posts|
66-
@archives << Archive.new(@site, name, "category", posts)
65+
categories.each do |title, posts|
66+
@archives << Archive.new(@site, title, "category", posts)
6767
end
6868
end
6969
end

lib/jekyll-archives/archive.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class Archive
1111
ATTRIBUTES_FOR_LIQUID = %w[
1212
posts
1313
title
14+
name
1415
type
1516
]
1617

@@ -35,8 +36,9 @@ def initialize(site, title, type, posts)
3536
end
3637

3738
# Use ".html" for file extension and url for path
38-
@ext = ".html"
39-
@name = @path = url
39+
@ext = File.extname(destination('/'))
40+
@path = url
41+
@name = File.basename(destination('/'), @ext)
4042

4143
@data = {
4244
"layout" => site.config['jekyll-archives']['layout']

0 commit comments

Comments
 (0)