Skip to content
Browse files
Emit an event when a post/page already exists, also.
Creation of new_post successfully emits an event, but no event is fired
new_post fails because there is an existing post.  This event can be
used by plugins, for e.g. open the post in an editor or prompt to delete
the post, etc.
  • Loading branch information
punchagan committed May 13, 2015
1 parent b0bf8de commit d33a0232ff9b82ef00a6a8b60d7029af2c356623
Showing with 7 additions and 0 deletions.
  1. +7 −0 nikola/plugins/command/
@@ -349,6 +349,13 @@ def _execute(self, options, args):

if (not onefile and os.path.isfile(meta_path)) or \

# Emit an event when a post exists
event = dict(path=txt_path)
if not onefile: # write metadata file
event['meta_path'] = meta_path
signal('existing_' + content_type).send(self, **event)

LOGGER.error("The title already exists!")

2 comments on commit d33a023


This comment has been minimized.

Copy link

@ralsina ralsina replied May 14, 2015

These things should come with doc patches. Specifically:


This comment has been minimized.

Copy link

@Kwpolska Kwpolska replied May 16, 2015

done 046002a

Please sign in to comment.