Skip to content

Commit e008fa0

Browse files
authored
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 <h3 class="pl-preamble">{{ allMarkdown.preamble }}</h3>
1 parent ec0c7b6 commit e008fa0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/lib/pattern_assembler.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ var pattern_assembler = function () {
166166
currentPattern.patternDescExists = true;
167167
currentPattern.patternDesc = markdownObject.markdown;
168168

169+
170+
//Add all markdown to the currentPattern, including frontmatter
171+
currentPattern.allMarkdown = markdownObject;
172+
173+
169174
//consider looping through all keys eventually. would need to blacklist some properties and whitelist others
170175
if (markdownObject.state) {
171176
currentPattern.patternState = markdownObject.state;
@@ -182,6 +187,9 @@ var pattern_assembler = function () {
182187
if (markdownObject.tags) {
183188
currentPattern.tags = markdownObject.tags;
184189
}
190+
if (markdownObject.title) {
191+
currentPattern.patternName = markdownObject.title;
192+
}
185193
if (markdownObject.links) {
186194
currentPattern.links = markdownObject.links;
187195
}

0 commit comments

Comments
 (0)