ajedi32 / metalsmith-metafiles Goto Github PK
View Code? Open in Web Editor NEWA Metalsmith plugin to read file metadata from separate files (as an alternative to frontmatter)
License: MIT License
A Metalsmith plugin to read file metadata from separate files (as an alternative to frontmatter)
License: MIT License
.meta
is shorter than .metadata
, and just as clear in-context.
You can disable frontmatter parsing via the CLI in Metalsmith 2.1+. The README should be updated to recommend that in its examples.
Update package.json
to specify the versions of Node this plugin will work with.
Why choose this method over frontmatter? While frontmatter is a convenient way to set metadata in your files, it can cause problems with syntax hilighters, linters, and other tools which expect your source files to contain only valid syntax from the language they are written in. (Frontmatter isn't valid CSS, HTML, JavaScript, etc.) Putting your metadata in separate files eliminates these problems.
Need to set default parsers for the following:
https://www.npmjs.com/package/gray-matter
Abstracts the use of YAML, JSON, TOML, CoffeeScript, CSON, etc.
There's currently a lot of code duplication in the tests for this project. That's not necessarily a bad thing if it helps keep the tests readable, but I'd like to try refactoring to see if I can reduce code duplication somewhat.
Basically a way to make the plugin safe to use on untrusted site data.
Heya, not sure how to message you using github... I saw this metalsmith issue from your mention on this Jekyll Issue (with linting)
Thought I'd suggest you look at: GRAV
It's not (currently) a static site generator -- but its database-less, meaning some yaml files. Only requirement is PHP5.4. Its also very plugablle like metalsmith. In fact, no editing on the server by default, without a plugin. That said, its likely very easy to turn it into a static-site-generator with a plugin. Just thought I'd share. FWIW, they're using gitter for communication.
I'm actually not sure if exec
is the best parser for JS. Before the next major release, I need to examine if it's better to use exec
by default vs something like require
.
Receives as its arguments the Metafile object, and returns either "throw"
, "ignore"
, "delete"
depending on what it wants metalsmith-metafiles to do.
Hi there!
Is it possible to have multiple metafiles pointing to a single file? For example:
index.html
is the "host file". index.html.meta.json
is generic metadata. index.html.books.meta.json
would be found under the books
key for the index.html
file. Does that make sense?
Right now, if a metadata file is found which doesn't have a corresponding main file, it is simply ignored. We should throw an error instead. (Perhaps make it configurable?)
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
}
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.