drdplusinfo/statie
Composer 安装命令:
composer require drdplusinfo/statie
包简介
Static Site Generator
README 文档
README
Statie - Modern and Simple Static Site Generator in PHP
Statie takes HTML, Markdown and Twig or Latte 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
Do you prefer Latte?
vendor/bin/statie init --templating latte
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?
We'll help you migrate:
vendor/bin/statie migrate-jekyll vendor/bin/statie migrate-sculpin
They will do 95 % of migration for you. If you still struggle with migration, look at:
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 and Latte Filters
All from Latte basic set and more:
Twig
{% 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 }}
Latte
{var $users = ($users|sort_by_field:'name')}
{var $users = ($users|sort_by_field:'name', 'desc')}
<!-- picks all posts defined in "related_items: [1]" in post -->
{var $relatedPosts = (post|related_items)}
{$content|reading_time} mins
{$post->getRawContent()|reading_time} mins
{$perexDeprecated|markdown}
{var $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.
drdplusinfo/statie 适用场景与选型建议
drdplusinfo/statie 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 43 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 04 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 drdplusinfo/statie 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 drdplusinfo/statie 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 43
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-27