Add Go module hosting

This commit is contained in:
Aleks Rūtiņš 2025-02-14 03:11:25 +00:00
parent 7c4208375a
commit b42d31fa4c
3 changed files with 36 additions and 1 deletions

22
pages/gomod.rb Normal file
View file

@ -0,0 +1,22 @@
class Pages::GoMod < ::Phlex::HTML
def initialize(import, repo)
@import = import
@repo = repo
end
def view_template
meta = @post[:data].front_matter
render ::Pages::Layout.new({title: meta['title']}, meta: {
"go-import" => "#{import} git #{repo}"
}) {
p {
h1 { @import }
p {
plain "This is a generated page to host the Go module located at "
a(href: repo) { repo }
plain ". You'll probably find more information about it over there."
}
}
}
end
end