Skip to content

Commit

Permalink
Title is now read from the markdown file, overrides file name. Also a…
Browse files Browse the repository at this point in the history
…dds 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

<h3 class="pl-preamble">{{ allMarkdown.preamble }}</h3>
  • Loading branch information
jdagerot authored Aug 16, 2017
1 parent ec0c7b6 commit e008fa0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/lib/pattern_assembler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit e008fa0

Please sign in to comment.