lib/yarrow/content/collection_expander.rb
# Extract collection level configuration/metadata from the root node for
# this content type.
Extract collection level configuration/metadata from the root node for
this content type.
Extract collection level configuration / metadata from the root node for this content type .
def extract_metadata(node, type)
        meta_file = node.out(slug: type.to_s).first
        if meta_file
          body, data = process_content(meta_file.props[:entry])
        else
          data = {}
        end
        unless data.key?(:title)
          data[:title] = type.to_s.capitalize
        end
        data
      end
def extract_metadata ( node , type ) meta_file = node . out ( slug : type . to_s ) . first if meta_file body , data = process_content ( meta_file . props [ :entry ] ) else data = { } end unless data . key? ( :title ) data [ :title ] = type . to_s . capitalize end data end
Extract collection level configuration/metadata from the root node for
this content type.
Extract collection level configuration / metadata from the root node for this content type .
# TODO: support _index or _slug convention as well # Process metadata and add it to the collection node # TODO: pass in content converter object # TODO: index/body content by default if extracted from frontmatter # Otherwise, assume default collection behaviour # Generate a default title if not provided in metadata
node
<not_specific>
type
<not_specific>