rubykat/ikiplugins — pull request #5 by jcflack (2014-10-24 23:16:02+00:00)
Title: Address the sticky-ymlfront-metadata problem.

Addresses issue #4, except for previews.

If, in editing, an element is deleted from the YAML metadata, nothing was
removing it from %pagestate, so it would never disappear until a full rebuild.

More subtly, even a changed metadata value might not be reflected in pages
that refer to it until one additional refresh after the change. That seems to
be because, in at least some cases, a page or template that refers to the YAML
metadata elements may be scanned earlier than the page that contains the
edited YAML, causing the field plugin to find and use the old values from
%pagestate.

This patch addresses the problem by using the needsbuild hook, which precedes
scan, to empty $pagestate{$page}{ymlfront} for every page that will be
rebuilt.

Still unaddressed: needsbuild doesn't seem to be called for previews, so a
preview of a page that has YAML metadata, and displays some of it, will still
show the old values.