Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 13 additions & 0 deletions core/lib/pattern_assembler.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,19 @@ var pattern_assembler = function () {

function processPatternIterative(relPath, patternlab) {

var relativeDepth = relPath.match(/\w(?=\\)|\w(?=\/)/g || []).length;
if (relativeDepth > 2) {
console.log('');
plutils.logOrange('Warning:');
plutils.logOrange('A pattern file: ' + relPath + ' was found greater than 2 levels deep from ' + patternlab.config.paths.source.patterns + '.');
plutils.logOrange('It\'s strongly suggested to not deviate from the following structure under _patterns/');
plutils.logOrange('[patternType]/[patternSubtype]/[patternName].[patternExtension]');
console.log('');
plutils.logOrange('While Pattern Lab may still function, assets may 404 and frontend links may break. Consider yourself warned. ');
plutils.logOrange('Read More: http://patternlab.io/docs/pattern-organization.html');
console.log('');
}

//check if the found file is a top-level markdown file
var fileObject = path.parse(relPath);
if (fileObject.ext === '.md') {
Expand Down
8 changes: 6 additions & 2 deletions core/lib/ui_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,13 @@ var ui_builder = function () {
//todo this isn't quite working yet
//typePatterns = typePatterns.concat(getPatternItems(patternlab, patternType));

//render the viewall template
//get the appropriate patternType
var anyPatternOfType = _.find(typePatterns, function (pat) {
return pat.patternType && pat.patternType !== '';});

//render the viewall template for the type
var viewAllHTML = buildViewAllHTML(patternlab, typePatterns, patternType);
writeFile(paths.public.patterns + p.subdir + '/index.html', mainPageHeadHtml + viewAllHTML + footerHTML);
writeFile(paths.public.patterns + anyPatternOfType.patternType + '/index.html', mainPageHeadHtml + viewAllHTML + footerHTML);

//determine if we should omit this patterntype completely from the viewall page
var omitPatternType = styleGuideExcludes && styleGuideExcludes.length
Expand Down