Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
An extremely simple, pluggable static site generator for Node.js.
Metalsmith is an extremely simple, pluggable static site generator for Node.js that turns a source directory of files into a static site by running them through a chain of plugins.
Metalsmith is an extremely simple, pluggable static site generator for Node.js. It reads all files in a source directory, invokes a series of plugins that manipulate the files, and writes the results to a destination directory. The core library contains no built-in templating or file processing logic; everything is handled by plugins, which are JavaScript functions that can transform file contents and metadata. Metalsmith is open-source software on GitHub, licensed under MIT.
contents and arbitrary metadata.metalsmith.json file for the CLI, which supports building sites similar to Jekyll or Hexo.@metalsmith/markdown, @metalsmith/layouts, @metalsmith/collections, @metalsmith/permalinks, and @metalsmith/drafts; a full registry is at metalsmith.io/plugins..env() and set global template variables via .metadata().clean option ensures the destination directory is emptied before each build.Static site developers — Build blogs and marketing sites using Markdown content and layout templates, with collections for grouping posts and permalinks for clean URLs.
Developers wanting a Jekyll-like workflow — Define source, destination, and plugin configuration in a metalsmith.json file and run the metalsmith CLI without writing custom JavaScript.
Power users who need full control — Write your own plugins as plain JavaScript functions to transform any part of the file tree, since the plugin API is exactly a function taking files, the Metalsmith instance, and a callback.
Project scaffolders — The documented examples use Metalsmith to generate project directories from templates, so it works beyond static websites.
Metalsmith works in three steps: first it reads all files in the configured source directory, then it runs each registered plugin in sequence over the file list, and finally it writes the resulting files to the destination directory. Each file can have YAML front-matter that gets attached as metadata (for example, title and date), and the file contents are stored as a Buffer in the contents property. Plugins can inspect and mutate this data however they need.
Yes, Metalsmith is free and open-source software. It is released under the MIT license, so you can use, modify, and distribute it freely.
Set the DEBUG environment variable for Metalsmith's built-in debugger by calling metalsmith.env('DEBUG', '*metalsmith*') in your script. For plugins that use the debug package directly, run the build with DEBUG=metalsmith-*,@metalsmith/* (on Linux) or the equivalent Windows set command.
Metalsmith 2.7.x supports Node.js versions 16.0.0 and higher. Earlier releases support older Node versions, with 2.3.0 and below supporting Node 0.12 and up. The project follows the oldest supported LTS releases for future versions.
Yes, but without plugins Metalsmith just copies files from the source directory to the destination directory. All actual processing — markdown conversion, templating, collections, permalinks — comes from plugins.
Yes, Metalsmith is supported on all common operating systems, as stated in its compatibility policy.
