| 1 |
Suggestion to change |
| 2 |
|
| 3 |
0 0 * * * ikiwiki-calendar ~/ikiwiki.setup "posts/* and !*/Discussion" |
| 4 |
|
| 5 |
to |
| 6 |
|
| 7 |
0 0 * * * ikiwiki-calendar ~/ikiwiki.setup 'posts/* and !*/Discussion' |
| 8 |
|
| 9 |
I ran into (for me) unexpected behaviour with double quotes, since when I tried it in the interactive shell, the "!" made it fail ([history expansion](http://mywiki.wooledge.org/BashPitfalls#echo_.22Hello_World.21.22)). I thought "aha, it should be escaped!", did so, and did not get any error messages, but it no longer functioned as intended (as per the earlier linked page). |
| 10 |
|
| 11 |
The latter line will work everywhere, not just in environments without history expansion. I think trying a command manually before putting it into crontab is common, and this would avoid the possible user issue I ran into. |
| 12 |
|
| 13 |
---- |
| 14 |
|
| 15 |
I wonder what this program (ikiwiki-calendar) is useful for. Would not it be simpler to have the [[calendar|ikiwiki/directive/calendar]] directive generate the `archive_base/year/month.mdwn` files on the fly, as are the tag pages generated by the [[tag|plugins/tag]] plugin? This solution would have the advantage of automatically generating the right calendar pages, instead of having to tell ikiwiki-calendar which years to take into account. |
| 16 |
|
| 17 |
Using this solution would mean to have the pagespec stored somewhere in the configuration. But this is already the case, as the pagespec used by [[ikiwiki-calendar]] is either set in the configuration file of the wiki, or in the crontab or whatever script used to call ikiwiki-calendar. |
| 18 |
|
| 19 |
Having done this, the only purpose of ikiwiki-calendar would be to re-generate the wiki on a daily (or whatever frequency) basis, which can be done using ikiwiki instead of ikiwiki-calendar. |
| 20 |
|
| 21 |
Did I miss something? If I am right, I offer to write the necessary patch, copied and adapted from the tag plugin, to generate the pages `archive_base/year/month.mdwn` on the fly. |
| 22 |
|
| 23 |
-- [[Louis|spalax]] |
| 24 |
|
| 25 |
> Good spotting, `ikiwiki-calendar` predates the `add_autofile` API used to |
| 26 |
> autocreate tag pages and was bolted in as an easy way to create calendar |
| 27 |
> pages. |
| 28 |
> |
| 29 |
> It would be possible to do that inside the caneldar plugin now. Although |
| 30 |
> some command would still need to be run on a daily (or weekly, or |
| 31 |
> monthly, or yearly..) basis to have it wake up and make the new calendar |
| 32 |
> pages and update the displayed current day from calendar directives. |
| 33 |
> |
| 34 |
> That last is, arguably, the real point of running ikiwiki-calendar in |
| 35 |
> a cron job. Of course all it really does is run `ikiwiki -setup foo |
| 36 |
> -refresh`. --[[Joey]] |
| 37 |
|
| 38 |
> > [[Patch|todo/calendar_autocreate]]. -- [[Louis|spalax]] |