Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.

PL-node-v1.1.3
- FIX: Added pattern type view all pages to the navigation, which users view all 'Atoms/Molecules/Organisms' etc.
- THX: Thanks to @gael-boyenval for originally pointing out the omission.

PL-node-v1.1.2
- FIX: Greatly improved the browsersync configuration, so that it only fires on the iframe, preventing users from losing their scroll position. Also lightened up the styling and made it less obtrusive.
- THX: Thanks to @geoffp for taking the lead on this issue.
Expand Down
2 changes: 1 addition & 1 deletion builder/lineage_hunter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v1.1.2 - 2016
* patternlab-node - v1.1.3 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion builder/list_item_hunter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v1.1.2 - 2016
* patternlab-node - v1.1.3 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion builder/media_hunter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v1.1.2 - 2016
* patternlab-node - v1.1.3 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion builder/object_factory.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v1.1.2 - 2016
* patternlab-node - v1.1.3 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion builder/parameter_hunter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v1.1.2 - 2016
* patternlab-node - v1.1.3 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion builder/pattern_assembler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v1.1.2 - 2016
* patternlab-node - v1.1.3 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion builder/pattern_exporter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v1.1.2 - 2016
* patternlab-node - v1.1.3 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down
55 changes: 47 additions & 8 deletions builder/patternlab.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v1.1.2 - 2016
* patternlab-node - v1.1.3 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down Expand Up @@ -207,7 +207,8 @@ var patternlab_engine = function (config) {

//build the viewall pages
var prevSubdir = '',
i;
prevGroup = '',
i;

for (i = 0; i < patternlab.patterns.length; i++) {
// skip underscore-prefixed files
Expand All @@ -220,6 +221,35 @@ var patternlab_engine = function (config) {

var pattern = patternlab.patterns[i];

//create the view all for the section
// check if the current section is different from the previous one
if (pattern.patternGroup != prevGroup){
prevGroup = pattern.patternGroup;

var viewAllPatterns = [],
patternPartial = "viewall-" + pattern.patternGroup,
j;

for (j = 0; j < patternlab.patterns.length; j++) {
if (patternlab.patterns[j].patternGroup === pattern.patternGroup) {
//again, skip any sibling patterns to the current one that may have underscores
if(isPatternExcluded(patternlab.patterns[j])){
if(patternlab.config.debug){
console.log('Omitting ' + patternlab.patterns[j].key + " from view all sibling rendering.");
}
continue;
}

viewAllPatterns.push(patternlab.patterns[j]);
}
}

var viewAllTemplate = fs.readFileSync(path.resolve(paths.source.patternlabFiles, 'viewall.mustache'), 'utf8');
var viewAllHtml = pattern_assembler.renderPattern(viewAllTemplate, {partials: viewAllPatterns, patternPartial: patternPartial});
fs.outputFileSync(paths.public.patterns + pattern.subdir.slice(0, pattern.subdir.indexOf(pattern.patternGroup) + pattern.patternGroup.length) + '/index.html', viewAllHtml);
}

//create the view all for the subsection
// check if the current sub section is different from the previous one
if (pattern.subdir !== prevSubdir) {
prevSubdir = pattern.subdir;
Expand Down Expand Up @@ -318,6 +348,14 @@ var patternlab_engine = function (config) {
//add to patternPaths
addToPatternPaths(bucketName, pattern);

//add the navViewAllItem
var navViewAllItem = new of.oNavSubItem("View All");
navViewAllItem.patternPath = pattern.subdir.slice(0, pattern.subdir.indexOf(pattern.patternGroup) + pattern.patternGroup.length) + "/index.html";
navViewAllItem.patternPartial = "viewall-" + pattern.patternGroup;

bucket.patternItems.push(navViewAllItem);
patternlab.viewAllPaths[bucketName]['viewall'] = pattern.subdir.slice(0, pattern.subdir.indexOf(pattern.patternGroup) + pattern.patternGroup.length);

}

//add the bucket.
Expand Down Expand Up @@ -393,14 +431,15 @@ var patternlab_engine = function (config) {
}
}

//add the navViewAllSubItem
var navViewAllSubItem = new of.oNavSubItem("");
navViewAllSubItem.patternName = "View All";
navViewAllSubItem.patternPath = pattern.flatPatternPath + "/index.html";
navViewAllSubItem.patternPartial = "viewall-" + pattern.patternGroup + "-" + pattern.patternSubGroup;

//check if we are moving to a new sub section in the next loop
if (!patternlab.patterns[i + 1] || pattern.patternSubGroup !== patternlab.patterns[i + 1].patternSubGroup) {

//add the navViewAllSubItem
var navViewAllSubItem = new of.oNavSubItem("");
navViewAllSubItem.patternName = "View All";
navViewAllSubItem.patternPath = pattern.flatPatternPath + "/index.html";
navViewAllSubItem.patternPartial = "viewall-" + pattern.patternGroup + "-" + pattern.patternSubGroup;

navItem.navSubItems.push(navViewAllSubItem);
navItem.navSubItemsIndex.push("View All");
}
Expand Down
2 changes: 1 addition & 1 deletion builder/patternlab_grunt.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v1.1.2 - 2016
* patternlab-node - v1.1.3 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion builder/patternlab_gulp.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v1.1.2 - 2016
* patternlab-node - v1.1.3 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion builder/pseudopattern_hunter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v1.1.2 - 2016
* patternlab-node - v1.1.3 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion builder/style_modifier_hunter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* patternlab-node - v1.1.2 - 2016
* patternlab-node - v1.1.3 - 2016
*
* Brian Muenzenmeyer, and the web community.
* Licensed under the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion package.gulp.json
Original file line number Diff line number Diff line change
@@ -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": "1.1.2",
"version": "1.1.3",
"main": "./builder/patternlab.js",
"dependencies": {
"del": "^2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": "1.1.2",
"version": "1.1.3",
"main": "./builder/patternlab.js",
"dependencies": {
"diveSync": "^0.3.0",
Expand Down