Class: Jekyll::Drops::UrlDrop
- Inherits:
-
Drop
- Object
- Liquid::Drop
- Drop
- Jekyll::Drops::UrlDrop
show all
- Extended by:
- Forwardable
- Defined in:
- lib/jekyll/drops/url_drop.rb
Constant Summary
Constants inherited
from Drop
Drop::NON_CONTENT_METHODS
Instance Method Summary
collapse
Methods inherited from Drop
#[], #[]=, #content_methods, #each_key, #initialize, #inspect, #key?, #keys, #merge, #merge!, mutable, mutable?, #to_h
Instance Method Details
#categories ⇒ Object
30
31
32
33
34
35
36
|
# File 'lib/jekyll/drops/url_drop.rb', line 30
def categories
category_set = Set.new
Array(@obj.data['categories']).each do |category|
category_set << category.to_s.downcase
end
category_set.to_a.join('/')
end
|
#collection ⇒ Object
13
14
15
|
# File 'lib/jekyll/drops/url_drop.rb', line 13
def collection
@obj.collection.label
end
|
#day ⇒ Object
46
47
48
|
# File 'lib/jekyll/drops/url_drop.rb', line 46
def day
@obj.date.strftime("%d")
end
|
#hour ⇒ Object
50
51
52
|
# File 'lib/jekyll/drops/url_drop.rb', line 50
def hour
@obj.date.strftime("%H")
end
|
#i_day ⇒ Object
62
63
64
|
# File 'lib/jekyll/drops/url_drop.rb', line 62
def i_day
@obj.date.strftime("%-d")
end
|
#i_month ⇒ Object
66
67
68
|
# File 'lib/jekyll/drops/url_drop.rb', line 66
def i_month
@obj.date.strftime("%-m")
end
|
#minute ⇒ Object
54
55
56
|
# File 'lib/jekyll/drops/url_drop.rb', line 54
def minute
@obj.date.strftime("%M")
end
|
#month ⇒ Object
42
43
44
|
# File 'lib/jekyll/drops/url_drop.rb', line 42
def month
@obj.date.strftime("%m")
end
|
#name ⇒ Object
17
18
19
|
# File 'lib/jekyll/drops/url_drop.rb', line 17
def name
Utils.slugify(@obj.basename_without_ext)
end
|
#second ⇒ Object
58
59
60
|
# File 'lib/jekyll/drops/url_drop.rb', line 58
def second
@obj.date.strftime("%S")
end
|
#short_month ⇒ Object
70
71
72
|
# File 'lib/jekyll/drops/url_drop.rb', line 70
def short_month
@obj.date.strftime("%b")
end
|
#short_year ⇒ Object
74
75
76
|
# File 'lib/jekyll/drops/url_drop.rb', line 74
def short_year
@obj.date.strftime("%y")
end
|
#slug ⇒ Object
26
27
28
|
# File 'lib/jekyll/drops/url_drop.rb', line 26
def slug
Utils.slugify(@obj.data['slug']) || Utils.slugify(@obj.basename_without_ext)
end
|
#title ⇒ Object
21
22
23
24
|
# File 'lib/jekyll/drops/url_drop.rb', line 21
def title
Utils.slugify(@obj.data['slug'], :mode => "pretty", :cased => true) ||
Utils.slugify(@obj.basename_without_ext, :mode => "pretty", :cased => true)
end
|
#y_day ⇒ Object
78
79
80
|
# File 'lib/jekyll/drops/url_drop.rb', line 78
def y_day
@obj.date.strftime("%j")
end
|
#year ⇒ Object
38
39
40
|
# File 'lib/jekyll/drops/url_drop.rb', line 38
def year
@obj.date.strftime("%Y")
end
|