page.updated bug report/suggestion

why the lucky stiff why at hobix.com
Tue Sep 28 12:50:36 EDT 2004


William Morgan wrote:

>In weblog.rb method retouch, I suggest adding a
>  next if page.updated.nil?
>
>or the equivalent. Otherwise pages that have no entries, e.g. monthly
>indices for empty months, are always updated. (These pages typically set
>their updated field to the result of storage.last_modified, which can be
>nil if the entry set is nil.)
>
Okay, good one.  Here's how it works now.

    ## If updating, skip any that are unchanged
    next if how == :update and
            File.exists?( full_out_path ) and
            File.mtime( path ) < File.mtime( full_out_path ) and
            ( vars[:page].updated.nil? or
              vars[:page].updated < File.mtime( full_out_path ) )


So, it'll update if:

   1. No corresponding page is found in your output directory.
   2. A page is found, but it's older than the template it's based on.
   3. A page is found, but it's older than the latest updated entry on
      the page.

_why




More information about the Hobix-is-the-way mailing list