symplify/statie
最新稳定版本:v7.2.3
Composer 安装命令:
composer require symplify/statie
包简介
Static Site Generator
README 文档
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.
symplify/statie 适用场景与选型建议
symplify/statie 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25.71k 次下载、GitHub Stars 达 91, 最近一次更新时间为 2016 年 11 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 symplify/statie 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 symplify/statie 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 25.71k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 91
- 点击次数: 12
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-09