yosymfony/spress-plugin-dataloader
Composer 安装命令:
composer require yosymfony/spress-plugin-dataloader
包简介
Dataloader plugin for Spress
README 文档
README
Loads data located at ./src/data/ folder of your site.
This plugin requires Spress >= 2.0. If you are using Spress 1.x, go to 1.0.0 version of the plugin.
How to install?
Go to your site folder and input the following command:
$ spress add:plugin yosymfony/spress-plugin-dataloader
How to use?
Go to your Spress site an create ./src/data folder. In this folder you can to create
JSON, YAML, Markdown or Textfiles that will be available in site.data.<yourFilenameWithoutExtension>.
Example with an users array and a Json file:
./src/data/
|- blogUsers.json
Example with an users array and a Yaml file (the extension yaml is valid too):
./src/data/
|- blogUsers.yml
For markdown files the extension md or markdown are valid.
Text file extensions are txt or text.
Markdown and text files are available as string.
Access to this data in Twig templates:
{% for theme in site.data.blogUsers %}
...
{% endfor %}
统计信息
- 总下载量: 194
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-01-08