load_content

in src/_plugins/asset_bundler.rb [214:265]


    def load_content()
      if @config['dev']
        @@bundles[@filename_hash] = self
        return
      end

      src = @context.registers[:site].source

      @files.each {|f|
        if f =~ /^(https?:)?\/\//i
          
          f = "http:#{f}" if !$1
          f.sub!( /^https/i, "http" ) if $1 =~ /^https/i
          @content.concat(remote_asset_cache(URI(f)))
        else
          

          
          f = File.split(f)

          
          page = Page.new(@context.registers[:site], src, f[0], f[1])
          page.render(@context.registers[:site].layouts,
                      @context.registers[:site].site_payload())

          @content.concat(page.output)
        end

        
        @content.concat("\n")
      }

      @hash = @config['bundle_name'] || Digest::MD5.hexdigest(@content)
      @filename = "#{@hash}.#{@type}"
      cache_file = File.join(cache_dir(), @filename)

      if File.readable?(cache_file) and @config['compress'][@type]
        @content = File.read(cache_file)
      elsif @config['compress'][@type]
        
        compress()
        File.open(cache_file, "w") {|f|
          f.write(@content)
        }
      end

      @context.registers[:site].static_files.push(self)
      remove_bundled() if @config['remove_bundled']

      @@bundles[@filename_hash] = self
    end