Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown Blogger

Build Status Latest Stable Version Total Downloads License

This project aims to allow users to create blogs by merely uploading markdown files

Installation

Installation should be running composer install

Usage

Write markdown posts (with the .md suffix) in the data folder. Use underscores to represent slashes in the path_info

example index.php file

require __DIR__ . '/../vendor/autoload.php';

use MarkdownBlogger\Application;

// bootstrap the blog
$app = Application::getInstance();
$app->bootstrap([
    'data_dir'    => realpath(__DIR__ . '/../data'),
    'blog_title'  => 'The Default Title',
    'keywords'    => 'Testing, Stuff',
    'description' => 'The default description',
]);

// run it
$app->run();

A layout.php file is also required. An example might look like:

<?php
// Setup the local variables for the layout
extract($vars);
?>
<!doctype html>
<html>
    <head>
        <title><?php echo $blog_title; ?><?php if ($title) echo ' - ' . $title ; ?></title>
        <meta name="keywords" content="<?php echo $keywords; ?>" />
        <meta name="description" content="<?php echo $description; ?>" />
        <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    </head>

    <body>
        <h1><?php echo $blog_title; ?></h1>
        <?php
            if ($content) :
                echo $content;
            else :
                foreach ($latest as $blog) :
                    echo $blog->getSnippet();
                endforeach;
            endif;
        ?>

    </body>
</html>
this_is_a-path.md -> this/is/a-path

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages