Sha256: 31e245abb577b712eab84e54110113a70df921ff2cee7b75f202f10b038ecd33

Contents?: true

Size: 327 Bytes

Versions: 3

Compression:

Stored size: 327 Bytes

Contents

# Returns all blog posts contained in this directory. We assume
# that a blog post is any page object that has a date set.
#
def blog_posts
  siblings
    .select { |p| blog_post?(p) }
    .sort_by(&:date)
    .reverse
end

# Checks if a specific node is a blog post.
#
def blog_post?(node)
  node.page? && !node.date.nil?
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flutterby-0.5.0 lib/templates/new_project/site/blog/_view.rb
flutterby-0.4.0 lib/templates/new_project/site/blog/_view.rb
flutterby-0.3.1 lib/templates/new_project/site/blog/_view.rb