taeluf / liaison.md-blog

v0.1.x-dev 2021-11-10 13:36 UTC

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"}}