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



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

def _date_stamp
  @params.date.strftime Jekyll::Compose::DEFAULT_DATESTAMP_FORMAT
end

#_time_stampObject



65
66
67
# File 'lib/jekyll/commands/post.rb', line 65

def _time_stamp
  @params.date.strftime @params.timestamp_format
end

#content(custom_front_matter = {}) ⇒ Object



69
70
71
72
73
74
# File 'lib/jekyll/commands/post.rb', line 69

def content(custom_front_matter = {})
  default_front_matter = front_matter_defaults_for("posts")
  custom_front_matter.merge!(default_front_matter) if default_front_matter.is_a?(Hash)

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

#file_nameObject



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

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

#pathObject



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

def path
  "_posts/#{file_name}"
end

#resource_typeObject



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

def resource_type
  "post"
end