usebedrock / bedrock

Bedrock is a static site generator to create large-scale HTML prototypes and document design systems
https://bedrockapp.org
Other
206 stars 28 forks source link

Make COMPONENT_CATEGORIES constant a setting #186

Closed xavez closed 6 years ago

xavez commented 6 years ago

Use case: say you import a library that is not bootstrap, for instance Foundation, and it is prefixed f-, there is no easy way to define that in the settings file.

Wolfr commented 6 years ago

@xavez does this commit solve this problem? So we don't make it complicated when it doesn't need to be :)

xavez commented 6 years ago

Not really, the problem is that there are many more namespaces libraries out there than we can hardcode. For instance this one for Flanders: https://overheid.vlaanderen.be/webuniversum/versies/2.4.0

Wolfr commented 6 years ago

I thought about this and it's probably very easy to make this a setting. Cc @thomastuts

Wolfr commented 6 years ago

@xavez I worked on this it turned out to be quite easy.

https://github.com/mono-company/bedrock/commit/6ddb6cadcbb604a0ff3616d34b92e954fa949f62

xavez commented 6 years ago

@Wolfr tested it and works great!

Should we start documenting things on the Wiki when we add features like these? I’d be happy to do so.

Wolfr commented 6 years ago

At this point in time, fixes are documented in the release notes and when big enough on the blog https://bedrock.mono.company/blog/ . The wiki is not used a lot.

Wolfr commented 6 years ago

So when this lands in master, it will just be in the release notes. We can later on add this to the Bedrock documentation.

Wolfr commented 6 years ago

This landed in the core, so you can just run bedrock upgrade to use it.

Here is the default config file.

module.exports = {
  styleguide: {
    snippetLanguage: 'html',
    colors: './content/scss/_settings.colors.scss',
    categoryOrder: [
      'Style guide',
      'Patterns',
      'Overviews',
      'Components',
    ],
    componentCategories: {
      b: 'Bootstrap additions',
      f: 'Foundation additions',
      bc: 'Bootstrap custom components',
      fc: 'Foundation custom components',
      br: 'Bedrock components',
      c: 'Custom components'
    }
  },
  ui: {
    dark: false
  },
  icons: {
    generateIconFont: false,
    hasSvgIcons: true
  },
  pug: {
    pretty: true,
    basedir: "./content"
  },
  prettify: {
    logSuccess: false,
    indentSize: 2,
    unformatted: ['pre', 'textarea'],
    extraLiners: ['body']
  },
};