Initial import
This commit is contained in:
commit
4cc4e303ab
44 changed files with 691 additions and 0 deletions
20
example/app/posts.rb
Normal file
20
example/app/posts.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require "nokogiri"
|
||||
require "ace/filters"
|
||||
|
||||
# Inheritted methods:
|
||||
# - content
|
||||
# - metadata
|
||||
# - config
|
||||
class Post < Ace::Item
|
||||
before Ace::LayoutFilter, layout: "post.html"
|
||||
|
||||
def document
|
||||
Nokogiri::HTML(self.content)
|
||||
end
|
||||
|
||||
def excerpt
|
||||
self.document.css("p.excerpt")
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue