This commit is contained in:
parent
4b73564dac
commit
a4f9dadd8b
10 changed files with 58 additions and 17 deletions
|
@ -2,14 +2,17 @@ module Pages
|
|||
class Layout < ::Phlex::HTML
|
||||
def pages = {
|
||||
home: {
|
||||
as: :home,
|
||||
title: "Home",
|
||||
url: "/"
|
||||
},
|
||||
blog: {
|
||||
as: :blog,
|
||||
title: "Blog",
|
||||
url: "/blog"
|
||||
},
|
||||
about: {
|
||||
as: :about,
|
||||
title: "About",
|
||||
url: "/about"
|
||||
}
|
||||
|
@ -46,7 +49,7 @@ module Pages
|
|||
header(class: "#{@banner ? 'fixed' : 'sticky'} top-0 w-screen bg-transparent pointer-events-none flex p-3 items-center justify-center") {
|
||||
nav(class: 'flex gap-2 p-2 rounded-full border border-gray-300 bg-white/50 backdrop-blur-md pointer-events-auto') {
|
||||
pages.each { |key, page|
|
||||
a(href: page[:url], class: "block rounded-full px-3 py-1 #{key == @page ? 'bg-gray-100/50' : ''}") { page[:title] }
|
||||
a(href: page[:url], class: "block rounded-full px-3 py-1 #{key == @page_info[:as] ? 'bg-gray-100/50' : ''}") { page[:title] }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue