@@ -9,15 +9,15 @@ class Archive
99 attr_accessor :site
1010
1111 # Attributes for Liquid templates
12- ATTRIBUTES_FOR_LIQUID = %w[
12+ ATTRIBUTES_FOR_LIQUID = %w(
1313 posts
1414 type
1515 title
1616 date
1717 name
1818 path
1919 url
20- ]
20+ ) . freeze
2121
2222 # Initialize a new Archive page
2323 #
@@ -31,7 +31,7 @@ def initialize(site, title, type, posts)
3131 @posts = posts
3232 @type = type
3333 @title = title
34- @config = site . config [ ' jekyll-archives' ]
34+ @config = site . config [ " jekyll-archives" ]
3535
3636 # Generate slug if tag or category (taken from jekyll/jekyll/features/support/env.rb)
3737 if title . to_s . length
@@ -53,17 +53,17 @@ def initialize(site, title, type, posts)
5353 #
5454 # Returns the template String.
5555 def template
56- @config [ ' permalinks' ] [ type ]
56+ @config [ " permalinks" ] [ type ]
5757 end
5858
5959 # The layout to use for rendering
6060 #
6161 # Returns the layout as a String
6262 def layout
63- if @config [ ' layouts' ] && @config [ ' layouts' ] [ type ]
64- @config [ ' layouts' ] [ type ]
63+ if @config [ " layouts" ] && @config [ " layouts" ] [ type ]
64+ @config [ " layouts" ] [ type ]
6565 else
66- @config [ ' layout' ]
66+ @config [ " layout" ]
6767 end
6868 end
6969
@@ -82,12 +82,12 @@ def url_placeholders
8282 # Returns the String url.
8383 def url
8484 @url ||= URL . new ( {
85- :template => template ,
85+ :template => template ,
8686 :placeholders => url_placeholders ,
87- :permalink => nil
87+ :permalink => nil
8888 } ) . to_s
8989 rescue ArgumentError
90- raise ArgumentError . new "Template \" #{ template } \" provided is invalid."
90+ raise ArgumentError , "Template \" #{ template } \" provided is invalid."
9191 end
9292
9393 # Add any necessary layouts to this post
@@ -108,9 +108,9 @@ def render(layouts, site_payload)
108108 #
109109 # Returns the Hash representation of this Convertible.
110110 def to_liquid ( attrs = nil )
111- further_data = Hash [ ( attrs || self . class ::ATTRIBUTES_FOR_LIQUID ) . map { |attribute |
111+ further_data = Hash [ ( attrs || self . class ::ATTRIBUTES_FOR_LIQUID ) . map do |attribute |
112112 [ attribute , send ( attribute ) ]
113- } ]
113+ end ]
114114
115115 Utils . deep_merge_hashes ( data , further_data )
116116 end
@@ -130,7 +130,7 @@ def title
130130 # Returns a Date.
131131 def date
132132 if @title . is_a? Hash
133- args = @title . values . map { | s | s . to_i }
133+ args = @title . values . map ( & : to_i)
134134 Date . new ( *args )
135135 end
136136 end
@@ -150,14 +150,14 @@ def destination(dest)
150150 #
151151 # Returns the destination relative path String.
152152 def relative_path
153- path = URL . unescape_path ( url ) . gsub ( /^\/ / , '' )
153+ path = URL . unescape_path ( url ) . gsub ( /^\/ / , "" )
154154 path = File . join ( path , "index.html" ) if url =~ /\/ $/
155155 path
156156 end
157157
158158 # Returns the object as a debug String.
159159 def inspect
160- "#<Jekyll:Archive @type=#{ @type . to_s } @title=#{ @title } @data=#{ @data . inspect } >"
160+ "#<Jekyll:Archive @type=#{ @type } @title=#{ @title } @data=#{ @data . inspect } >"
161161 end
162162
163163 # Returns the Boolean of whether this Page is HTML or not.
0 commit comments