all repos — hastysite @ 3f90149bdfbe64b37a92c864ba8dc49368eb0a40

A high-performance static site generator.

Fixes.
h3rald h3rald@h3rald.com
Sun, 19 Mar 2017 22:07:47 +0100
commit

3f90149bdfbe64b37a92c864ba8dc49368eb0a40

parent

14cf5a6577c5508b873d71d2f105e68d416c2bef

1 files changed, 10 insertions(+), 10 deletions(-)

jump to
M hastysite.nimhastysite.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)