Building static sites with Mozaik and Gatsby

by Peter Balazs on 21/02/2018

Gatsby source plugin

A couple of days ago we released a Gatsby source plugin that helps you connect Gatsby to Mozaik. You can find the package on npm.

Example project

We've also created an example project showing the plugin in work. You can find the source over Github, and a live demo deployed to Netlify. The example is built on a project using the Sample Blog template in Mozaik. As it would be quite tedious work to create every page for each post, we implemented automatic page generation as well. You can check the code in the gatsby-node.js file and read more about the concept in the Gatsby tutorial.

The built version gets deployed to Netlify every time new code is pushed to the repository. Since both Mozaik and Netlify supports webhooks in their free plan, it is easy to automatically trigger a new build every time a document gets published with Mozaik. (You can also trigger new builds on other events. You can read more about supported events in Mozaik documentation.

We hope you find this example easy to follow, and if you have any question join us on Slack, or message us on Twitter.