Class: Jekyll::Commands::Post::PostFileInfo

Inherits:
Jekyll::Compose::FileInfo show all
Defined in:
lib/jekyll/commands/post.rb

Instance Attribute Summary

Attributes inherited from Jekyll::Compose::FileInfo

#params

Instance Method Summary collapse

Methods inherited from Jekyll::Compose::FileInfo

#initialize

Constructor Details

This class inherits a constructor from Jekyll::Compose::FileInfo

Instance Method Details

#_date_stampObject



54
55
56
# File 'lib/jekyll/commands/post.rb', line 54

def _date_stamp
  @params.date.strftime "%Y-%m-%d"
end

#_time_stampObject



58
59
60
# File 'lib/jekyll/commands/post.rb', line 58

def _time_stamp
  @params.date.strftime("%Y-%m-%d %H:%M %z")
end

#content(custom_front_matter = {}) ⇒ Object



62
63
64
# File 'lib/jekyll/commands/post.rb', line 62

def content(custom_front_matter = {})
  super({ "date" => _time_stamp }.merge(custom_front_matter))
end

#file_nameObject



50
51
52
# File 'lib/jekyll/commands/post.rb', line 50

def file_name
  "#{_date_stamp}-#{super}"
end

#pathObject



46
47
48
# File 'lib/jekyll/commands/post.rb', line 46

def path
  "_posts/#{file_name}"
end

#resource_typeObject



42
43
44
# File 'lib/jekyll/commands/post.rb', line 42

def resource_type
  "post"
end