# File lib/staticmatic/mixins/build.rb, line 3 def build build_css build_html end
Build CSS from the source files
# File lib/staticmatic/mixins/build.rb, line 18 def build_css Dir["#{@src_dir}/stylesheets/**/*.{sass,scss}"].each do |path| file_dir, template = source_template_from_path(path.sub(/^#{@src_dir}\/stylesheets/, '')) if !template.match(/(^|\/)\_/) save_stylesheet(File.join(file_dir, template), generate_css(template, file_dir)) end end end
Build HTML from the source files
# File lib/staticmatic/mixins/build.rb, line 9 def build_html Dir["#{@src_dir}/pages/**/*.haml"].each do |path| next if File.basename(path) =~ /^\_/ # skip partials file_dir, template = source_template_from_path(path.sub(/^#{@src_dir}\/pages/, '')) save_page(File.join(file_dir, template), generate_html_with_layout(template, file_dir)) end end
# File lib/staticmatic/mixins/build.rb, line 28 def copy_file(from, to) FileUtils.cp(from, to) end
# File lib/staticmatic/mixins/build.rb, line 40 def generate_site_file(filename, extension, content) path = File.join(@site_dir,"#{filename}.#{extension}") FileUtils.mkdir_p(File.dirname(path)) File.open(path, 'w+') do |f| f << content end puts "created #{path}" end
Generated with the Darkfish Rdoc Generator 2.