Add Go module hosting
This commit is contained in:
parent
7c4208375a
commit
b42d31fa4c
3 changed files with 36 additions and 1 deletions
22
pages/gomod.rb
Normal file
22
pages/gomod.rb
Normal 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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue