Sha256: b2a799e2138f637701811700c101749db5888b4bd3d47dcc4bb8c23fac769026

Contents?: true

Size: 708 Bytes

Versions: 38

Compression:

Stored size: 708 Bytes

Contents

# frozen_string_literal: true

module Example
	class LayoutComponent < Phlex::HTML
		def initialize(title: "Example")
			@title = title
		end

		def template(&block)
			html do
				head do
					title { @title }
					meta name: "viewport", content: "width=device-width,initial-scale=1"
					link href: "/assets/tailwind.css", rel: "stylesheet"
				end

				body class: "bg-zinc-100" do
					nav class: "p-5", id: "main_nav" do
						ul do
							li(class: "p-5") { a(href: "/") { "Home" } }
							li(class: "p-5") { a(href: "/about") { "About" } }
							li(class: "p-5") { a(href: "/contact") { "Contact" } }
						end
					end

					div class: "container mx-auto p-5", &block
				end
			end
		end
	end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
phlex-1.4.2 fixtures/layout.rb
phlex-1.5.3 fixtures/layout.rb
phlex-1.6.3 fixtures/layout.rb
phlex-1.7.2 fixtures/layout.rb
phlex-1.8.3 fixtures/layout.rb
phlex-1.9.2 fixtures/layout.rb
phlex-1.0.1 fixtures/layout.rb
phlex-1.1.1 fixtures/layout.rb
phlex-1.2.2 fixtures/layout.rb
phlex-1.3.3 fixtures/layout.rb
phlex-1.4.1 fixtures/layout.rb
phlex-1.5.2 fixtures/layout.rb
phlex-1.6.2 fixtures/layout.rb
phlex-1.7.1 fixtures/layout.rb
phlex-1.8.2 fixtures/layout.rb
phlex-1.9.1 fixtures/layout.rb
phlex-1.9.0 fixtures/layout.rb
phlex-1.8.1 fixtures/layout.rb
phlex-1.8.0 fixtures/layout.rb
phlex-1.7.0 fixtures/layout.rb