samhuri.net/lib/pressa/projects/models.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

22 lines
429 B
Ruby

require "dry-struct"
require "pressa/site"
module Pressa
module Projects
class Project < Dry::Struct
attribute :name, Types::String
attribute :title, Types::String
attribute :description, Types::String
attribute :url, Types::String
def github_path
uri = URI.parse(url)
uri.path.sub(/^\//, "")
end
def path
"/projects/#{name}"
end
end
end
end