The Static Site Generator Jigsaw Launched V1.0

Published on by

The Static Site Generator Jigsaw Launched V1.0 image

Jigsaw, a static site generator, made by Tighten just tagged and launched v1.0 that includes the addition of Collections. These allow you to work with a list of related content, like blog posts, a portfolio of your work, staff bios, and more.

Just like the earlier version Jigsaw still runs on Blade, so you get to continue using the familiar syntax you are used to when building out your templates. That paired with Markdown content makes it super friendly to create the content you need.

“Like the core of Jigsaw itself, collections are designed to be as simple as possible to implement,” Keith Damiani said in the release announcement, “while at the same time giving you the power and flexibility to build some pretty advanced sites.”

Here it the config example for setting up a new set of Collections:

return [
'company' => 'Tighten Co',
'contact_email' => 'support@tighten.co',
'collections' => [
'people' => [
'path' => 'people',
'sort' => 'last_name',
],
'posts' => [
'path' => 'blog/{date|Y-m-d}/{filename}',
'author' => 'Tighten Co.',
],
],
];

In this sample, the “people” are sorted by last_name which would be defined in the Markdown files YAML front matter. Then the “posts” uses a dynamic folder path with the date stamp and a default author of Tighten Co., which is a fallback from the YAML front matter.

Jigsaw Pagination

V1.0 also comes with a pagination system that is defined directly in your Blade file:

// posts.blade.php
---
pagination:
collection: posts
perPage: 5
---
@extends('_layouts.master')

Then your view has access to a $pagination object with everything you need for creating advanced pagination.

Jigsaw Variables and Helpers

I briefly touched on variables above where the “posts” collection had a fallback author if one wasn’t defined in the YAML front matter. To add to this is a new helper functions system that can be utilized right in the config file:

return [
'excerpt' => function ($page, $characters = 100) {
return substr($page->getContent(), 0, $characters);
},
'collections' => [
'posts' => [
'excerpt' => function ($page, $characters = 50) {
return substr(strip_tags($page->getContent()), 0, $characters);
},
],
],
];

In this example, the first excerpt limits the characters to a default of 100, and in the “posts” collection it overrides the first by stripping HTML tags and defaulting to limiting just 50 characters.

Conclusion

When I first looked at Jigsaw back in December of 2015 I was excited about the possibilities because of everything just felt easy. With Blade it had the template syntax I was comfortable with, which meant I didn’t have to learn yet another template system; it utilizes Gulp and Elixir and even carries a jigsaw console command similar to Artisan.

With the addition of Collections this static site generator will be a fantastic tool to use for the next site you build or even your blog. For more details on Jigsaw, you can read Tighten’s release announcement and visit the official site.

Eric L. Barnes photo

Eric is the creator of Laravel News and has been covering Laravel since 2012.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project.

Visit No Compromises
Laravel Forge logo

Laravel Forge

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Forge
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $7500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Lucky Media logo

Lucky Media

Bespoke software solutions built for your business. We ♥ Laravel

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
LaraJobs logo

LaraJobs

The official Laravel job board

LaraJobs
Larafast: Laravel SaaS Starter Kit logo

Larafast: Laravel SaaS Starter Kit

Larafast is a Laravel SaaS Starter Kit with ready-to-go features for Payments, Auth, Admin, Blog, SEO, and beautiful themes. Available with VILT and TALL stacks.

Larafast: Laravel SaaS Starter Kit
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Rector logo

Rector

Your partner for seamless Laravel upgrades, cutting costs, and accelerating innovation for successful companies

Rector

The latest

View all →
Anonymous Event Broadcasting in Laravel 11.5 image

Anonymous Event Broadcasting in Laravel 11.5

Read article
Microsoft Clarity Integration for Laravel image

Microsoft Clarity Integration for Laravel

Read article
Apply Dynamic Filters to Eloquent Models with the Filterable Package image

Apply Dynamic Filters to Eloquent Models with the Filterable Package

Read article
Property Hooks Get Closer to Becoming a Reality in PHP 8.4 image

Property Hooks Get Closer to Becoming a Reality in PHP 8.4

Read article
Asserting Exceptions in Laravel Tests image

Asserting Exceptions in Laravel Tests

Read article
Reversible Form Prompts and a New Exceptions Facade in Laravel 11.4 image

Reversible Form Prompts and a New Exceptions Facade in Laravel 11.4

Read article