Metalsmith is an extremely simple, pluggable static site generator.
Overview
Metalsmith is a pluggable static site generator.
All its is handled by plugins. You simply chain them together.
Example for a simple blog :
Metalsmith(__dirname)
.use(markdown())
.use(templates('handlebars'))
.build();
Here is a list of the available plugins :
- AUTOPREFIXER : Automatically add vendor prefixes to CSS.
- ASSETS : Include static assets in your build.
- BRANCH : Run separate metalsmith pipelines on selected files.
- BUILD DATE : Add a build date, for things like feeds or sitemaps.
- CLEAN SCRIPT : Generate a script to cleanup the build directory, if you are adding more than just Metalsmith files.
- COLLECTIONS : Group files together, like blog posts. That way you can loop over them to generate an index, or add 'next' and 'previous' links between them.
- COFFEE : Compile CoffeeScript files to Javascript.
- COPY : Copy and rename files.
- DRAFTS : Hide any files marked as drafts.
- ENCODE HTML : Easily encode HTML entities in any HTML file by surrounding target code in triple backticks.
- EXCEPT : Omit attributes from each file's metadata.
- EXCERPTS : Extract the first paragraph from the beginning of any Markdown file.
- FILE METADATA : Add metadata on files based on a pattern
- FINGERPRINT : Insert a hash of the content into the file name.
- GULPSMITH : Use Gulp plugins in Metalsmith, or Metalsmith as a Gulp plugin. Useful for uploading files, reading less than an entire directory tree, using external front matter, etc.
- HEADINGS : Extract headings from HTML files and attach them to the file's metadata. Useful for automatically building navigation for a document.
- IGNORE : Ignore any files that match a pattern.
- INCLUDE : Make other source files available as properties.
- LESS : Convert LESS files to CSS.
- MARKDOWN : Convert Markdown files to HTML.
- METADATA : Load metadata from JSON or YAML files.
- MORE : Stores the content before the "more" comment tag in HTML files.
- ONLY : Filter out attributes from each file's metadata.
- PAGINATE : A simple plugin that uses metalsmith-collections to create a paginated collection.
- PERMALINKS : Apply custom permalinks and rename files to be nested properly for static sites, basically converting about.html into about/index.html.
- PROMPT : Prompt the user for series of answers in the command line and add them to the global metadata.
- REPLACE : Replace attribute values in each file's metadata.
- SASS : Convert Sass files to CSS.
- SHORTCODES : Render wordpress-esque shortcodes via templates.
- STATIC : Copy public assets into the build directory.
- STYLUS : Convert Stylus files to CSS.
- TITLE : Automatically generate a page title from first heading in each file.
- TEMPLATES : Render any file through a templating engine of your choice.
- UGLIFY : Uglifies/minifies your JavaScript files
- WATCH : Watching for file changes and trigger rebuilds.
- WEBPACK : Bundle CommonJS, AMD and ES6 modules.