Class: Jekyll::GitHubMetadata::GHPMetadataGenerator

Inherits:
Jekyll::Generator
  • Object
show all
Defined in:
lib/jekyll-github-metadata/ghp_metadata_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#siteObject (readonly)

Returns the value of attribute site.



8
9
10
# File 'lib/jekyll-github-metadata/ghp_metadata_generator.rb', line 8

def site
  @site
end

Instance Method Details

#generate(site) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/jekyll-github-metadata/ghp_metadata_generator.rb', line 10

def generate(site)
  Jekyll::GitHubMetadata.log :debug, "Initializing..."
  @site = site
  site.config["github"] = github_namespace

  # Set `site.url` and `site.baseurl` if unset and in production mode.
  if Jekyll.env == "production"
    site.config["url"] ||= drop.url
    site.config["baseurl"] = drop.baseurl if site.config["baseurl"].to_s.empty?
  end

  @site = nil
end