Metalsmith is a lightweight, very flexible, and pluggable static site generator. It produces static build files that are built from the source files and ready to be deployed on a web server. It offers various templating engines that enable you to run the templating language on the static site generator and also on your content editing platform. This saves a lot of development time and consistency in the generated output. As a result, Metalsmith is highly used for creating sites such as blogs, technical documentation, and knowledgebase.
Metalsmith Integration Overview
Contentstack and Metalsmith Integration Setup
To integrate Metalsmith with Contentstack, perform the following steps. See the documentation for a more detailed step-by-step guide.
Create a StackThe first step is to create a stack. Log in to your Contentstack account and create a new stack that will hold all the data, specific to your website.
Add a Publishing EnvironmentTo let Metalsmith fetch content from Contentstack, you will have to publish your website content on a specific environment. Create a new environment to make your data accessible.
Import Content TypesThe next step involves creating a content type to create the structure or blueprint of a page or a section of your web or mobile property.
Add Content to Your Content TypeOnce your content type is ready, you need to add content to the entries of a content type and publish them on the environment that you created in step 2.
Set Up Metalsmith-ContentstackIn this step, you need to configure Metalsmith so that it works with Contentstackto fetch content published on your environment through Contentstack's Content Delivery API.
Build and Configure the WebsiteConfigure your website by providing your API Key, Access Token, and environment. This will help your website deliver data from Contentstack through its CDAPI that has built-in support for Content Delivery Network (CDN). Then install and build your website using the npm command.
You can release your application to the live environment by deploying it on any cloud-hosting service such as Heroku. And that's it!