Class: Jekyll::Scholar::DetailsGenerator

Inherits:
Generator
  • Object
show all
Includes:
Utilities
Defined in:
lib/jekyll/scholar/generators/details.rb

Instance Attribute Summary collapse

Attributes included from Utilities

#bibtex_file, #context, #query, #site

Instance Method Summary collapse

Methods included from Utilities

#base_url, #bibliography, #bibtex_options, #bibtex_path, #cite, #cite_details, #cited_references, #content_tag, #details_file_for, #details_link_for, #details_path, #entries, #extend_path, #generate_details?, #link_to, #set_context_to

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config


43
44
45
# File 'lib/jekyll/scholar/generators/details.rb', line 43

def config
  @config
end

Instance Method Details

#generate(site) ⇒ Object


45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/jekyll/scholar/generators/details.rb', line 45

def generate(site)
  @site, @config = site, Scholar.defaults.merge(site.config['scholar'] || {})

  if generate_details?
    entries.each do |entry|
      details = Details.new(site, site.source, File.join('', details_path), entry)
      details.render(site.layouts, site.site_payload)
      details.write(site.dest)

      site.pages << details
    end

  end
end