diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..9f536bcc4
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,46 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at brian.muenzenmeyer@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/4/
diff --git a/README.md b/README.md
index 17af07b7c..1959d1f4a 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,8 @@ Pattern Lab Node wouldn't be what it is today without the support of the communi
**:100: Thanks for support from the following:**
* **[Brad Frost](http://bradfrost.com/)**
-* Marcos Peebles
+* [Marcos Peebles](https://twitter.com/marcospeebles)
+* [Susan Simkins](https://twitter.com/susanmsimkins)
## Installation
diff --git a/core/lib/pattern_assembler.js b/core/lib/pattern_assembler.js
index dc76832a6..45082fcf4 100644
--- a/core/lib/pattern_assembler.js
+++ b/core/lib/pattern_assembler.js
@@ -166,6 +166,9 @@ 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 +185,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;
}
diff --git a/core/lib/patternlab.js b/core/lib/patternlab.js
index 49641b820..33d253fb7 100644
--- a/core/lib/patternlab.js
+++ b/core/lib/patternlab.js
@@ -1,5 +1,5 @@
/*
- * patternlab-node - v2.9.3 - 2017
+ * patternlab-node - v2.10.0 - 2017
*
* Brian Muenzenmeyer, Geoff Pursell, Raphael Okon, tburny and the web community.
* Licensed under the MIT license.
@@ -388,6 +388,13 @@ var patternlab_engine = function (config) {
// stringify this data for individual pattern rendering and use on the styleguide
// see if patternData really needs these other duped values
+
+ // construct our extraOutput dump
+ var extraOutput = Object.assign({}, pattern.extraOutput, pattern.allMarkdown);
+ delete(extraOutput.title);
+ delete(extraOutput.state);
+ delete(extraOutput.markdown);
+
pattern.patternData = JSON.stringify({
cssEnabled: false,
patternLineageExists: pattern.patternLineageExists,
@@ -410,7 +417,7 @@ var patternlab_engine = function (config) {
patternPartial: pattern.patternPartial,
patternState: pattern.patternState,
patternEngineName: pattern.engine.engineName,
- extraOutput: {}
+ extraOutput: extraOutput
});
//set the pattern-specific footer by compiling the general-footer with data, and then adding it to the meta footer
diff --git a/package.json b/package.json
index 9d4357750..6bca18c71 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "patternlab-node",
"description": "Pattern Lab is a collection of tools to help you create atomic design systems. This is the node command line interface (CLI).",
- "version": "2.9.3",
+ "version": "2.10.0",
"main": "./core/lib/patternlab.js",
"dependencies": {
"chalk": "^1.1.3",
diff --git a/test/files/_patterns/00-test/01-bar.md b/test/files/_patterns/00-test/01-bar.md
index d4fd865a2..755aa5799 100644
--- a/test/files/_patterns/00-test/01-bar.md
+++ b/test/files/_patterns/00-test/01-bar.md
@@ -1,5 +1,7 @@
---
status: complete
+title: An Atom Walks Into a Bar
+joke: bad
---
## A Simple Bit of Markup
diff --git a/test/parameter_hunter_tests.js b/test/parameter_hunter_tests.js
index a94e42e75..6ca9359b5 100644
--- a/test/parameter_hunter_tests.js
+++ b/test/parameter_hunter_tests.js
@@ -7,6 +7,7 @@ var CompileState = require('../core/lib/object_factory').CompileState;
var PatternGraph = require('../core/lib/pattern_graph').PatternGraph;
var fs = require('fs-extra');
+var util = require('./util/test_utils.js');
var ph = require('../core/lib/parameter_hunter');
@@ -112,16 +113,12 @@ tap.test('parameter hunter finds partials with their own parameters and renders
parameter_hunter.find_parameters(currentPattern, pl);
//assert
- test.equals(currentPattern.extendedTemplate,
- `c
+ test.equals(util.sanitized(currentPattern.extendedTemplate),
+ util.sanitized(`c
b
b!
a
-a!
-
-
-`);
-
+a!`));
test.end();
});
diff --git a/test/pattern_assembler_tests.js b/test/pattern_assembler_tests.js
index fa1cf92d2..bb92d1d91 100644
--- a/test/pattern_assembler_tests.js
+++ b/test/pattern_assembler_tests.js
@@ -768,3 +768,39 @@ tap.test('hidden patterns can be called by their nice names', function(test){
test.equals(util.sanitized(testPattern.render()), util.sanitized('Hello there! Here\'s the hidden atom: [This is the hidden atom]'), 'hidden pattern rendered output not as expected');
test.end();
});
+
+tap.test('parses pattern title correctly when frontmatter present', function(test){
+ var util = require('./util/test_utils.js');
+
+ //arrange
+ var testPatternsPath = path.resolve(__dirname, 'files', '_patterns');
+ var pl = util.fakePatternLab(testPatternsPath);
+ var pattern_assembler = new pa();
+
+ //act
+ var testPatternPath = path.join('00-test', '01-bar.mustache');
+ var testPattern = pattern_assembler.process_pattern_iterative(testPatternPath, pl);
+ pattern_assembler.process_pattern_recursive(testPatternPath, pl);
+
+ //assert
+ test.equals(testPattern.patternName, 'An Atom Walks Into a Bar','patternName not overridden');
+ test.end();
+});
+
+tap.test('parses pattern extra frontmatter correctly when frontmatter present', function(test){
+ var util = require('./util/test_utils.js');
+
+ //arrange
+ var testPatternsPath = path.resolve(__dirname, 'files', '_patterns');
+ var pl = util.fakePatternLab(testPatternsPath);
+ var pattern_assembler = new pa();
+
+ //act
+ var testPatternPath = path.join('00-test', '01-bar.mustache');
+ var testPattern = pattern_assembler.process_pattern_iterative(testPatternPath, pl);
+ pattern_assembler.process_pattern_recursive(testPatternPath, pl);
+
+ //assert
+ test.equals(testPattern.allMarkdown.joke, 'bad','extra key not added');
+ test.end();
+});
\ No newline at end of file