diff --git a/README.md b/README.md index 942921085..17af07b7c 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ Please read the guidelines: https://github.com/pattern-lab/patternlab-node/blob/ The Pattern Lab Node team uses [our gitter.im channel, pattern-lab/node](https://gitter.im/pattern-lab/node) to keep in sync, share updates, and talk shop. Please stop by to say hello or as a first place to turn if stuck. Other channels in the Pattern Lab organization can be found on gitter too. -There is also a dedicated Pattern Lab channel on the [design system slack](designsystems.herokuapp.com) run by [@jina](https://twitter.com/jina). +There is also a dedicated Pattern Lab channel on the [design system slack](http://designsystems.herokuapp.com) run by [@jina](https://twitter.com/jina). Ask or answer Pattern Lab questions on Stack Overflow: http://stackoverflow.com/questions/tagged/patternlab.io diff --git a/core/lib/object_factory.js b/core/lib/object_factory.js index 1263d80df..488b6fa13 100644 --- a/core/lib/object_factory.js +++ b/core/lib/object_factory.js @@ -59,7 +59,7 @@ var Pattern = function (relPath, data, patternlab) { // Let's calculate the verbose name ahead of time! We don't use path.sep here // on purpose. This isn't a file name! - this.verbosePartial = this.subdir + '/' + this.fileName; + this.verbosePartial = this.subdir.split(path.sep).join('/') + '/' + this.fileName; this.isPattern = true; this.isFlatPattern = this.patternGroup === this.patternSubGroup; diff --git a/core/lib/pattern_assembler.js b/core/lib/pattern_assembler.js index dc76832a6..ff680513a 100644 --- a/core/lib/pattern_assembler.js +++ b/core/lib/pattern_assembler.js @@ -34,7 +34,7 @@ var pattern_assembler = function () { for (var i = 0; i < patternlab.patterns.length; i++) { switch (partialName) { case patternlab.patterns[i].relPath: - case patternlab.patterns[i].subdir + '/' + patternlab.patterns[i].fileName: + case patternlab.patterns[i].verbosePartial: return patternlab.patterns[i]; } } diff --git a/core/lib/pattern_registry.js b/core/lib/pattern_registry.js index eda22d0ae..cbd46d82d 100644 --- a/core/lib/pattern_registry.js +++ b/core/lib/pattern_registry.js @@ -62,7 +62,7 @@ PatternRegistry.prototype = { for (let thisPattern of patterns) { switch (partialName) { case thisPattern.relPath: - case thisPattern.subdir + '/' + thisPattern.fileName: + case thisPattern.verbosePartial: return thisPattern; } } diff --git a/test/parameter_hunter_tests.js b/test/parameter_hunter_tests.js index a94e42e75..bdf12ba91 100644 --- a/test/parameter_hunter_tests.js +++ b/test/parameter_hunter_tests.js @@ -17,6 +17,7 @@ function currentPatternClosure() { "relPath": "02-organisms/02-comments/01-sticky-comment.mustache", "fileName": "01-sticky-comment", "subdir": "02-organisms/02-comments", + "verbosePartial": "02-organisms/02-comments/01-sticky-comment", "name": "02-organisms-02-comments-01-sticky-comment", "patternBaseName": "sticky-comment", "patternLink": "02-organisms-02-comments-01-sticky-comment/02-organisms-02-comments-01-sticky-comment.html", @@ -40,6 +41,7 @@ function patternlabClosure() { "relPath": "01-molecules/06-components/02-single-comment.mustache", "fileName": "02-single-comment", "subdir": "01-molecules/06-components", + "verbosePartial": "01-molecules/06-components/02-single-comment", "name": "01-molecules-06-components-02-single-comment", "patternBaseName": "single-comment", "patternLink": "01-molecules-06-components-02-single-comment/01-molecules-06-components-02-single-comment.html",