From e008fa025431d2a18f80885453a37eb396546261 Mon Sep 17 00:00:00 2001 From: Joachim Dagerot Date: Wed, 16 Aug 2017 20:35:15 +0200 Subject: [PATCH] Title is now read from the markdown file, overrides file name. Also adds the whole parsed markdown object to the pattern Title in md-files Front Matter is now working as the documentation claims. The whole parsed md-file is now stored in currentPattern.allMarkdown. All Front Matter keys, can be accessed in the patternSection.mustache with

{{ allMarkdown.preamble }}

--- core/lib/pattern_assembler.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/lib/pattern_assembler.js b/core/lib/pattern_assembler.js index dc76832a6..2448f632d 100644 --- a/core/lib/pattern_assembler.js +++ b/core/lib/pattern_assembler.js @@ -166,6 +166,11 @@ var pattern_assembler = function () { currentPattern.patternDescExists = true; currentPattern.patternDesc = markdownObject.markdown; + + //Add all markdown to the currentPattern, including frontmatter + currentPattern.allMarkdown = markdownObject; + + //consider looping through all keys eventually. would need to blacklist some properties and whitelist others if (markdownObject.state) { currentPattern.patternState = markdownObject.state; @@ -182,6 +187,9 @@ var pattern_assembler = function () { if (markdownObject.tags) { currentPattern.tags = markdownObject.tags; } + if (markdownObject.title) { + currentPattern.patternName = markdownObject.title; + } if (markdownObject.links) { currentPattern.links = markdownObject.links; }