lib/awestruct/handlers/asciidoctor_handler.rb in awestruct-0.5.0.cr vs lib/awestruct/handlers/asciidoctor_handler.rb in awestruct-0.5.0
- old
+ new
@@ -53,10 +53,13 @@
types = [String, Numeric, TrueClass, FalseClass, Array]
@front_matter.merge!(context.page.inject({}) do |hash, (k,v)|
hash[k.to_s] = v if not k.to_s.start_with?('__') and types.detect { |t| v.kind_of? t }
hash
end)
+ if with_layouts && !context.page.layout
+ @front_matter['header_footer'] = true
+ end
super
end
def options
opts = super
@@ -65,9 +68,12 @@
else
opts[:attributes] = opts[:attributes].merge @front_matter
end
opts[:attributes]['awestruct'] = true
opts[:attributes]['awestruct-version'] = Awestruct::VERSION
+ if @front_matter['header_footer']
+ opts[:header_footer] = true
+ end
opts
end
def content_line_offset
parse_header()