Sha256: 501ab1936678254a0a5a579d9fd24c90afe67dbe07638b3185afec25ff766471
Contents?: true
Size: 1.14 KB
Versions: 14
Compression:
Stored size: 1.14 KB
Contents
# frozen_string_literal: true class Bridgetown::Site module Writable # Remove orphaned files and empty directories in destination. # # @return [void] def cleanup @cleaner.cleanup! end # Write static files, pages, and documents to the destination folder. # # @return [void] def write each_site_file { |item| item.write(dest) } Bridgetown::Hooks.trigger :site, :post_write, self end # Yields all content objects while looping through {#generated_pages}, # {#static_files_to_write}, {#resources_to_write}. # # @yieldparam item [Bridgetown::Resource::Base, GeneratedPage, StaticFile] # # @return [void] def each_site_file %w(generated_pages static_files_to_write resources_to_write).each do |type| send(type).each do |item| # rubocop:disable Style/ExplicitBlockArgument yield item end end end def resources_cache_manifest resources.each_with_object({}) do |resource, hsh| next if resource.relative_url == "" hsh[resource.relative_url] = { id: resource.model.id, } end end end end
Version data entries
14 entries across 14 versions & 1 rubygems