lib/jekyll-titles-from-content/generator.rb
# This is a slightly modified version of Jekyll::Convertible.read_yaml
This is a slightly modified version of Jekyll::Convertible.read_yaml
This is a slightly modified version of Jekyll :: Convertible . read_yaml
def read_yaml(base, name)
      filename = File.join(base, name)
      begin
        content = File.read(filename)
        if content =~ Jekyll::Document::YAML_FRONT_MATTER_REGEXP
          content = $POSTMATCH 
          data = SafeYAML.load(Regexp.last_match(1))
        end
      rescue SyntaxError => e
        Jekyll.logger.warn "YAML Exception reading #{filename}: #{e.message}"
        raise e if site.config["strict_front_matter"]
      rescue StandardError => e
        Jekyll.logger.warn "Error reading file #{filename}: #{e.message}"
        raise e if site.config["strict_front_matter"]
      end
      data || {}
    end
def read_yaml ( base , name ) filename = File . join ( base , name ) begin content = File . read ( filename ) if content =~ Jekyll :: Document :: YAML_FRONT_MATTER_REGEXP content = $POSTMATCH data = SafeYAML . load ( Regexp . last_match ( 1 ) ) end rescue SyntaxError => e Jekyll . logger . warn "YAML Exception reading #{filename}: #{e.message}" raise e if site . config [ "strict_front_matter" ] rescue StandardError => e Jekyll . logger . warn "Error reading file #{filename}: #{e.message}" raise e if site . config [ "strict_front_matter" ] end data || { } end
This is a slightly modified version of Jekyll::Convertible.read_yaml
This is a slightly modified version of Jekyll :: Convertible . read_yaml
# rubocop:disable Lint/UselessAssignment
base
name