Sha256: 86ac1362615ffe5222080bf5f0435209f04814e0cb0dd1183b7baa4c7aa391c5

Contents?: true

Size: 666 Bytes

Versions: 1

Compression:

Stored size: 666 Bytes

Contents

# frozen_string_literal: true

module Layouts
  class Site < Layout
    include Phlex::DeferredRender

    def view_template
      doctype
      html lang: "en", data: { theme: "onedark" } do
        render Layouts::Head.new(&head)

        body do
          render UI::Navbar.new(class: css[:navbar])
          main(class: css[:main], &content)
          render UI::Footer.new(class: css[:footer])
        end
      end
    end

    def with_head(&block)
      @head = block
    end

    def with_content(&block)
      @content = block
    end

    private

    def content
      @content || proc { }
    end

    def head
      @head || proc { }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
staticky-0.2.0 site_template/app/views/layouts/site.rb