@jungvonmatt/cssg-plugin-grow
TypeScript icon, indicating that this package has built-in type declarations

1.14.0 • Public • Published

cssg-plugin-grow

Provides support for the grow static site generator.

This plugin handles some common configuration requirements when using the grow static site generator.

  • Prepends a $ in the yaml front matter to 'special' internal fields like slug, title, date, etc. (slug -> $slug) so they will be processed by grow.
  • Writes blueprint.yml files for the content-types configured in the typeConfig setting.
  • Resolves links to other entries using grow's yaml constructors. See https://grow.dev/reference/documents/#constructors

Install

npm install @jungvonmatt/cssg-plugin-grow

How to use

// In your contentful-ssg.config.js
plugins: [
  {
    resolve: `@jungvonmatt/cssg-plugin-grow`,
    options: {
      // Add any options here
    },
  },
];

Options

Name Type Default Description
typeConfig Object undefined Pass a map with e.g. grow's blueprint config ({: {$path: '...', $view: '...'}})

For example, to mark the content types t-category and t-article as documents which require a blueprint config:

// In your contentful-ssg.config.js
plugins: [
  {
    resolve: `@jungvonmatt/cssg-plugin-grow`,
    options: {
      typeConfig: {
        't-category': {
          view: '/views/t-category.html',
          path: '/{locale}/{slug}/',
        },
        't-article': {
          view: '/views/t-article.html',
          path: '/{locale}/{slug}/',
        },
      },
    },
  },
];

Readme

Keywords

none

Package Sidebar

Install

npm i @jungvonmatt/cssg-plugin-grow

Weekly Downloads

0

Version

1.14.0

License

MIT

Unpacked Size

16.7 kB

Total Files

8

Last publish

Collaborators

  • jvm-tech
  • peter.klostermann
  • bezoerb
  • sebil