PHPackages                             jeremyharris/build - 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. jeremyharris/build

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

jeremyharris/build
==================

Static PHP website builder

0.5(8y ago)029[2 issues](https://github.com/jeremyharris/build/issues)MITPHP

Since Mar 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jeremyharris/build)[ Packagist](https://packagist.org/packages/jeremyharris/build)[ RSS](/packages/jeremyharris-build/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (8)Used By (0)

[![Build Status](https://camo.githubusercontent.com/38b75490a147d1dd11071ddf1c00cd58ac22fa2565cf6c52269fb698c30b7eb9/68747470733a2f2f7472617669732d63692e6f72672f6a6572656d796861727269732f6275696c642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jeremyharris/build)

Build
=====

[](#build)

A little static site generator, built specifically to build little sites with blog posts.

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

[](#installation)

`composer require jeremyharris/build`

Features
--------

[](#features)

- Stupid dumb easy setup (no config files)
- Concatenates assets
- Builds only modified files
- Some tools for basic blog functionality
- Flexible-ish

Usage
-----

[](#usage)

```
$build = new \JeremyHarris\Build\Build('/path/to/site_target', 'path/to/build_target');
$build->build();
```

Only files that have been modified since you last built will be built. You can optionally pass `true` to `build()` to force build all files. You can then get full paths to newly built files:

```
$newlyBuiltFiles = $build->getBuiltFiles();
// now deploy them!
```

If you want to manually add build files that aren't within the expected structure, you can do so:

```
// add a file to the build root
$build->addFileToBuild('/full/path/to/file.html');
// add a file to a new directory within the build
$build->addFileToBuild('/full/path/to/file.html', 'some/directory');
// render a file as a view (wrap it in the layout)
$build->addFileToBuild('/path/to/my.php', 'some/directory', true);
$build->addFileToBuild('/path/to/my.md', '/', true);
```

Blogging
--------

[](#blogging)

Some blogging functionality is provided in the `\JeremyHarris\Build\Blog` class. It assumes a `YYYY/MM` structure. The `Blog` class is helpful for building an archive page or getting the latest post. Items returned are `\JeremyHarris\Build\Blog\Post`objects that contain some helpful methods.

```
$Blog = new Blog('/path/to/site_target');
$latest = $Blog->getLatest();
$allPosts = $Blog->getPosts();

$linkToLatest = $latest->link();
$latestTitle = $latest->title();
```

### RSS

[](#rss)

To create an RSS feed, you must tell the builder that you want one and pass some required settings that the feed needs in order to generate:

```
$build = new \JeremyHarris\Build\Build('/path/to/site_target', 'path/to/build_target');
$build->addRss('My Blog', 'https://example.com', 'Description of site');
$build->build();
```

The generator will then automatically create a basic RSS feed for you. The file will be in the root of your built site. Only the last 20 blog posts will be included in the feed.

Site target structure
---------------------

[](#site-target-structure)

The site target should have a layout like the one below. Anything in `/webroot`is copied directly to webroot, allowing flexibility in not using views. Items in `/views` are wrapped in `layout.php` and placed into the directories they reside in. Views can be php or markdown.

Titles are assumed from the filename slug, so `interesting-article-about-things.md`is titled "Interesting Article About Things".

```
site
|_ views
|  |
|  |_ about.php
|  |_ contact.md
|     |_ sub
|        |_ article.php
|_ assets
| |_ css
| |  |_ css1.css
| |  |_ css2.css
| |
| |_ js
|    |_ script1.js
|    |_ script2.js
|
|_ webroot
|  |_ robots.txt
|  |_ fonts
|     |_ font1.otf
|
|_ layout.php

```

And builds it into a site like this:

```
build
|_ fonts
|  |_ font1.otf
|
|_ sub
|  |_ article.html
|
|_ styles.css
|_ scripts.js
|- rss.xml
|_ about.html
|_ contact.html
|_ robots.txt

```

Note `rss.xml` will only exist if you added an RSS feed before build.

Example site
------------

[](#example-site)

- [someguyjeremy.com](https://github.com/jeremyharris/someguyjeremy)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

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

Total

5

Last Release

3219d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e2fcf5bb870eab1f8efd260dfa93fb00961d1c6addc787a93bf0b5d84c78524?d=identicon)[jeremyharris](/maintainers/jeremyharris)

---

Top Contributors

[![jeremyharris](https://avatars.githubusercontent.com/u/184903?v=4)](https://github.com/jeremyharris "jeremyharris (23 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jeremyharris-build/health.svg)

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

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[phiki/phiki

Syntax highlighting using TextMate grammars in PHP.

3573.0M23](/packages/phiki-phiki)[spatie/commonmark-highlighter

Highlight your markdown code blocks with league/commonmark

138400.5k19](/packages/spatie-commonmark-highlighter)[monsieurbiz/sylius-rich-editor-plugin

A Rich Editor plugin for Sylius.

75380.8k6](/packages/monsieurbiz-sylius-rich-editor-plugin)[horstoeko/zugferdvisualizer

A library

33198.3k2](/packages/horstoeko-zugferdvisualizer)[torchlight/engine

The PHP-based Torchlight code annotation and rendering engine.

655.7k4](/packages/torchlight-engine)

PHPackages © 2026

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