Sha256: 8aa9836e6a886603f89adc13ae3f580d394371cfb9eff94143bddbde2b60a7aa

Contents?: true

Size: 678 Bytes

Versions: 7

Compression:

Stored size: 678 Bytes

Contents

# frozen_string_literal: true

module Bridgetown
  module Site::Writable
    # Remove orphaned files and empty directories in destination.
    #
    # Returns nothing.
    def cleanup
      @cleaner.cleanup!
    end

    # Write static files, pages, and posts.
    #
    # Returns nothing.
    def write
      each_site_file do |item|
        item.write(dest) if regenerator.regenerate?(item)
      end
      regenerator.write_metadata
      Bridgetown::Hooks.trigger :site, :post_write, self
    end

    def each_site_file
      %w(pages static_files docs_to_write).each do |type|
        send(type).each do |item|
          yield item
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bridgetown-core-0.15.0 lib/bridgetown-core/concerns/site/writable.rb
bridgetown-core-0.15.0.beta4 lib/bridgetown-core/concerns/site/writable.rb
bridgetown-core-0.15.0.beta3 lib/bridgetown-core/concerns/site/writable.rb
bridgetown-core-0.15.0.beta2 lib/bridgetown-core/concerns/site/writable.rb
bridgetown-core-0.15.0.beta1 lib/bridgetown-core/concerns/site/writable.rb
bridgetown-core-0.14.1 lib/bridgetown-core/concerns/site/writable.rb
bridgetown-core-0.14.0 lib/bridgetown-core/concerns/site/writable.rb