samhuri.net/pressa/lib/views/projects_view.rb

29 lines
657 B
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

require 'phlex'
module Pressa
module Views
class ProjectsView < Phlex::HTML
def initialize(projects:, site:)
@projects = projects
@site = site
end
def view_template
article(class: "projects") do
h1 { "Projects" }
p { "Open source projects I've created or contributed to." }
ul(class: "projects-list") do
@projects.each do |project|
li do
a(href: @site.url_for(project.path)) { project.title }
plain " #{project.description}"
end
end
end
end
end
end
end
end