2017 © Pedro Peláez
 

library spress-core

Static site generator with blogs support

image

spress/spress-core

Static site generator with blogs support

  • Friday, December 8, 2017
  • by yosymfony
  • Repository
  • 2 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 18 Versions
  • 0 % Grown

The README.md

Spress Core - PHP Static site generator

Build Status Scrutinizer Code Quality SensioLabsInsight, (*1)

Spress is a static site generator built with Symfony components and Twig as default template engine. This repository is the core of Spress application., (*2)

Installation

Go to your app folder and input the following command:, (*3)

composer require spress/spress-core

How to use?

The entry-point class is Yosymfony\Spress\Core\Spress. The below example point out how to use:, (*4)

use Yosymfony\Spress\Core\Spress;

class MyClass
{
    public function parseSite()
    {
        $spress = new Spress();
        $spress['spress.config.site_dir'] = '/path-to-your-spress-site';
        $spress->parse();
    }
}

Including draft posts

use Yosymfony\Spress\Core\Spress;

class MyClass
{
    public function parseSite()
    {
        $spress = new Spress();
        $spress['spress.config.site_dir'] = '/path-to-your-spress-site';
        $spress['spress.config.drafts'] = true;
        $spress->parse();
    }
}

Another configuration values:

  • $spress['spress.config.env']: Environment name dev by default. This option determines the configuration file in case you have a specific configuration file for that environment name. e.g: $spress['spress.config.env'] = 'prod'
  • $spress['spress.config.safe']: With true disable all plugins. e.g: spress['spress.config.safe'] = true.
  • $spress['spress.config.drafts']: Include draft posts in the transformation. false by default.
  • $spress['spress.config.url']: Sets the URL base.
  • $spress['spress.config.timezone']: Sets the timezone. E.g: "Europe/Madrid".

Unit tests

Spress core uses PHPUnit >= 5.7. You can run the unit tests with the following command:, (*5)

$ cd your-path
$ phpunit

License

This library is available as open source under the terms of the MIT License., (*6)

The Versions