Skip to content

benbjurstrom/prezet

Repository files navigation

PREZET

Prezet: Markdown Blogging for Laravel

Go from markdown files to SEO-friendly blogs, articles, and documentation in seconds!

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status PHPStan Level 9

prezethd.mov

Table of contents

🌟 Features

βœ… Installs in seconds
Set up your project with a single command.

βœ… Automatic Image Optimization
Automated image compression, scaling, and responsive srcset handling.

βœ… SQLite Index
Indexes your markdown files to support search, pagination, sorting, and filtering.

βœ… Validated Front Matter
Cast front matter into validated DTOs for consistency across your content.

βœ… Open Graph (OG) images
Generate OG images from front matter using a customizable template.

βœ… Dynamic Table of Contents
Automatically generate a nested, scroll-synced TOC from your article's headings.

βœ… SEO Optimization
Automatically generate meta tags based on front matter data for better search engine discoverability.

βœ… Blade Components
Include Laravel Blade components in your markdown for enriched, interactive content.

βœ… Complete Customization
Prezet is built to allow full customization of your routes, front matter, and blade templates.

πŸš€ Quick start

Install the Prezet package:

composer require benbjurstrom/prezet

Run the package installer:

⚠️ NOTE: Before running the installer on an existing application it is recommended to switch to a clean branch so you can see the changes Prezet made during the installation process.

php artisan prezet:install

Update the index:

After adding or modifying your markdown files, you need to update the index to reflect these changes:

php artisan prezet:index

This command updates the SQLite index with the latest front matter information from your markdown files. Run this command whenever you:

  • Add a new markdown file
  • Change a markdown file's slug
  • Modify front matter and want to see those changes reflected on the index page

Note that changes to the main content of your markdown files don't require updating the index, as this content is read directly from the file when displaying a single post.

Start your server:

php artisan serve

Check out your new markdown blog at http://localhost:8000/prezet

Documentation

Detailed documentation available at prezet.com

Credits

License

The MIT License (MIT). Please see License File for more information.