lib/siteleaf/post.rb in siteleaf-1.0.11 vs lib/siteleaf/post.rb in siteleaf-2.0.0.pre.beta1
- old
+ new
@@ -1,36 +1,11 @@
module Siteleaf
- class Post < Page
+ class Post < Content
attr_accessor :taxonomy
def create_endpoint
- "pages/#{self.parent_id}/posts"
- end
-
- def parent
- Page.find(self.parent_id)
- end
-
- def assets
- result = Client.get "posts/#{self.id}/assets"
- result.map { |r| Asset.new(r) } if result
- end
-
- def filename(posts_path = 'posts')
- paths = url.sub('/','').split('/')
- basename = "#{paths.pop}.markdown"
- path = paths.join('_')
- if path == posts_path
- if draft?
- path = 'drafts'
- else
- path = 'posts'
- date = Time.parse(published_at).strftime('%Y-%m-%d')
- basename = "#{date}-#{basename}"
- end
- end
- "_#{path}/#{basename}"
+ "sites/#{self.parent_id}/posts"
end
end
end
\ No newline at end of file