@flatbread/transformer-yaml
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.7 • Public • Published

@flatbread/transformer-yaml 🐪

Transform YAML files into content that can be fetched with GraphQL.

💾 Install

Use pnpm, npm, or yarn:

pnpm i @flatbread/transformer-yaml

👩‍🍳 Usage

Pair this with a compatible source plugin in your flatbread.config.js file:

// flatbread.config.js
import defineConfig from '@flatbread/config';
import transformer from '@flatbread/transformer-markdown';
import filesystem from '@flatbread/source-filesystem';

export default defineConfig({
  source: filesystem(),
  transformer: transformer(),
  content: [
    {
      path: 'content/posts',
      collection: 'Post',
      refs: {
        authors: 'Author',
      },
    },
    {
      path: 'content/authors',
      collection: 'Author',
      refs: {
        friend: 'Author',
      },
    },
  ],
});

Options

This transformer plugin currently does not accept any config options. It supports all valid yaml syntax flavors by default.

Refer to your source plugin's documentation for the relevant content Flatbread config option.

If you're using a CMS like NetlifyCMS, you'll want to pair this with the source-filesystem plugin.

Readme

Keywords

none

Package Sidebar

Install

npm i @flatbread/transformer-yaml

Weekly Downloads

0

Version

1.0.0-alpha.7

License

MIT

Unpacked Size

5.83 kB

Total Files

5

Last publish

Collaborators

  • tonyketcham