@blog.command()<EOL>@click.pass_context<EOL>def preview(context):
config = context.obj<EOL>pelican(config, '<STR_LIT>', '<STR_LIT>')<EOL>server_proc = None<EOL>os.chdir(config['<STR_LIT>'])<EOL>try:<EOL><INDENT>try:<EOL><INDENT>command = '<STR_LIT>' + str(PORT)<EOL>server_proc = run(command, bg=True)<EOL>time.sleep(<NUM_LIT:3>)<EOL>click.launch('<STR_LIT>')<EOL>time.sleep(<NUM_LIT:5>)<EOL>pelican(config, '<STR_LIT>')<EOL><DEDENT>except Exception:<EOL><INDENT>if server_proc is not None:<EOL><INDENT>server_proc.kill()<EOL><DEDENT>raise<EOL><DEDENT><DEDENT>except KeyboardInterrupt:<EOL><INDENT>abort(context)<EOL><DEDENT>
Opens local preview of your blog website