A Metalsmith plugin to create content from a Typewriter account.
$ npm install metalsmith-typewriter
Install via npm and then add the metalsmith-markdown
key to your metalsmith.json
plugins with the username/project/template options.
{
"plugins": {
"metalsmith-typewriter": {
"username": "example_username",
"project": "example_project",
"template": "jade",
"templatesPath": "./src/templates"
}
}
}
username
: Your Typewriter usernameproject
: The Typewriter project you want to pull data fromtemplate
: The template extension you are using (e.g. html or jade)templatesPath
: The path to your template directory where the plugin will look for files to use for building each page/type
The plugin looks for valid templates for each page/type based on slug, type name, or project name -- otherwise defaulting to page.jade
The plugin generates markdown and as such depends on the metalsmith-markdown plugin to generate pages, as well as metalsmith-templates.
- Use metalsmith layouts, since metalsmith-templates is obsolete
- Remove dependencies on other metalsmith plugins where possible
- Cache fetches unless explicitly indicated