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

Cleaver is a PHP static site generator that helps you rapidly develop websites using Laravel's Blade templating engine, JSON or Markdown content files and the utility-first Tailwind CSS library.

Version 1.4.1

composer create-project aschmelyun/cleaver your-site-name

Laravel Blade

Use the power of Blade to quickly craft templates and modularize your site code. Any Laravel veterans will feel right at home, while those inexperienced users should be able to pick up the easy syntax of the templating engine in no time.

Tailwind

Out of the box Cleaver includes the popular Tailwind CSS library. Using a utility-first approach to styling elements means less time tweaking elements on the front-end, letting you scaffold and prototype a website much faster.

JSON

Aiming for ease of use with data-driven pages, Cleaver gives you the ability to use JSON as content files. Each key's value is parsed out and accessible through the requested Blade template as a variable with the key name.

Markdown

For heavier content-driven pages, you have the ability to use Markdown content files as well. Key:value pairs for the layout, path, and others are taken as variables from the top section, while the rest of the markup is parsed as content.

content/blog.json
{
    "view": "layout.default",
    "path": "/blog",
    "title": "Welcome to my blog!",
    "posts": [
        {
            "title": "How to containerize your life",
            "link": "/blog/how-to-containerize-your-life"
        },
        {
            "title": "Using Tailwind on my smart fridge",
            "link": "/blog/using-tailwind-on-my-smart-fridge"
        }
    ]
}

First add in your content saved as either a JSON or Markdown file in the content directory.

layout/default.blade.php
<html lang="{{ $lang ?? 'en' }}">
<body>
    <h1 class="page-title">{{ $title }}</h1>
    @foreach($posts as $post)
        <div class="post">
            <h3 class="post-title">{{ $post->title }}</h3>
            <a href="{{ $post->link }}">Read More</a>
        </div>
    @endforeach
    <!-- Using markdown? Access content with {!! $content !!} -->
</body>
</html>

Then write your Blade template, using the keys from your content file as variables.

dist/blog/index.html
<html lang="en">
<body>
    <h1 class="page-title">Welcome to my blog!</h1>
    <div class="post">
        <h3 class="post-title">How to containerize your life</h3>
        <a href="/blog/how-to-containerize-your-life">Read More</a>
    </div>
    <div class="post">
        <h3 class="post-title">Using Tailwind on my smart fridge</h3>
        <a href="/blog/using-tailwind-on-my-smart-fridge">Read More</a>
    </div>
</body>
</html>

Finally Cleaver outputs your rendered HTML to the path that was set in your content, nested in the dist directory.

> Ready to get started? Check out the documentation.