symplify / statie
Static Site Generator
Fund package maintenance!
tomasvotruba
Patreon
Requires
- php: ^7.2
- composer/xdebug-handler: ^1.4
- erusev/parsedown: ^1.7
- erusev/parsedown-extra: ^0.7.1
- guzzlehttp/guzzle: ^6.5
- j7mbo/twitter-api-php: ^1.0.6
- jean85/pretty-package-versions: ^1.2
- latte/latte: ^2.5
- nette/finder: ^2.5
- nette/utils: ^3.0
- ocramius/package-versions: ^1.4
- symfony/config: ^4.4|^5.0
- symfony/console: ^4.4|^5.0
- symfony/dependency-injection: ^4.4|^5.0
- symfony/event-dispatcher: ^4.4|^5.0
- symfony/finder: ^4.4|^5.0
- symfony/http-kernel: ^4.4|^5.0
- symfony/yaml: ^4.4|^5.0
- symplify/auto-bind-parameter: ^7.2.3
- symplify/autowire-array-parameter: ^7.2.3
- symplify/package-builder: ^7.2.3
- symplify/set-config-resolver: ^7.2.3
- symplify/smart-file-system: ^7.2.3
- tracy/tracy: ^2.7
- twig/twig: ^3.0
Requires (Dev)
- phpunit/phpunit: ^8.5|^9.0
- dev-master / 7.3.x-dev
- v7.2.3
- v7.2.2
- v7.2.1
- v7.2.0
- v7.1.3
- v7.1.2
- v7.1.1
- v7.1.0
- v7.0.2
- v7.0.1
- v7.0.0
- v6.1.0
- v6.0.5
- v6.0.4
- v6.0.3
- v6.0.2
- v6.0.1
- v6.0.0
- v5.4.16
- v5.4.15
- v5.4.14
- v5.4.13
- v5.4.12
- v5.4.11
- v5.4.10
- v5.4.9
- v5.4.8
- v5.4.7
- v5.4.6
- v5.4.5
- v5.4.4
- v5.4.3
- v5.4.2
- v5.4.1
- v5.4.0
- v5.3.12
- v5.3.11
- v5.3.10
- v5.3.9
- v5.3.8
- v5.3.7
- v5.3.6
- v5.3.5
- v5.3.4
- v5.3.2
- v5.3.1
- v5.3.0
- v5.2.22
- v5.2.20
- v5.2.19
- v5.2.18
- v5.2.17
- v5.2.16
- v5.2.15
- v5.2.14
- v5.2.13
- v5.2.12
- v5.2.11
- v5.2.10
- v5.2.9
- v5.2.8
- v5.2.7
- v5.2.6
- v5.2.5
- v5.2.4
- v5.2.3
- v5.2.2
- v5.2.1
- v5.2.0
- v5.1.4
- v5.1.3
- v5.1.2
- v5.1.1
- v5.1.0
- v5.0.2
- v5.0.1
- v5.0.0
- v4.8.0
- v4.7.0
- v4.6.1
- v4.6.0
- v4.5.1
- v4.5.0
- v4.4.2
- v4.4.1
- v4.4.0
- v4.3.0
- v4.2.3
- v4.2.2
- v4.2.1
- v4.2.0
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v4.0.0beta1
- v4.0.0alpha6
- v4.0.0alpha5
- v4.0.0alpha4
- v4.0.0alpha3
- v4.0.0alpha2
- v4.0.0alpha1
- v3.2.30
- v3.2.29
- v3.2.28
- v3.2.27
- v3.2.26
- v3.2.25
- v3.2.24
- v3.2.23
- v3.2.22
- v3.2.21
- v3.2.20
- v3.2.18
- v3.2.17
- v3.2.15
- v3.2.14
- v3.2.13
- v3.2.12
- v3.2.11
- v3.2.10
- v3.2.9
- v3.2.7
- v3.2.6
- v3.2.5
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v3.0.0-RC5
- v3.0.0-RC4
- v3.0.0-RC3
- v3.0.0-RC2
- v3.0.0-RC1
- v2.5.12
- v2.5.10
- v2.5.9
- v2.5.8
- v2.5.7
- v2.5.6
- v2.5.5
- v2.5.4
- v2.5.3
- v2.5.2
- v2.5.1
- v2.5.0
- v2.4.3
- v2.4.2
- v2.4.1
- v2.4.0
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.15
- v2.2.14
- v2.2.13
- v2.2.12
- v2.2.11
- v2.2.10
- v2.2.9
- v2.2.8
- v2.2.7
- v2.2.6
- v2.2.5
- v2.2.4
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.8
- v2.1.7
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.1
- v2.0.0
- v2.0.0-RC3
- v2.0.0-RC2
- v2.0.0-RC1
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.21
- v1.2.20
- v1.2.19
- v1.2.18
- v1.2.17
- v1.2.16
- v1.2.15
- v1.2.14
- v1.2.13
- v1.2.12
- v1.2.11
- v1.2.10
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
This package is auto-updated.
Last update: 2020-03-12 09:56:06 UTC
README
[DEPRECATED since 2020-03] Statie - Modern and Simple Static Site Generator in PHP
Use Symfony Static Dumper instead
Statie takes HTML, Markdown and Twig files and generates static HTML page.
Install
composer require symplify/statie
How to Generate and See the Website?
- Prepare content for Statie
vendor/bin/statie init
This will generate config, templates, layouts and gulp code, so you can enjoy live preview.
Last step is install node dependencies:
npm install
- Generate static site from
/source
(argument) to/output
(default value) in HTML:
vendor/bin/statie generate source
- Run website locally
gulp
- And see web in browser localhost:8000.
Do you use Jekyll or Sculpin?
Configuration
statie.yml
Config
This is basically Symfony Kernel config.yml
that you know from Symfony application. You can:
# statie.yml imports: - { resource: 'data/favorite_links.yml' } parameters: site_url: 'http://github.com' socials: facebook: 'http://facebook.com/github' services: App\SomeService: ~
Parameters are available in every template:
{# source/_layouts/default.twig #} <p>Welcome to: {{ site_url }}</p> <p>Checkout my FB page: {{ socials.facebook }}</p>
Do You Write Posts?
Create a new empty .md
file with date, webalized title and ID:
vendor/bin/statie create-post "My new post"
Statie privides default template:
id: __ID__ title: "__TITLE__" ---
Do you want your own template? Configure path to it:
# statie.yaml parameters: post_template_path: 'templates/my_own_post.twig'
That's it!
How to Generate API?
Statie web Friendsofphp.org provide info about PHP meetups and groups. They're already stored in parameters. Do you want to publish them as JSON API?
parameters: api_parameters: - 'groups' - 'meetups'
This will generate 2 pages:
/api/groups.json /api/meetups.json
With parameters as JSON, that anyone can use now.
How to Redirect old page?
# statie.yml parameters: redirects: old_page: 'new_page' old_local_page: 'https://external-link.com'
Are you Speaker? Use your JoindIn Talks
# statie.yml parameters: joind_in_username: 'tomasvotruba'
vendor/bin/statie dump-joind-in
This will generated source/_data/generated/joind_in_talks.yaml
file with your talks:
parameters: joind_in_talks: # ...
Then you can use them like any other parameter in your Statie templates:
{% for joind_in_talk in joind_in_talks %} ... {% endfor %}
Useful Twig Filters
All from this basic set and more:
{% set users = sort_by_field(users, 'name') %} {% set users = sort_by_field(users, 'name', 'desc') %} <!-- picks all posts defined in "related_items: [1]" in post --> {% set relatedPosts = related_items(post)} {{ content|reading_time }} mins {{ post.getRawContent|reading_time }} mins {{ perexDeprecated|markdown }} {% set daysToFuture = diff_from_today_in_days(meetup.startDateTime) %} {{ post|link }}
Documentation
Thanks to @crazko you can enjoy neat documentation and see projects that use Statie at statie.org.
Contributing
Open an issue or send a pull-request to main repository.