PHP code example of mattmezza / flat-file-blog

1. Go to this page and download the library: Download mattmezza/flat-file-blog library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mattmezza / flat-file-blog example snippets



$blog_manager = new BlogManager($url, $posts_dir, $posts_perpage, $pages_dir, $authors);
$page = $blog_manager->get_page("page");
// reads file page.md from dir $pages_dir
// parses yaml initial section into $page->metas
// converts md into html and puts content in $page->body
echo $page->body;