Skip to content

Fix patternlink handling#442

Merged
bmuenzenmeyer merged 6 commits intodevfrom
fix-patternlink-handling
Aug 20, 2016
Merged

Fix patternlink handling#442
bmuenzenmeyer merged 6 commits intodevfrom
fix-patternlink-handling

Conversation

@geoffp
Copy link
Copy Markdown
Contributor

@geoffp geoffp commented Aug 19, 2016

Addresses #438, Addresses #437

Summary of changes:
In here, we change the way that Pattern object are initialized. To generate a correct patternLink, which is needed for pattern links in "view all" views to work, the Pattern object now needs access to the config, because the names of output files are now configurable. Therefore, we pass the global patternlab object into the Pattern constructor.

We also update the outputFileSuffixes blobs to the latest defaults throughout, fix a bunch of engine-specific unit tests, and do a little whitespace cleanup for good measure.

//write the compiled template to the public patterns directory
var patternPage = headHTML + pattern.patternPartialCode + footerHTML;
fs.outputFileSync(paths.public.patterns + pattern.patternLink.replace('.html', patternlab.config.outputFileSuffixes.rendered + '.html'), patternPage);
fs.outputFileSync(paths.public.patterns + pattern.getPatternLink(patternlab, 'rendered'), patternPage);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@geoffp this stuff is cool !

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! :)

@bmuenzenmeyer
Copy link
Copy Markdown
Member

I made one slight change to account for info panel template GETs seeming to fail.
I had other errors on my test edition but it seemed to clear up with an npm update of styleguide-assets-default.

@bmuenzenmeyer bmuenzenmeyer merged commit 84db306 into dev Aug 20, 2016
@bmuenzenmeyer bmuenzenmeyer deleted the fix-patternlink-handling branch August 20, 2016 12:25
@geoffp
Copy link
Copy Markdown
Contributor Author

geoffp commented Aug 22, 2016

@bmuenzenmeyer, good catch! Sorry I missed that. Makes me want to run off and start doing functional testing.

@bmuenzenmeyer
Copy link
Copy Markdown
Member

I think everything is good now! If you could give 2.4.3 a spin, that would be great

@geoffp
Copy link
Copy Markdown
Contributor Author

geoffp commented Aug 22, 2016

Doin' that now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants