PHPackages                             elazar/scribing - 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. elazar/scribing

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

elazar/scribing
===============

A simple static blog generator

0.6.0(8y ago)11225MITPHP

Since May 13Pushed 7y ago1 watchersCompare

[ Source](https://github.com/elazar/scribing)[ Packagist](https://packagist.org/packages/elazar/scribing)[ RSS](/packages/elazar-scribing/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (7)Versions (9)Used By (0)

Scribing
========

[](#scribing)

Scribing is a simple static blog generator, or [static site generator](https://davidwalsh.name/introduction-static-site-generators)designed for generating a blog, written in PHP.

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

[](#installation)

Use [Composer](https://getcomposer.org/).

```
composer require elazar/scribing
```

Example
-------

[](#example)

If you'd like to see a working example of a site that uses Scribing, check out [this repository](https://github.com/elazar/blog-content).

Content
-------

[](#content)

Content for Scribing is written in [Common Markdown](http://commonmark.org).

Scribing supports two document types: posts and pages.

### Posts

[](#posts)

Posts include a top level heading containing a title followed by a date formatted with emphasis.

```
# Post Title

*September 28, 2017*

Content goes here
```

Scribing both builds an individual file for each post and also includes a link to it on an archive page. Its path is derived from the date and title included in the Markdown content file.

### Pages

[](#pages)

Pages include a top level heading, but unlike posts, they are not date-specific. Often, their content rarely changes.

```
# Page Title

Content goes here
```

Scribing builds a file for each page at a path based on the name of the Markdown content file.

Design
------

[](#design)

Scribing uses the [Plates](http://platesphp.com) template engine.

When it is run, Scribing requires a template path to be specified. This path must reference a directory containing two Plates template files: the layout template and the archive page template.

### Layout Template

[](#layout-template)

`layout.php` is used as the layout template for both posts and pages.

HTML generated from Markdown content is passed into the `$content` variable.

The top level heading is passed into the `$title` variable. It can be used in the document's `` tag.

### Archive Template

[](#archive-template)

`archive.php` is used to generate the content for the archive page. Unlike the content for other pages, archive page content is generated from data contained in post content files rather than being created manually in Markdown.

An associative array of posts keyed by year is passed into `$posts`, where the value referenced by each year is an enumerated array of posts for that year. Each post is represented by an associative array containing `'date'`, `'url'`, and `'title'` keys.

### Common Data

[](#common-data)

For any common data that needs to be shared between templates, such as for navigation, create a PHP file that returns an array of data.

```
return [
    'nav' => [
        '/' => 'Home',
        '/archive' => 'Archive',
        // ...
    ],
];
```

Generating the Site
-------------------

[](#generating-the-site)

To generate the static files for a blog based on the post and page content files and Plates template files you've created, you use the `scribing` console command.

### Posts and Pages

[](#posts-and-pages)

`scribing` supports multiple subcommands, two of which are: `build:posts` and `build:pages`. Both use the same parameters.

```
build:posts [--templateData=path/to/data.php]

```

`--templateData` is optional and used to specify a path to a common data file, if one is needed.

`` is a directory that contains the source files for posts or pages.

`` is a directory into which `scribing` will store the files it generates.

`` is a directory containing the template files.

To build pages instead of posts, simply substitute `build:pages` for `build:posts` in the example above.

### Feed

[](#feed)

To build a feed from posts, `scribing` supports a `build:feed` subcommand.

```
build:feed --feedTitle="Feed Title" --feedLink="https://example.com/feed.xml"

```

`--feedTitle` is a title for the feed required by the Atom format

`--feedLink` is an absolute URL to the feed required by the Atom format

`` is a directory that contains the source files for posts to include in the feed

`` is a directory into which `scribing` will store the feed file

Using GitHub Pages
------------------

[](#using-github-pages)

If you are using Scribing to generate a site to be hosted on [GitHub Pages](https://help.github.com), set up a repository to store your content, templates, stylesheets, images, etc. that is separate from the repository that GitHub uses to display the site.

Here's a recommended directory structure:

```
.
├── content
│   ├── pages
│   └── posts
├── images
├── scripts
├── styles
└── templates

```

The purpose of most of the directories above should be self-explanatory.

The `scripts` directory is intended to house build and utility scripts used to tweak or deploy the files generated by Scribing.

For example, Scribing doesn't handle stylesheet or content license files, so these have to be manually copied to the build directory.

If you want to [create a custom 404 page](https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/), you can author the content as a normal page and then move the generated file to an appropriate location in your build script like so:

```
mv build/404/index.html build/404.html ; rm -fR build/404
```

If you'd like to locate the latest post and use that as the landing page for the site, you can do it like so:

```
LATEST=`find build/ -type f | grep -E '[0-9]+' | grep -v '404' | sort -nr | head -n 1`
cp "$LATEST" build/index.html
```

Here are some related resources for further reading:

- [Securing your GitHub Pages site with HTTPS](https://help.github.com/articles/securing-your-github-pages-site-with-https/)
- [Quick start: Setting up a custom domain](https://help.github.com/articles/quick-start-setting-up-a-custom-domain/)
- [GitHub Pages and Single-Page Apps](https://dev.to/_evansalter/github-pages-and-single-page-apps)
- [GitHub Pages Deployment - Travis CI](https://docs.travis-ci.com/user/deployment/pages/)

License
-------

[](#license)

The source code for Scribing is licensed under the [MIT License](https://en.wikipedia.org/wiki/MIT_License).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Total

8

Last Release

3253d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/80dec604abed1b21daafc54c430468444a2ad163ad5f8229348b8d241b797778?d=identicon)[elazar](/maintainers/elazar)

---

Top Contributors

[![elazar](https://avatars.githubusercontent.com/u/15487?v=4)](https://github.com/elazar "elazar (12 commits)")

---

Tags

blogcommonmarkphpstatic-site-generatorgeneratorstaticblogsite

### Embed Badge

![Health badge](/badges/elazar-scribing/health.svg)

```
[![Health](https://phpackages.com/badges/elazar-scribing/health.svg)](https://phpackages.com/packages/elazar-scribing)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[composer/satis

Simple Repository Generator

3.3k1.4M17](/packages/composer-satis)[sculpin/sculpin

Static Site Generator

1.5k102.8k12](/packages/sculpin-sculpin)[tightenco/jigsaw-blog-template

Blog starter template for Jigsaw static site generator by Tighten

9464.0k](/packages/tightenco-jigsaw-blog-template)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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