0

I am interested in adding a front page to Pattern Lab. Rather than starting with the contents in "Atoms" (see image), I would like to start with a style guide.

I tried adding a folder, "Main", before "Atoms" with a mustache file, but (1) I was unable to open to the file within "Main" and (2) the content from "Atoms" was still showing but it was no longer styled. I've also tried adding mustache files before the "Atoms" folder, but cannot view or access them on the live-preview page.

Is it at all possible to create this front page? Is this a feature Pattern Lab offers or is there an extension that I can use to generate this page?

Default front page: contents within "Atoms" folder. Screenshot taken from demo.patternlab.io.

c.doe
  • 1

2 Answers2

0

Actually, the PatternLab main page is already a styleguide by itself, since it is compiled from all snippets you have (atoms, molecules, organisms and templates). As far as I know it is not possible to change the default homepage with a simple setting in the current version of PatternLab.

As a possible workaround you may prevent the particular snippets from showing up on the main page. This way you could hide everything you don't want to see on the main page and got a styleguide you want.

To make a snippet hidden prepend its file name with an underscore. So instead of atoms/some-atom.mustache use atoms/_some-atom.mustache and it will be hidden, but still useable.

See the documentation here: http://patternlab.io/docs/pattern-hiding.html

0

Maintainer of Pattern Lab Node here.

A configuration option now exists that lets you specify a defaultPattern other that all as you describe.

For Pattern Lab Node, you can read all about it at https://github.com/pattern-lab/patternlab-node/wiki/Configuration#defaultpatttern

This feature should be available in both platforms of the Pattern Lab, Node and PHP.

You can also read the formal spec for this feature at https://github.com/pattern-lab/the-spec/issues/13

Of note that specifying a defaultPattern will remove it from the navigation.

Hope this helps.

Brian Muenzenmeyer
  • 1,026
  • 1
  • 7
  • 17