PHPackages                             lordoffreaks/puzzle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. lordoffreaks/puzzle

ActiveLibrary[HTTP &amp; Networking](/categories/http)

lordoffreaks/puzzle
===================

Simple static sites with Laravel's Blade + Grunt + REST server.

0.3.5(9y ago)0327MITApacheConfPHP &gt;=5.4.0

Since Jan 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/lordoffreaks/puzzle)[ Packagist](https://packagist.org/packages/lordoffreaks/puzzle)[ Docs](http://github.com/lordoffreaks/puzzle)[ RSS](/packages/lordoffreaks-puzzle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (8)Used By (0)

Puzzle
======

[](#puzzle)

Puzzle is a simple static sites generator which also provides the oportunity to use REST endpoints for your forms (or any other type of endpoint you want to use).

Uses [Jigsaw](https://github.com/tightenco/jigsaw) to provide a template engine as Laravel's [Blade](http://laravel.com/docs/5.0/templates)and compile the resources to a static site.

Uses [Grunt](http://gruntjs.com/) to automate tasks providing an effortless development experience and optimal frontend.

### Getting Started

[](#getting-started)

#### Installing Globally

[](#installing-globally)

1. Install Puzzle globally via Composer:

    `$ composer global require lordoffreaks/puzzle`

    > Make sure `~/.composer/vendor/bin` is in your `$PATH`.
2. Initialize a new project:

    `$ puzzle init my-site`

#### Installing Locally

[](#installing-locally)

If you run into dependency conflicts when trying to install Puzzle globally, you can always install it locally on a per site basis.

1. Create a folder for your site:

    `$ mkdir my-site && cd my-site`
2. Install Puzzle via Composer:

    `$ composer require lordoffreaks/puzzle`
3. Initialize a new project in the current folder:

    `$ ./vendor/bin/puzzle init`

### Building your first site

[](#building-your-first-site)

Building a Puzzle site is exactly like building a static HTML site, except that files ending in `.blade.php` will be rendered using Laravel's [Blade Templating Language](http://laravel.com/docs/5.0/templates).

Build out your site however you like in the `/source` directory. It might look something like this:

```
├─ source
│  ├─ _assets
│  ├─ _layouts
│  │  └─ master.blade.php
│  ├─ img
│  │  └─ logo.png
│  ├─ about-us.blade.php
│  └─ index.blade.php
└─ config.php

```

When you'd like to build it, run the `build` command from within your project root:

`$ puzzle build`

Your site will be built and placed in the `/build_local` directory by default.

Using the example structure above, you'd end up with something like this:

```
├─ build_local
│  ├─ about-us
│  │  └─ index.html
│  ├─ img
│  │  └─ logo.png
│  └─ index.html
├─ source
└─ config.php

```

To quickly preview it, start a local PHP server:

`$ php -S localhost:8000/ -t build_local`

#### Layouts

[](#layouts)

One of the biggest benefits of a templating language is the ability to create reusable layouts.

Since it's important that a layout is never rendered on it's own, you need to be able to tell Jigsaw when a file shouldn't be rendered.

To prevent a file or folder from being rendered, simply prefix it with an underscore:

```
├─ source
│  ├─ _layouts
│  │  └─ master.blade.php # Not rendered
│  └─ index.blade.php     # Rendered
└─ config.php

```

#### Config variables

[](#config-variables)

Anything you add to the array in `config.php` will be made available as a variable in your templates.

For example, if your config looks like this...

```
return [
    'contact_email' => 'support@example.com',
];
```

...you can use that variable in your templates like so:

```
@extends('_layouts.master')

@section('content')
    Contact us at {{ $contact_email }}
@stop

```

#### Environments

[](#environments)

You might have certain configuration variables that need to be different in different environments, like a Google Analytics tracking ID for example.

Puzzle lets you specify a different configuration file for each environment to handle this.

To create an environment-specific config file, just stick your environment name in front of the file extension:

`config.production.php`

To build your site for a specific environment, use the `--env` option:

`$ puzzle build --env=production`

Each environment gets it's own `build_*` folder, so in this case your site will be placed in `build_production`.

> Note: Environment-specific config files are *merged* with the base config file, so you don't have to repeat values that don't need to change.

#### Pretty URLs

[](#pretty-urls)

Puzzle will automatically take any Blade files *not* named `index` and render them as `index.html` in a subfolder with the same name as the original file.

For example, if you have a file named `about-us.blade.php` in your `source` directory:

```
├─ source
   ├─ _layouts
   ├─ about-us.blade.php
   └─ index.blade.php

```

...it will be rendered as `index.html` in the `build/about-us` directory:

```
├─ build_local
   ├─ about-us
   │  └─ index.html
   └─ index.html

```

> If you need to disable this behavior, use the `--pretty=false` option when building your site.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~69 days

Recently: every ~104 days

Total

7

Last Release

3343d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/43fc8bd773f78a9dc92c563688049de72f794cbf312d56ce8219a3d0262db0ca?d=identicon)[lord\_of\_freaks](/maintainers/lord_of_freaks)

---

Top Contributors

[![lordoffreaks](https://avatars.githubusercontent.com/u/953337?v=4)](https://github.com/lordoffreaks "lordoffreaks (11 commits)")

---

Tags

laravelrestgeneratorbladestaticsitegrunt

### Embed Badge

![Health badge](/badges/lordoffreaks-puzzle/health.svg)

```
[![Health](https://phpackages.com/badges/lordoffreaks-puzzle/health.svg)](https://phpackages.com/packages/lordoffreaks-puzzle)
```

###  Alternatives

[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[mrdebug/crudgen

Create a Laravel Crud in a few seconds

31826.8k](/packages/mrdebug-crudgen)[aschmelyun/cleaver

A blazing-fast static site generator using Laravel's Blade templating engine

2961.0k](/packages/aschmelyun-cleaver)[tomatophp/filament-api

Generate APIs from your filament resource using single line of code

507.1k1](/packages/tomatophp-filament-api)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
