A 10,000 Foot Overview of Jigsaw

April 25, 2020

At this point, I've spent a lot of time with Jigsaw. Let's talk about it!

What is Jigsaw?

If you search "Jigsaw" on Google, you might come up with the following:

  • The 2017 horror film called "Jigsaw."
  • Free online jigsaw puzzles!
  • "A unit within Alphabet that forecasts and confronts emerging threats, creating future-defining research and technology to keep our world safer." Don't believe me? Take a look for yourself!
  • Jigsaws for sale from the Home Depot.

As much as I want to go look deeper into Alphabet's global taskforce, the REAL Jigsaw that I want to talk about was built by Tighten.

Jigsaw is a quick and easy way to generate static websites using familiar PHP tooling (including a version of Laravel's collections, except for static files)! And boy, they aren't lying when they say building sites with Jigsaw is quick--it's incredible how fast I've been able to go from nothing to a fully-responsive and interactive static website. Everything, from the set-up to the building to the deployment, is lightning quick.

What do I need to build a Jigsaw site?

The requirements to use Jigsaw are so simple it hurts. Coming right from the docs, here are the official system requirements:

That's it. That's the entire suite of tools and languages that you need to build a site with Jigsaw. No fancy system extensions or libraries, no intricate databases or scripts to wrangle; just simple PHP, Composer, and NPM.

I'm not going to walk through the entire documentation site here (you can do that yourself if you're interested), but I will spotlight one specific thing. Once you have the system requirements taken care of, going from nothing to a full Jigsaw install takes three steps. Three. 1, 2, 3. If that's not fast and simple, I don't know what is.

What makes Jigsaw so cool?

There's so much that makes Jigsaw my go-to static site generator, but these are a few of the things that immediately piqued my interest!

Laravel-like tooling

First and foremost, just like it says on the tin, the fact that I can use all the same tooling that I'm used to as a Laravel developer is just fantastic. After years of writing Laravel applications, the tooling is practically second nature, so not having to worry about learning something new is a godsend. I'm all for learning new things (I love learning), but sometimes I need to buckle down and create an actual product.

Collections

One of the best parts of the Laravel tooling is how it handles Collections. While building Jigsaw, Tighten has managed to recreate the Laravel Collections API, but for manipulating static files instead of data in a PHP array. Truth be told, it's nothing short of a miracle. It's a perfect solution for managing all of the posts (or anything else!) that I need in a static site. Almost everything on this site is built using collections: posts, snippets, and even the navbar links!

Markdown integration

I don't know about you, but I love Markdown. Maybe it's the Vim-lover in me, but I love how quickly I get my ideas into a formatted document when I'm using Markdown. More and more, I want to only move my hands off of the keyboard when absolutely necessary, so I've been using Markdown in most of the things I write.

Thankfully, Jigsaw has a deep Markdown integration that I can use to generate all sorts of content on a Jigsaw site. It's already handy enough that Jigsaw lets me embed Markdown content inside of a Blade template (that's how you're seeing this blog post), but Tighten has also created an unusual hybrid of Blade and Markdown templates that can bring interesting functionality to a typical Markdown file.

Instead of creating just a pure Markdown file, Jigsaw gives you the option to create a .blade.md file. This filetype gets run through the Blade parser first, and then through the Markdown parser, allowing you to use Blade control structures WITHIN Markdown.

There's so much more I could go into about Jigsaw, and maybe at some point, I can go into more detail, but I hope this piqued your interest for Jigsaw! If you're a Laravel or PHP developer already and you want a fast, simple static site generator, I highly recommend giving Jigsaw a try.

Want to keep the conversation going? Hit me up on Twitter and tell me what you think about Jigsaw! Is it something useful for you and your projects, or will you probably never touch it?

The Links

Join my mailing list!

No spam, just a weekly newsletter with thoughts, discoveries, and cool new things in the world of programming.

subscribe.