Class: Hikkoshi::Jekyll::Post
- Inherits:
-
Post
- Object
- Post
- Hikkoshi::Jekyll::Post
- Includes:
- Hikkoshi::Jekyll::PostProcessor::Slug, Support::TimeParser
- Defined in:
- lib/hikkoshi/jekyll/post.rb
Constant Summary collapse
- SEPARATOR =
/---\r?\n/
Instance Method Summary collapse
- #categories=(categories) ⇒ Object
- #category=(category) ⇒ Object
- #date=(date) ⇒ Object
-
#initialize(filename) ⇒ Post
constructor
A new instance of Post.
- #published=(published) ⇒ Object
- #slug=(slug) ⇒ Object
- #tags=(tags) ⇒ Object
Constructor Details
#initialize(filename) ⇒ Post
Returns a new instance of Post.
12 13 14 15 16 17 18 19 20 |
# File 'lib/hikkoshi/jekyll/post.rb', line 12 def initialize(filename) super() @filename = filename @original_metadata, @content = load_file(@filename) post_process end |
Instance Method Details
#categories=(categories) ⇒ Object
39 40 41 |
# File 'lib/hikkoshi/jekyll/post.rb', line 39 def categories=(categories) @categories += categories if categories.is_a? Array end |
#category=(category) ⇒ Object
43 44 45 |
# File 'lib/hikkoshi/jekyll/post.rb', line 43 def category=(category) @categories << category end |
#date=(date) ⇒ Object
35 36 37 |
# File 'lib/hikkoshi/jekyll/post.rb', line 35 def date=(date) @published_at = parse_time(date) end |
#published=(published) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/hikkoshi/jekyll/post.rb', line 26 def published=(published) if published == false @status = "draft" else # by default it is published @status = "published" end end |
#slug=(slug) ⇒ Object
22 23 24 |
# File 'lib/hikkoshi/jekyll/post.rb', line 22 def slug=(slug) @slug = slug end |
#tags=(tags) ⇒ Object
47 48 49 |
# File 'lib/hikkoshi/jekyll/post.rb', line 47 def () @tags += if .is_a? Array end |