Only check time if it exists
This commit is contained in:
parent
f426a2f8ef
commit
186d47fe84
1 changed files with 4 additions and 5 deletions
|
@ -18,9 +18,9 @@ class Command(BaseCommand):
|
|||
htmlpath = '%s/templates/html_pages/%s' % (DEPLOY_PATH, mdname)
|
||||
htmlfile = '%s/index.html' % htmlpath
|
||||
|
||||
if mdtuple[1] == '.mdwn' \
|
||||
and os.path.exists(mdfile) and not os.path.exists(htmlfile) \
|
||||
or os.path.getmtime(mdfile) > os.path.getmtime(htmlfile):
|
||||
if mdtuple[1] == '.mdwn' and os.path.exists(mdfile) \
|
||||
and (not os.path.exists(htmlfile) \
|
||||
or os.path.getmtime(mdfile) > os.path.getmtime(htmlfile)):
|
||||
|
||||
if not os.path.exists(htmlpath):
|
||||
os.makedirs(htmlpath)
|
||||
|
@ -28,8 +28,7 @@ class Command(BaseCommand):
|
|||
md = markdown.Markdown()
|
||||
print 'Converting ', mdname, '-->', htmlfile,
|
||||
wikiExtension = 'wikilinks(base_url=%s/)' % subdir
|
||||
markdown.markdownFromFile(input=mdfile, output=htmlfile,
|
||||
encoding="utf-8",
|
||||
markdown.markdownFromFile(input=mdfile, output=htmlfile, encoding="utf-8",
|
||||
extensions=[wikiExtension])
|
||||
print ' ... succeeded'
|
||||
|
||||
|
|
Loading…
Reference in a new issue