Static site generator with blogs support

Installs: 67

Dependents: 0

Stars: 164

Watchers: 13

Forks: 19

Open Issues: 12

Language: PHP


Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight

Spress is a static site generator built with Symfony components and inspired by Jekyll. See demo.

License: MIT.

This branch contains the development of Spress 2.0. Go to 1.1 for stable branch.


  • Linux, Unix or Mac OS X.
  • PHP >= 5.5.
  • Composer.


Discuss and share your opinions in Gitter chat:



When Contributing code to Spress, you must follow its coding standards. Spress follows Symfony coding style.

Keep in mind a golden rule: Imitate the existing Spress code.

Pull Resquests
  • Fork the Spress repository.
  • Create a new branch for each feature or improvement.
  • Send a pull request from each feature branch to master branch or appropriated.
Unit testing

All pull requests must be accompanied by passing unit tests. Spress uses phpunit for testing.

Getting Started

  • Download the last release or clone repository git clone https://github.com/yosymfony/Spress.git.
  • Get vendors
  • Create a blank site.
  • Build your site.

Get vendors

Use Composer to get vendors:

$ cd your-path
$ composer.phar update

spress command

Spress command are located in bin/spress and you can use this command to create a new site or process your site.


This command has been declared as deprecated since Spress 1.1.0. See new:site command.


Build your site in your configured destination, typically _site.

site:build [-s|--source="./"] [--timezone="..."] [--env="dev"] [--server] [--watch] [--drafts] [--safe]

  • --server The built-in server will run.
  • --watch Watch for changes and regenerate your site automatically.
  • --drafts To include draft posts in the generated site.
  • --safe Disable all plugins.

E.g $ spress site:build -s /your-site-dir

How to load configuration for production environment:
  1. To create config_prod.yml with the options that will be overrided in config.yml.
  2. $ spress site:build --env=prod
Scaffolding new:site

Create a new site.

new:site [path="./"] [template="blank"] [--force] [--all]

  • --force option force to use the path even though exists and it's not empty.
  • --all In blank template, creates the complete scaffold.

E.g $ spress new:site /your-site-dir


The new:post command helps you generates new posts. By default, the command interacts with the developer to tweak the generation. Any passed option will be used as a default value for the interaction.

new:post [--title="..."] [--layout="default"] [--date="..."] [--tags="..."] [--categories="..."]

  • --title: The title of the post.
  • --layout: The layout of the post.
  • --date: he date assigned to the post.
  • --tags: Tags list separed by white spaces.
  • --categories: Categories list separed by white spaces.

The new:plugin command helps you generates new plugins. By default, the command interacts with the developer to tweak the generation. Any passed option will be used as a default value for the interaction.

new:plugin [--name="..."] [--author="..."] [--email="..."] [--description="..."] [--license="MIT"]

  • --name: The name of the plugins should follow the pattern vendor-name/plugin-name.
  • --author: The author of the plugin.
  • --email: The Email of the author.
  • --description: The description of your plugin.
  • --license: The license under you publish your plugin. MIT by default.

How to make spress.phar

We are using Box roject for generating .phar file.

You may download Box:

$ curl -LSs https://box-project.github.io/box2/installer.php | php


$ cd spress-folder
$ box build

Unit tests

You can run the unit tests with the following command:

$ cd your-path
$ composer.phar install
$ phpunit