spress / spress-core
Static site generator with blogs support
v2.2.0
2017-04-13 10:20 UTC
Requires
- php: >=5.5
- michelf/php-markdown: 1.5.*
- pimple/pimple: ~3.0
- symfony/event-dispatcher: 2.7.*
- symfony/filesystem: 2.7.*
- symfony/finder: 2.7.*
- symfony/yaml: 2.7.*
- twig/twig: >=1.8,<2.0-dev
- yosymfony/config-loader: 1.3.*
- yosymfony/embedded-composer: 1.0.*@dev
This package is auto-updated.
Last update: 2024-12-13 04:50:43 UTC
README
Spress is a static site generator built with Symfony components and Twig as default template engine. This repository is the core of Spress application.
Installation
Go to your app folder and input the following command:
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:
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 namedev
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']
: Withtrue
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:
$ cd your-path
$ phpunit
License
This library is available as open source under the terms of the MIT License.