Ajedi32 / metalsmith-metafiles

A Metalsmith plugin to read file metadata from separate files (as an alternative to frontmatter)
MIT License
6 stars 2 forks source link

Epic: Add full suite of config options / support for multiple data formats #2

Closed Ajedi32 closed 8 years ago

Ajedi32 commented 9 years ago

Make this work:

metafile({
  prefix: "",
  postfix: ".meta",
  deleteMetaFiles: true,
  parsers: {
    ".cson": false, // Disable
    ".json": true, // Enable
    ".yaml": "js-yaml", // Specify parser
    ".toml": {
      "parser": "toml-node",
      // Override global attributes
      "postfix": "",
      "prefix": "meta-",
      "deleteMetaFiles": false
    },
    ".js": function(content) { return eval(content); } // Custom parser
  }
});
Ajedi32 commented 8 years ago

Almost done. All there is to do now is add CSON and TOML support.

Ajedi32 commented 8 years ago

The example above now works! (Except that the toml parser is just called toml.) Closing.