Sha256: 6f2b8b8ddd051cd59752897245ab1961c4f253eb9baf56fff13dcaf44ab498ca

Contents?: true

Size: 664 Bytes

Versions: 1

Compression:

Stored size: 664 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.1.1 site_template/app/views/layouts/site.rb