all repos — hastysite @ fb936020e542dfe22793d741098c0699a84a360b

A high-performance static site generator.

Added missing metadata to contents.
h3rald h3rald@h3rald.com
Sun, 20 Nov 2016 19:19:19 +0100
commit

fb936020e542dfe22793d741098c0699a84a360b

parent

fdc0ba18ee81c0dca4fc40a6ae675384fd7e219a

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

jump to
M hastysite.nimhastysite.nim

@@ -171,7 +171,12 @@ if yaml == "":

raise NoMetadataException(msg: "No metadata found in file: " & file) if not obj.hasKey("contents"): obj["contents"] = newJObject() - obj["contents"][fileid] = yaml.loadToJson()[0] + var meta = yaml.loadToJson()[0] + meta["path"] = %fileid + meta["type"] = %"content" + meta["id"] = %fileid.changeFileExt("") + meta["ext"] = %fileid.splitFile.ext + obj["contents"][fileid] = meta f.close() proc checkContent(dir, file: string, obj: var JsonNode): bool =