PHPackages                             settermjd/mezzio-markdown-blog - 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. settermjd/mezzio-markdown-blog

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

settermjd/mezzio-markdown-blog
==============================

This is a file-based blog module for PHP's Mezzio framework that renders blog articles written in Markdown format, with YAML front-matter into HTML content that can be rendered in a template.

2.2.3(5mo ago)9165[8 issues](https://github.com/settermjd/mezzio-markdown-blog/issues)BSD-3-ClausePHPPHP ~8.3.0||~8.4.0CI failing

Since Jan 7Pushed 5mo ago3 watchersCompare

[ Source](https://github.com/settermjd/mezzio-markdown-blog)[ Packagist](https://packagist.org/packages/settermjd/mezzio-markdown-blog)[ Fund](https://funding.communitybridge.org/projects/laminas-project)[ RSS](/packages/settermjd-mezzio-markdown-blog/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (38)Versions (31)Used By (0)

[![PHP QA Workflow](https://github.com/settermjd/mezzio-markdown-blog/actions/workflows/php-qa.yml/badge.svg)](https://github.com/settermjd/mezzio-markdown-blog/actions/workflows/php-qa.yml/badge.svg)

Mezzio Markdown Blog
====================

[](#mezzio-markdown-blog)

This is a basic blog module for Mezzio applications, allowing you to get up and running with a blog in your applications pretty quickly.

How it works
------------

[](#how-it-works)

When installed, the module adds two routes to the application's routing table.

### One to list all of the available blog items

[](#one-to-list-all-of-the-available-blog-items)

Using the path `/blog[/{current:\d+}]`, by default it lists the first page of the blog index. However, if a page number is supplied `current`, then that page of the blog will be displayed. Alternatively, the user can move forward and backward through pages of the blog by using the pagination links at the bottom of the current page. It converts a series of Markdown files with Yaml front-matter into an array of `BlogArticle` entities, which are then rendered as HTML.

### One to view individual blog items

[](#one-to-view-individual-blog-items)

Using the path `/blog/item/{slug}`, this route displays a blog item with the slug provided. In addition to being able to view the matching blog item, a listing of one or more blog items that are related to the current item are also available, if any matches are available.

### What do the Markdown files look like?

[](#what-do-the-markdown-files-look-like)

Here is a sample article, so that you know, roughly, what to expect.

```
---
publish_date: 13.07.2025
slug: episode-0001
synopsis: In this blogArticle, I have a fireside chat about one of my all-time favorite books, The Mythical Man Month.
title: Talking about The Mythical Man Month.
categories:
  - software development
tags:
  - Books
  - Mythical Man Month
---

### Synopsis

Suspendisse viverra mauris ac urna gravida, vel malesuada dolor interdum. Nullam ultrices urna erat, non venenatis turpis placerat eget. Etiam vitae magna non tortor congue volutpat. Integer ut ornare ante. Etiam hendrerit vehicula turpis, sit amet pulvinar nunc dictum eu. In tincidunt sollicitudin eros, quis ultrices turpis maximus ut. Ut eu erat eget magna congue ornare vel et tortor. Curabitur laoreet neque et ex aliquet tempus.

### Related Links

- [The Mythical Man Month (on Wikipedia)][mythical-man-month-book-url]
```

Usage
-----

[](#usage)

The package is designed to be used as part of [Mezzio](https://docs.mezzio.dev/mezzio/)-based applications, and goes to a lot of effort to make doing so as simple as possible.

### Install the package

[](#install-the-package)

To install the package, use Composer (just as you would install any other package) by running the following command:

```
composer require settermjd/mezzio-markdown-blog
```

During installation, the project's `ConfigProvider` will be loaded into *config/config.php*, loading all of the required dependencies, routes, and template paths. Given that, most of the work is done for you, including registering the routes and accompanying handlers for:

- **Listing all blog articles** (the blog index page) – with pagination. The route is `/blog`.
- **Viewing individual blog articles.**The route is `/blog/article/{slug}`.

### Set up the articles directory

[](#set-up-the-articles-directory)

There is no way to create the articles (posts) directory as part of the installation process, so you need to do this yourself. So, in the *data* directory, create a new directory named *posts*. The path needs to match the `path` element that you set in the application's configuration, outlined in the previous section.

Note

In a future version, there will be tooling to automate this.

### Override the default templates

[](#override-the-default-templates)

The next thing that you need to do is to override the blog templates. There are default versions in the project's *templates/blog* directory. But these are quite generic and only meant as a way of quickly getting you started. They're not designed to be a professional design for every application.

The three templates are:

- *blog.html.{{your view renderer extension}}*. This template is the blog index page that renders all of the available articles or posts for your blog.
- *blog-article.html.{{your view renderer extension}}*. This template renders details of a specific blog post when it is viewed.
- *includes/pagination.html.{{your view renderer extension}}*, e.g., *includes/pagination.html.twig*. This is the pagination template which is called by the blog index template, so that users can step through the available blog records a page at a time.

Note

There are three versions of each template:

- One for [Twig](https://twig.symfony.com/)
- One for [laminas-view](https://docs.laminas.dev/laminas-view/)
- One for [Plates](https://platesphp.com/)

### Update the application's configuration (*optional*)

[](#update-the-applications-configuration-optional)

If you want or need to, you can also update the module's configuration as well.

By default, its configuration is set in `Settermjd\MarkdownBlog\ConfigProvider`. However, you can override this by copying the default configuration file, *config/autoload/blog.local.php* to the application's *config/autoload* directory. You can find documentation for each option in both the config file and in `Settermjd\MarkdownBlog\ConfigProvider`.

### When using Twig as your view renderer

[](#when-using-twig-as-your-view-renderer)

If you use Twig as your view renderer, while you don't need to, you can create more feature-rich templates by installing [PHP's Intl extension](https://www.php.net/manual/en/intro.intl.php), and the [twig/markdown-extra](https://github.com/twigphp/markdown-extra) and [twig/intl-extra](https://github.com/twigphp/intl-extra) packages.

After installing PHP's Intl extension using your package manager or from source, install the two Twig packages using the following command:

```
composer require twig/intl-extra twig/markdown-extra
```

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance51

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity78

Established project with proven stability

 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 ~52 days

Recently: every ~16 days

Total

28

Last Release

178d ago

Major Versions

0.0.1 → 1.0.02022-04-01

1.0.19 → 2.0.02025-08-14

PHP version history (7 changes)0.0.1PHP ^7.4 || ~8.0.0

1.0.4PHP ~7.4.0 || ~8.0.0 || ~8.1.0

1.0.6PHP ~7.4.0 || ^8.0.0

1.0.15PHP ~8.1.0

1.0.16PHP ~8.1.0||~8.2.0||~8.3.0

1.0.17PHP ~8.1.0||~8.2.0||~8.3.0||~8.4.0

2.0.0PHP ~8.3.0||~8.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d4c6c662daf6b4a9742c59d0a72c069633a9772c831ecc1de7a2926ee4d8d95?d=identicon)[settermjd](/maintainers/settermjd)

---

Top Contributors

[![settermjd](https://avatars.githubusercontent.com/u/196801?v=4)](https://github.com/settermjd "settermjd (134 commits)")

---

Tags

psrpsr-7middlewarePSR-11htmlmarkdownpsr-15mezzioblog

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/settermjd-mezzio-markdown-blog/health.svg)

```
[![Health](https://phpackages.com/badges/settermjd-mezzio-markdown-blog/health.svg)](https://phpackages.com/packages/settermjd-mezzio-markdown-blog)
```

###  Alternatives

[mezzio/mezzio-skeleton

Laminas mezzio skeleton. Begin developing PSR-15 middleware applications in seconds!

12726.2k](/packages/mezzio-mezzio-skeleton)[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[php-middleware/php-debug-bar

PHP Debug Bar PSR-15 middleware with PSR-7

76433.5k2](/packages/php-middleware-php-debug-bar)[mezzio/mezzio-tooling

Migration and development tooling for Mezzio

191.1M21](/packages/mezzio-mezzio-tooling)

PHPackages © 2026

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