Filename Size Date modified Message
179 B
812 B
7.1 KB
1.4 KB
475 B
2.3 KB
162 B
769 B
7.7 KB
210.3 KB
520 B
43 B

Mini Blog in PHP with Markdown Content Files

Define routes and the host in flow.php

Add .md files in content - folder is the section id - file is the article id


Any routes that have FactoryMd as a callback, uses automatically the active path to determine the content file. app/Law and app/Blog are child of FactoryMd.

Route example:

$host = '';

$route_list = [
    'name-of-route' => [
        'path' => '/the-path-you-want/{could-be-with-placeholder}',
        'controller' => function (Painttheweb\Service\Frontend $frontend) {
            $controller = new Painttheweb\Service\FactoryMd($frontend);
            return $controller->response();

This will turn to the content file path content/the-path-you-want/ and will use this file to transpile into html and into template as {{ md_content|raw }} in the file FactoryMd.twig.


For each article is visible, the file matching is done from routing - there is no function to hide a page, it needs to be initialized in [blog.php]. But the article need to be initialized to also be available for url generation, indexing and be available for automatic listing.

    Copyright 2017-2018 Michael Becker,