PHPackages                             phly/phly-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phly/phly-blog

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

phly/phly-blog
==============

Laminas Module implementing a static blog generator

2.1.1(5y ago)4780514[2 issues](https://github.com/phly/PhlyBlog/issues)[2 PRs](https://github.com/phly/PhlyBlog/pulls)PHPPHP ^7.3CI failing

Since Jul 13Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/phly/PhlyBlog)[ Packagist](https://packagist.org/packages/phly/phly-blog)[ Docs](https://github.com/phly/PhlyBlog)[ RSS](/packages/phly-phly-blog/feed)WikiDiscussions 2.2.x Synced today

READMEChangelog (5)Dependencies (20)Versions (13)Used By (0)

PhlyBlog: Static Blog Generator
===============================

[](#phlyblog-static-blog-generator)

> ⚠️ **Archived 2025-08-17**
>
> Use at your own risk.

This module is a tool for generating a static blog.

Blog posts are simply PHP files that create and return `PhlyBlog\EntryEntity` objects. You point the compiler at a directory, and it creates a tree of files representing your blog and its feeds. These can either be consumed by your application, or they can be plain old HTML markup files that you serve directly.

Requirements
------------

[](#requirements)

- PHP &gt;= `7.3`
- Laminas packages, notably:
    - [laminas/laminas-view](https://docs.laminas.dev/laminas-view/), used to render and write generated files.
    - [laminas/laminas-mvc](https://docs.laminas.dev/laminas-mvc/) and [laminas/laminas-modulemanager](https://docs.laminas.dev/laminas-modulemanager), as this implements a module, and the compiler script depends on it and a laminas-mvc `Application` instance. As such, it also has a dependency on [laminas/laminas-servicemanager](https://docs.laminas.dev/laminas/laminas-servicemanager) and [laminas/laminas-eventmanager](https://docs.laminas.dev/laminas/laminas-eventmanager).
    - [laminas/laminas-feed](https://docs.laminas.dev/laminas-feed/) for generating feeds.
    - [laminas/laminas-tag](https://docs.laminas.dev/laminas-tag) for generating tag clouds.
- [phly/phly-common](https://github.com/phly/PhlyCommon/) for Entity and Filter interfaces.

Installation
------------

[](#installation)

Use [Composer](https://getcomposer.org) to add this module to your application:

```
$ composer require phly/phly-blog
```

Writing Entries
---------------

[](#writing-entries)

Find a location in your repository for entries, preferably outside your document root; I recommend either `data/blog/` or `posts/`.

Post files are simply PHP files that return a `PhlyBlog\EntryEntity` instance. A sample is provided in `misc/sample-post.php`. This post can be copied as a template.

Important things to note:

- Set the created and/or updated timestamps. Alternately, use `DateTime` or `date()` to generate a timestamp based on a date/time string.
- Entries marked as "drafts" (i.e., `setDraft(true)`) will not be published.
- Entries marked as private (i.e., `setPublic(false)`) will be published, but will not be aggregated in paginated views or feeds. As such, you need to hand the URL to somebody in order for them to see it.
- You can set an array of tags. Tags can have whitespace, which will be translated to "+" characters.

### Usage

[](#usage)

This module provides [laminas/laminas-cli](https://docs.laminas.dev/laminas-cli/) tooling.

Run:

```
$ ./vendor/bin/laminas help phly-blog:compile
```

to get usage. Currently, the compilation tooling can generate the following artifacts:

- A file per entry
- Paginated entry files
- Paginated entry files by year
- Paginated entry files by month
- Paginated entry files by day
- Paginated entry files by tag
- Atom and/or RSS feeds for recent entries
- Atom and/or RSS feeds for recent entries by tag
- Optionally, a tag cloud

You will want to setup local configuration; I recommend putting it in `config/autoload/blog.global.php`. As a sample:

```
