From: http://kerravonsen.dreamwidth.org/ Date: Mon, 20 Jun 2011 00:13:05 +0000 (+0000) Subject: help me, plugin experts X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6e4c0d9719be186b62e057b0a25f44279e6af9d3;p=ikiwiki.git help me, plugin experts --- diff --git a/doc/forum/Can_one_tell_if_a_page_is_added_rather_than_changed__63__.mdwn b/doc/forum/Can_one_tell_if_a_page_is_added_rather_than_changed__63__.mdwn new file mode 100644 index 000000000..4c06cbabb --- /dev/null +++ b/doc/forum/Can_one_tell_if_a_page_is_added_rather_than_changed__63__.mdwn @@ -0,0 +1,5 @@ +In the plugin interface, there are hooks for "deleted" and "changed" and the "changed" interfaces includes files which are *either* changed or added. Is there any way of telling that a file has been added rather than changed? With some plugins (for example, [[plugins/sidebar]]) if a new page (of a certain sort) is added, the only way one can fix up the dependencies is to rebuild the whole site from scratch. This is Not Good. Now, one could do something in the "changed" hook, but since one can't tell if a file has been changed or added, if one did something for every changed file, one would be doing a lot of needless work (so one might as well rebuild the site when one *knows* that a new (relevant) page has been added). + +But I really would like to be able to do things just to the *new* files, so is there any way that one can distinguish the changed files from the added files? + +-- [[KathrynAndersen]]