Class: Octopress::AssetPipeline::Plugin

Inherits:
Ink::Plugin
  • Object
show all
Defined in:
lib/octopress-asset-pipeline.rb

Instance Method Summary collapse

Instance Method Details

#add_filesObject



29
30
31
32
33
34
35
36
37
38
# File 'lib/octopress-asset-pipeline.rb', line 29

def add_files
  if Octopress.site.pages.empty? && Octopress.site.posts.empty?
    Octopress.site.read_directories 
  end

  add_static_files
  add_page_files
  add_stylesheets
  add_javascripts
end

#config(*args) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'lib/octopress-asset-pipeline.rb', line 40

def config(*args)
  @config ||= begin
    c = Ink.configuration['asset_pipeline']
    {
      'stylesheets_dir' => ['stylesheets', 'css'],
      'javascripts_dir' => ['javascripts', 'js']
    }.merge(c).merge({ 'disable' => {} })
  end
end

#registerObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/octopress-asset-pipeline.rb', line 15

def register
  reset
  # Tell Jekyll to read static files and pages
  # This is necessary when Jekyll isn't being asked to build a site,
  # like when a user runs the list command to list assets
  #
  if Octopress::Docs.enabled?
    add_docs
  end
  if Octopress::Ink.enabled?
    add_files
  end
end