class Jekyll::Drops::UrlDrop
Public Instance Methods
Source
# 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
Source
# File lib/jekyll/drops/url_drop.rb, line 13 def collection @obj.collection.label end
Source
# File lib/jekyll/drops/url_drop.rb, line 57 def day @obj.date.strftime("%d") end
DD: 01..31
Source
# File lib/jekyll/drops/url_drop.rb, line 62 def hour @obj.date.strftime("%H") end
hh: 00..23
Source
# File lib/jekyll/drops/url_drop.rb, line 77 def i_day @obj.date.strftime("%-d") end
D: 1..31
Source
# File lib/jekyll/drops/url_drop.rb, line 82 def i_month @obj.date.strftime("%-m") end
M: 1..12
Source
# File lib/jekyll/drops/url_drop.rb, line 124 def long_day @obj.date.strftime("%A") end
ddd: Monday..Sunday
Source
# File lib/jekyll/drops/url_drop.rb, line 92 def long_month @obj.date.strftime("%B") end
MMMM: January..December
Source
# File lib/jekyll/drops/url_drop.rb, line 67 def minute @obj.date.strftime("%M") end
mm: 00..59
Source
# File lib/jekyll/drops/url_drop.rb, line 52 def month @obj.date.strftime("%m") end
MM: 01..12
Source
# File lib/jekyll/drops/url_drop.rb, line 17 def name Utils.slugify(@obj.basename_without_ext) end
Source
# File lib/jekyll/drops/url_drop.rb, line 72 def second @obj.date.strftime("%S") end
ss: 00..59
Source
# File lib/jekyll/drops/url_drop.rb, line 119 def short_day @obj.date.strftime("%a") end
dd: Mon..Sun
Source
# File lib/jekyll/drops/url_drop.rb, line 87 def short_month @obj.date.strftime("%b") end
MMM: Jan..Dec
Source
# File lib/jekyll/drops/url_drop.rb, line 97 def short_year @obj.date.strftime("%y") end
YY: 00..99
Source
# File lib/jekyll/drops/url_drop.rb, line 26 def slug Utils.slugify(@obj.data["slug"]) || Utils.slugify(@obj.basename_without_ext) end
Source
# File lib/jekyll/drops/url_drop.rb, line 40 def slugified_categories Array(@obj.data["categories"]).each_with_object(Set.new) do |category, set| set << Utils.slugify(category.to_s) end.to_a.join("/") end
Similar to output from categories
, but each category will be downcased and all non-alphanumeric characters of the category replaced with a hyphen.
Source
# 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
Source
# File lib/jekyll/drops/url_drop.rb, line 114 def w_day @obj.date.strftime("%u") end
d: 1..7 (Monday..Sunday)
Source
# File lib/jekyll/drops/url_drop.rb, line 103 def w_year @obj.date.strftime("%G") end
CCYYw, ISO week year may differ from CCYY for the first days of January and last days of December
Source
# File lib/jekyll/drops/url_drop.rb, line 109 def week @obj.date.strftime("%V") end
WW: 01..53 %W and %U do not comply with ISO 8601-1
Source
# File lib/jekyll/drops/url_drop.rb, line 129 def y_day @obj.date.strftime("%j") end
DDD: 001..366
Source
# File lib/jekyll/drops/url_drop.rb, line 47 def year @obj.date.strftime("%Y") end
CCYY
Private Instance Methods
Source
# File lib/jekyll/drops/url_drop.rb, line 135 def fallback_data @fallback_data ||= {} end