minetro / simple-blogger
Requires
- php: >=5.4.0
- nette/di: >=2.3.0
- nette/utils: >=2.3.0
Requires (Dev)
- nette/tester: ~1.4.0
This package is not auto-updated.
Last update: 2022-02-01 12:47:25 UTC
README
网站 🚀 contributte.org | 联系 👨🏻💻 f3l1x.io | Twitter 🐦 @contributte
免责声明
⚠️ | 此项目不再维护。请使用 contributte/webapp-skeleton。 |
---|
Composer | minetro/simple-blogger |
---|---|
版本 | |
PHP | |
许可证 |
基于 Nette 的简单静态博客程序。
此项目已过时。请使用更好的解决方案 blogette/platform。
用法
将 BloggerExtension
注册到其他扩展中。
extensions: blog: Minetro\Blog\Simple\DI\BloggerExtension
您必须设置 Nette\Utils\Finder 搜索 文章 的文件夹。
blog: posts: %appDir%/data
文章
文章由两部分组成。 Meta
文件和 content
文件。
Meta文件
假设我们有一个文件在 data/201505/post.neon。所有元文件必须具有 neon
扩展名。
查看示例元文件。
id: 1 date: 06.05.2015 title: Some cool title post: %file%/post.md seo: title: 'Best framework in the world' keywords: 'nette, php, framework' description: 'Nothing to say. It's a fact.' tags: - php config: comments: yes social: yes parser: parsedown
必需的属性是 id、date、title 和 post。
Post 是指向您的 content
文件的目标。内容文件可以是 .md
、.latte
或任何其他格式。但您必须指定解析器。在这种情况下,它是 parsedown。
模型
PostsService
要获取所有文章、单个文章、排序文章或过滤文章,请使用 PostsService
。
->findAll(Configuration $c)
- 返回文章数组。
->fetch(Configuration $c)
- 返回单个文章或无。
配置
有 3 个对象。 Criteria、Sorter 和 Paginator。
Criteria
- 用于文章过滤(排除)
Sorter
- 用于文章排序
Paginator
- 扩展了经典的 Nette\Utils\Paginator
视图
视图不是此库的一部分。您必须自行显示文章。
开发
此包由以下作者维护。
请考虑支持contributte开发团队。也感谢您使用此包。