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
|
||||
|
|
@ -19,13 +19,14 @@ module Pages
|
|||
},
|
||||
}
|
||||
|
||||
def initialize(page)
|
||||
def initialize(page, meta:)
|
||||
@page = page
|
||||
if @page.is_a? Symbol
|
||||
@page_info = pages[page]
|
||||
else
|
||||
@page_info = @page
|
||||
end
|
||||
@meta = meta
|
||||
end
|
||||
def view_template
|
||||
|
||||
|
@ -38,6 +39,10 @@ module Pages
|
|||
link(rel: "prefetch", href: "/DM_Mono/DMMono-Regular.ttf")
|
||||
link(rel: "prefetch", href: "/DM_Mono/DMMono-Medium.ttf")
|
||||
link(rel: "stylesheet", href: "/site.css")
|
||||
|
||||
@meta.each { |name, content|
|
||||
meta(name: name, content: content)
|
||||
}
|
||||
}
|
||||
body {
|
||||
header {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue