Customising your design system

Now that you've installed vf-demo-design-system, learn how it works and how to adapt it to your needs.

The major projects in use

To make full use of this boilerplate, you'll need to be familiar with these projects:

How things work

1. Visual Framework

2. Gulp

3. Fractal

4. Eleventy

5. Nunjucks

This templating language is used throughout so you can not only use a nice templatin language but also have direct access to component templates:

Code: {% render "@vf-sample", {text: "with some text"} %}
Returns: <p>I'm a sample with some text</p>

Want Markdown? You can use it for entire files or by with Nunjuck blocks and tags.

Markdown file support

Name your file with the Markdown suffix (index.md) or a page's front matter:

templateEngineOverride: njk, md

Markdown filter

Nunjcuks:{{ "I'm some `markdown`" | markdown | safe }}
Returns: <p>I'm some <code>markdown</code></p>

Markdown tag

Nunjcuks:
{% markdown %}
[A link](#)
{% endmarkdown %}

Returns: 

A link

Actions to do, files to edit

Now that you know a bit about the configuration, here's how to start customising.

Browse, add, make components

Configuration options

Customise page templates

Page templates are located at .src/site/_data/site/_includes/layouts, you can learn more about layout's in Eleventy's docs.

Add pages

Pages are located at .src/site/_data/site/. Have a look at some of the existing pages and copy them to make new pages.

Local CSS, JS, images

There's usually a need for "edge cases":

Outputs: what is made

When you run gulp dev or gulp build, Eleventy will build your static pages and trigger the Visual Framework.

Deploying your design system

Common issue: Not deploying to the right subdirectory? Make sure in ./eleventy.js you've updated pathPrefix.

The component library

A full component library is available at /components

The component library is generated by tapping into an export Fractal's component index:

  1. the component list is updated whenever a component is edited or added
  2. the data is eposed to Eleventy at ./src/site/_data/fractalEnvironment.js
  3. individual component pages are created using Eleventy's pagination feature
    • ./src/site/components/component-view.njk
    • ./src/site/components/vf-core-components.njk
  4. a page template drives the layout of the components ./src/site/_includes/layouts/components.njk