Module: Stastic::Generator::Staticmatic

Extended by:
Staticmatic
Included in:
Staticmatic
Defined in:
lib/stastic/generators/staticmatic.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



18
19
20
21
# File 'lib/stastic/generators/staticmatic.rb', line 18

def build
  verify_gem
  system("staticmatic build .")
end

#descObject



5
6
7
# File 'lib/stastic/generators/staticmatic.rb', line 5

def desc
  "Staticmatic Generator"
end

#detectObject



9
10
11
12
# File 'lib/stastic/generators/staticmatic.rb', line 9

def detect
  FileTest.exists?('config/site.rb') &&
    FileTest.exists?("src/pages") && File.directory?("src/pages")
end

#packageObject



23
24
25
# File 'lib/stastic/generators/staticmatic.rb', line 23

def package
  Stastic::Generator.package(site_root)
end

#previewObject



27
28
29
30
# File 'lib/stastic/generators/staticmatic.rb', line 27

def preview
  verify_gem
  system("staticmatic preview .")
end

#site_rootObject



14
15
16
# File 'lib/stastic/generators/staticmatic.rb', line 14

def site_root
  Stastic::Config.site_root || "site"
end