samhuri.net/lib/pressa/views/project_view.rb
Sami Samhuri 007b1058b6
Migrate from Swift to Ruby (#33)
Replace the Swift site generator with a Ruby and Phlex implementation.
Loads site and projects from TOML, derive site metadata from posts.

Migrate from make to bake and add standardrb and code coverage tasks.

Update CI and docs to match the new workflow, and remove unused
assets/dependencies plus obsolete tooling.
2026-02-07 21:19:03 -08:00

63 lines
1.4 KiB
Ruby

require "phlex"
require "pressa/views/icons"
module Pressa
module Views
class ProjectView < Phlex::HTML
def initialize(project:, site:)
@project = project
@site = site
end
def view_template
article(class: "container project") do
h1(id: "project", data: {title: @project.title}) { @project.title }
h4 { @project.description }
div(class: "project-stats") do
p do
a(href: @project.url) { "GitHub" }
plain ""
a(id: "nstar", href: stargazers_url)
plain ""
a(id: "nfork", href: network_url)
end
p do
plain "Last updated on "
span(id: "updated")
end
end
div(class: "project-info row clearfix") do
div(class: "column half") do
h3 { "Contributors" }
div(id: "contributors")
end
div(class: "column half") do
h3 { "Languages" }
div(id: "langs")
end
end
end
div(class: "row clearfix") do
p(class: "fin") do
raw(safe(Icons.code))
end
end
end
private
def stargazers_url
"#{@project.url}/stargazers"
end
def network_url
"#{@project.url}/network/members"
end
end
end
end