mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
21 lines
403 B
Ruby
21 lines
403 B
Ruby
require 'phlex'
|
|
require_relative 'post_view'
|
|
|
|
module Pressa
|
|
module Views
|
|
class RecentPostsView < Phlex::HTML
|
|
def initialize(posts:, site:)
|
|
@posts = posts
|
|
@site = site
|
|
end
|
|
|
|
def view_template
|
|
div(class: 'container') do
|
|
@posts.each do |post|
|
|
render PostView.new(post:, site: @site)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|