A lightweight yet powerful blog system built with Laravel and Markdown. Easily manage your content using Markdown files with YAML front matter metadata for titles, categories, tags, authors, and more.
- Name: TuanTQ
- Email: quoctuanit2018@gmail.com
- GitHub: tqt97
- 📝 Write posts in Markdown with YAML front matter.
- 📂 Organize content by category, tags, and author.
- 🔑 Automatic slug & UUID key generation.
- 🌓 Support for draft & published modes.
- 🎨 Customizable post templates for faster writing.
- ⚡ Simple CLI command to generate new posts.
- 🔍 SEO-friendly URL structure.
- 🌍 Easy deployment on any Laravel-supported environment.
- Backend: Laravel 12+
- Content: Markdown (
.md) with YAML front matter - Storage: Local file system (
prezet/content/) - CLI Tool: Artisan commands for content generation
- SEO: Auto-generated slugs & meta information
Every .md file starts with a YAML block for metadata:
---
title: Hello World
excerpt: This is a short description of the post.
category: Laravel
image: /prezet/img/laravel.jpg
draft: false
date: 2025-08-24
author: bob
slug: hello-world
key: 92d0f1d3-a9e1-4952-9060-ade1ea6f0061
tags: ['laravel', 'js']
---
Content go here!php artisan make:content "Hello World"This will create:
prezet/content/hello-world.md- Custom path
php artisan make:content "Hello World" --path=prezet/content/blog- Category
php artisan make:content "Hello World" --category=Laravel- Author
php artisan make:content "Hello World" --author=jane- Tags (pass as an array string)
php artisan make:content "Hello World" --tags="['laravel','php','vue']"- Draft mode
By default, new files are created with
draft: true. To create a published file:
php artisan make:content "Hello World" --draft=falsephp artisan make:content "A PHP framework with a robust ecosystem" --path=prezet/content/frameworks --category=Laravel --author=bob --tags="['laravel','php']" --draft=falseThis generates a file:
---
title: A PHP framework with a robust ecosystem
excerpt:
category: Laravel
image: null
draft: false
date: 2025-08-24
author: bob
slug: a-php-framework-with-a-robust-ecosystem
key: 4f3c12ab-1234-4bcd-9f11-88a99e22c0d5
tags: ['laravel','php']
---
Content go here!This project includes a built-in translation management system, allowing you to provide multilingual versions of your content.
- When you visit a post, you can append
/translateto the URL to view the translation creation page (e.g.,http://your-site.com/my-first-post/translate). - Submitted translations are stored in the main application database.
- If a published translation exists for a given language, visiting the post with the correct locale will show the translated version.
Project uses an SQLite index file to more efficiently query information about your markdown content. This index is crucial for features like pagination, sorting, and filtering of your blog posts or documentation pages.
php artisan prezet:indexYou should run this command whenever you:
- Add a new markdown file
- Change a markdown file's slug
- Modify frontmatter and want to see those changes reflected on index pages
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.
php artisan prezet:index --fresh--fresh option that will create a new sqlite
database and run the prezet migrations before inserting your markdown
data. You should run this command whenever you:
- Update to a new version of Prezet
- Are creating an index in a CI/CD pipeline
- Deploy your application to an environment where the index sqlite file is not already present
The index is updated automatically in your local development environment when you run:
npm run devFor production, you should configure a cron job to run the Laravel scheduler, which will periodically update the index for you.
To automate indexing in production, add a single cron entry to your server. This job will run the Laravel scheduler every minute.
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1The scheduler will then execute the prezet:index command based on the schedule defined in your .env file (e.g., PREZET_INDEX_SCHEDULE=everyThirtyMinutes).
The sitemap is automatically generated whenever you run the index update command:
php artisan prezet:indexThis command not only updates the content index but also creates or updates the prezet_sitemap.xml file in your Laravel project's public directory. This integration ensures that your sitemap always reflects the current state of your content.
- 📂 Default storage path is
prezet/content/. - 🆔
keyis generated as a UUID v4. - 📝
slugis automatically generated from the title. - 📅
datedefaults to the current day (Y-m-d).
from https://github.com/tqt97/laravel-prezet-blog
( https://github.com/ymbrite/laravel-prezet-blog )
No comments:
Post a Comment