taeluf / liaison.md-blog
v0.1.x-dev
2021-11-10 13:36 UTC
Requires
- spatie/commonmark-highlighter: dev-main
- taeluf/liaison: v0.3.x-dev
- taeluf/liaison.common-mark: v0.2.x-dev
- taeluf/liaison.seo-extractor: v0.1.x-dev
Requires (Dev)
- taeluf/code-scrawl: v0.5.x-dev
- taeluf/tester: v0.2.x-dev
This package is auto-updated.
Last update: 2024-09-27 21:17:30 UTC
README
MdBlog Liaison App
轻松将基于Markdown的博客文章集成到您的网站中。不使用数据库。
创建一个博客目录并按照以下结构组织:
blogs/
test/ ## a category
header-with-php.md
category/
sub-category/
another-blog.md
blog-slug.md
hidden-post.draft.md # draft posts won't ever be shown.
使用Liaison,只需这样做:
$liaison = new \Liaison();
new \Lia\Addon\CommonMark($liaison);
$liaison->set('lia:blog.use_cache', false); //change to true to use caching
$blog_addon = new \Lia\Addon\Blog($liaison, $this->cli->pwd.'/test/blogs');
$response = $liaison->getResponse('/blog/test/header-with-php/', 'GET');
echo $response->content;
否则,请参阅app/class/Blog.php获取更多信息
注意
- 所有URL都以
/blog/
开头。这将在未来可配置
安装
composer require taeluf/liaison.md-blog v0.1.x-dev
或在您的composer.json
文件中
{"require":{ "taeluf/liaison.md-blog": "v0.1.x-dev"}}