Fixes.
h3rald h3rald@h3rald.com
Sun, 19 Mar 2017 22:07:47 +0100
1 files changed,
10 insertions(+),
10 deletions(-)
jump to
M
hastysite.nim
→
hastysite.nim
@@ -156,7 +156,7 @@ result = ""
var delimiter = 0 try: while f.readLine(s): - if delimiter >= 2: + if delimiter >= 2: result &= s&"\n" else: if s.match(peg"'-' '-' '-' '-'*"):@@ -168,12 +168,15 @@ discard
if not obj.hasKey("contents"): obj["contents"] = newJObject() var meta = newJObject(); - try: - let docs = yaml.loadToJson() - if docs.len > 0: - meta = docs[0] - except: - meta = newJObject() + if delimiter < 2: + result = yaml + else: + try: + let docs = yaml.loadToJson() + if docs.len > 0: + meta = docs[0] + except: + meta = newJObject() meta["path"] = %fileid meta["id"] = %fileid.changeFileExt("") meta["ext"] = %fileid.splitFile.ext@@ -389,10 +392,7 @@ quit("Aborted.")
of "rebuild": quitIfNotExists(cfg) var hs = newHastySite(cfg) - #if hs.confirmDeleteDir(hs.dirs.temp) and hs.confirmDeleteDir(hs.dirs.output): hs.clean() hs.build() - #else: - # quit("Aborted.") else: quit("Error: Command '$1' is not supported" % command)