You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG
+13-4Lines changed: 13 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,13 @@
1
1
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.
2
+
PL-node-v0.10.0
3
+
- ADD: Added support for pattern parameters! Resolves #88
4
+
- FIX: Data inheritance is now working as advertised. Resolves #127. This turned out to be a MAJOR thing, as I realized the home-page was not passing down any of its json data to partials.
5
+
- CHG: Refactored a lot of code out of patternlab.js and into separate files. Doing so should make everything dryer, more unit testable, and easier to understand I hope.
6
+
- ADD: Added proper styling for the homepage-emergency alert that is displayed for demo purposes
7
+
- ADD: Added a new comment organism, the sticky comment, to ship an example of pattern parameters
8
+
- CHG: Start some JS linting of the project. I don't quite agree with a lot of it, so am trying to set some smart configurations
9
+
- CHG: Wrapped some build messages in the patternlab.config.debug flag
10
+
- FIX: Allow users to set a base url path. Resolves #125 ([)testing in the while requested)
2
11
3
12
PL-node-v0.9.1
4
13
- FIX: Fixed an issue with view all navigation not checking for index out of bounds cases
@@ -7,7 +16,7 @@ PL-node-v0.9.0
7
16
- FIX: Added grunt-contrib-copy args to copy all found source/css/*.css
8
17
- ADD: Added upgrade instructions to README
9
18
- FIX: Fix issue with styleguide accordions not closing upon click of a sibling menu.
10
-
- THX: @getsetbro for reporting more issues :)
19
+
- THX: @getsetbro for reporting more issues :)
11
20
- ADD: Added support for pattern search. This is 'in beta' and should have more testing applied to it.
12
21
- ADD: Added support for all keyboard shortcuts found in PL-PHP-v1.0.0
13
22
- FIX: Fixed an issue where Hay mode and Disco mode did not stop one another when using keyboard shortcuts
@@ -63,7 +72,7 @@ PL-node-v0.1.3
63
72
64
73
PL-node-v0.1.2
65
74
- ADD: Abstracted template rendering into a function for easier swapping of rendering engine
66
-
- ADD: Smarter filtering of files to support other templates Thanks
75
+
- ADD: Smarter filtering of files to support other templates Thanks
67
76
- ADD: Help command line agument
68
77
- ADD: Version command line argument
69
78
- ADD: Patterns only command line argument
@@ -102,7 +111,7 @@ PL-node-v0.0.5
102
111
103
112
PL-node-v0.0.4
104
113
- ADD: An explicit MIT license
105
-
- FIX: Clean public/patterns/ before build
114
+
- FIX: Clean public/patterns/ before build
106
115
107
116
PL-node-v0.0.3
108
117
- FIX: Install documentation was incomplete, should not have assumed grunt
@@ -114,4 +123,4 @@ PL-node-v0.0.2
114
123
- FIX: Grunt watching styleguide scss
115
124
116
125
PL-node-v0.0.1
117
-
- Minimum Viable Product! At this point, I feel you could use Pattern Lab Node to build an atomic design-driven website.
126
+
- Minimum Viable Product! At this point, I feel you could use Pattern Lab Node to build an atomic design-driven website.
The Node version of Pattern Lab is, at its core, a static site generator. It combines platform-agnostic assets, like the [Mustache](http://mustache.github.io/)-based patterns and the JavaScript-based viewer, with a Node-based "builder" that transforms and dynamically builds the Pattern Lab site. By making it a static site generator, the Node version of Pattern Lab strongly separates patterns, data, and presentation from build logic. The Node version is a work in progress, the [PHP version](https://github.com/pattern-lab/patternlab-php) should be seen as a reference for other developers to improve upon as they build their own Pattern Lab Builders in their language of choice.
6
6
7
7
### Getting Started
8
8
9
-
To run patternlab-node, run the following from the command line at the root of whichever directory you want to initialize your project in:
9
+
To run patternlab-node, run the following from the command line at the root of whichever directory you want to initialize your project in:
10
10
11
11
1.`npm install`
12
12
2.`npm install -g grunt-cli`
@@ -73,6 +73,25 @@ Pattern states should be lowercase and use hyphens where spaces are present.
73
73
}
74
74
```
75
75
76
+
##### Pattern Parameters
77
+
attern parameters are a simple mechanism for replacing Mustache variables via attributes on a pattern partial tag rather than having to use a pattern-specific json file. They are especially useful when you want to supply distinct values for Mustache variables in a specific pattern partial instance that may be included multiple times in a molecule, template, or page.
78
+
79
+
The basic syntax is this:
80
+
81
+
```
82
+
{{> molecules-single-comment(description: 'A life is like a garden. Perfect moments can be had, but not preserved, except in memory.') }}
83
+
```
84
+
85
+
The attributes listed in the pattern parameters should match Mustache variable names in your pattern. The values listed for each attribute will replace the Mustache variables. Again, pattern parameters are a simple find and replace of Mustache variables with the supplied values.
86
+
87
+
Pattern parameters **do not** currently support the following:
88
+
89
+
* sub-lists (e.g. iteration of a section),
90
+
* and the use of long strings of text can be unwieldy
91
+
* nested properties within the parameter data, such as `{{> molecules-single-comment(foo.bar: 'baz') }}`
92
+
93
+
You can read the full documentation on pattern parameters here: [Using Pattern Parameters](http://patternlab.io/docs/pattern-parameters.html)
94
+
76
95
##### Pseudo-Patterns
77
96
Pseudo-patterns are meant to give developers the ability to build multiple and unique **rendered** patterns off of one base pattern and its mark-up while giving them control over the data that is injected into the base pattern. This feature is especially useful when developing template- and page-style patterns.
78
97
@@ -139,7 +158,7 @@ As you can see, it's a much easier way of linking patterns to one another.
139
158
140
159
141
160
##### Pattern Export
142
-
`config.json` also has two properties that work together to export completed patterns for use in a production environment. Provide an array of keys and an output directory. Pattern Lab doesn't ship with any pattern export keys, but the default directory is `"./pattern_exports/"` created inside the install directory.
161
+
`config.json` also has two properties that work together to export completed patterns for use in a production environment. Provide an array of keys and an output directory. Pattern Lab doesn't ship with any pattern export keys, but the default directory is `"./pattern_exports/"` created inside the install directory.
@@ -148,6 +167,15 @@ As you can see, it's a much easier way of linking patterns to one another.
148
167
149
168
Coupled with exported css (much easier to extract with existing tools like [grunt-contrib-copy](https://github.com/gruntjs/grunt-contrib-copy)), pattern export can help to maintain the relevancy of the design system by directly placing partials in a directory of your choosing.
150
169
170
+
##### baseurl
171
+
172
+
If your instance of Pattern Lab lives in a subdirectory of your server, for instance on github pages (ex: yourusername.github.io/patterns-demo/), then add the baseurl here. The baseurl is everything after the hostname - ie: `patterns-demo`
173
+
174
+
```
175
+
"baseurl" : "/patterns-demo"
176
+
```
177
+
178
+
Default: blank
151
179
152
180
##### Verbose Mode
153
181
`patternlab.json` is a file created for debugging purposes. Set `debug` to true in `.config.json` to see all the secrets.
@@ -165,7 +193,7 @@ You can find some simple upgrade documenation in it's current home here (unrelea
165
193
166
194
### Forward, To the Specification!
167
195
168
-
Dave Olsen has published the [specification](https://github.com/pattern-lab/the-spec/blob/draft/SPEC.md) for Pattern Lab ports. Development will be oriented toward compliance with this as the spec and the port mature together.
196
+
Dave Olsen has published the [specification](https://github.com/pattern-lab/the-spec/blob/draft/SPEC.md) for Pattern Lab ports. Development will be oriented toward compliance with this as the spec and the port mature together.
169
197
170
198
### Is Pattern Lab a Platform or a Build Tool?
171
199
@@ -219,7 +247,7 @@ By default, the Pattern Lab assets can be manually generated and the Pattern Lab
219
247
*[Watching for Changes and Auto-Regenerating Patterns](http://patternlab.io/docs/advanced-auto-regenerate.html) - Node version coming soon
220
248
*[Auto-Reloading the Browser Window When Changes Are Made](http://patternlab.io/docs/advanced-reload-browser.html) - Node version coming soon
221
249
*[Multi-browser & Multi-device Testing with Page Follow](http://patternlab.io/docs/advanced-page-follow.html)
//do no evil. there is no good way to do this that I can think of without using a split, which then makes commas and colons special characters and unusable within the pattern params
40
+
varparamData=eval(paramString);
41
+
42
+
//compile this partial immeadiately, essentially consuming it.
43
+
//TODO: see how this affects lineage. perhaps add manually here.
0 commit comments