Class: Octopress::Ink::SiteHook

Inherits:
Hooks::Site
  • Object
show all
Defined in:
lib/octopress-ink/jekyll/hooks.rb

Instance Method Summary collapse

Instance Method Details

#merge_payload(payload, site) ⇒ Object



47
48
49
# File 'lib/octopress-ink/jekyll/hooks.rb', line 47

def merge_payload(payload, site)
  Ink.payload
end

#post_read(site) ⇒ Object



41
42
43
44
45
# File 'lib/octopress-ink/jekyll/hooks.rb', line 41

def post_read(site)
  Octopress.site = site
  Ink::Plugins.register
  Ink::Plugins.add_files
end

#post_write(site) ⇒ Object



51
52
53
54
55
56
57
58
# File 'lib/octopress-ink/jekyll/hooks.rb', line 51

def post_write(site)
  Octopress::Ink::Plugins.static_files.each do |f| 
    f.write(site.dest)
  end

  Octopress::Ink::Cache.write
  Octopress::Ink::Cache.clean
end

#reset(site) ⇒ Object



34
35
36
37
38
39
# File 'lib/octopress-ink/jekyll/hooks.rb', line 34

def reset(site)
  Ink.watch_assets(site)
  if Plugins.registered
    Plugins.reset
  end
end