This plugin was produced on request by Anton Akhmerov on the nikola-discuss mailing list. It uses the SignalHandler architecture to facilitate creation of posts/pages that are automatically generated by a task.
There is a specific execution order that, if broken, results in the plugin not functioning. The order is:
AutopostSignalis loadedsignalhandlers_loadedis fired,AutogenSignal.gen_filesis calledAutopostSignal.gen_filescreatescache/autopost.rstandcache/autopost.meta- Posts are scanned,
cache/autopost.rstis one of them (seePOSTS/PAGESin config) AutopostTask.gen_tasksproduces a task to generatecache/autopost.rstwith real content. The task has the file set astargets.doitdoes some intelligent dependency calculation. Because we created the files before we scanned posts, a Post object was created in the timeline for our post.autopost_taskhas the file intargets, andrender_postshas it infile_dep. Execution order is determined:- The
autopost_taskcreates a real.rstfile. - The usual
render_postsandrender_pagestasks are fired off.
Make sure to edit both .py files to your liking!