mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
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.
63 lines
1.4 KiB
Ruby
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
|