sitepress-rails/lib/sitepress/compiler.rb
# Iterates through all pages and writes them to disk
Iterates through all pages and writes them to disk
Iterates through all pages and writes them to disk
def compile
      status "Building #{site.root_path.expand_path} to #{root_path.expand_path}"
      resources.each do |resource, path|
        if resource.renderable?
          status "Rendering #{path}"
          File.open(path.expand_path, "w"){ |f| f.write render resource }
        else
          status "Copying #{path}"
          cp resource.asset.path, path.expand_path
        end
      rescue
        status "Error building #{resource.inspect}"
        raise if raise_exception_on_error
      end
      status "Successful build to #{root_path.expand_path}"
    end
def compile status "Building #{site.root_path.expand_path} to #{root_path.expand_path}" resources . each do | resource , path | if resource . renderable? status "Rendering #{path}" File . open ( path . expand_path , "w" ) { | f | f . write render resource } else status "Copying #{path}" cp resource . asset . path , path . expand_path end rescue status "Error building #{resource.inspect}" raise if raise_exception_on_error end status "Successful build to #{root_path.expand_path}" end
Iterates through all pages and writes them to disk
Iterates through all pages and writes them to disk