Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/matks/markdownblogbundle

Markdown files based Bundle to integrate a simple blog in your Symfony application
https://github.com/matks/markdownblogbundle

bundle php symfony

Last synced: 17 days ago
JSON representation

Markdown files based Bundle to integrate a simple blog in your Symfony application

Awesome Lists containing this project

README

        

MarkdownBlogBundle
==================

[![Latest Stable Version](https://poser.pugx.org/matks/markdown-blog-bundle/v/stable.svg)](https://packagist.org/packages/matks/markdown-blog-bundle)
[![Build Status](https://travis-ci.org/matks/MarkdownBlogBundle.svg?branch=master)](https://travis-ci.org/matks/MarkdownBlogBundle)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/matks/MarkdownBlogBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/matks/MarkdownBlogBundle/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/matks/MarkdownBlogBundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/matks/MarkdownBlogBundle/?branch=master)
[![License](https://poser.pugx.org/matks/markdown-blog-bundle/license.svg)](https://packagist.org/packages/matks/markdown-blog-bundle)

Markdown files based Bundle to integrate a simple blog in your Symfony application

## Installation

Require the bundle
```bash
$ composer require matks/markdown-blog-bundle
```

Enable the bundle in your Symfony application

```php
get('markdown_blog.library');

/** @var Post[] $allPosts */
$allPosts = $library->getAllPosts();

/** @var boolean $isPostRegistered */
$isPostRegistered = $library->isPostRegistered();

/** @var Post $post */
$post = $library->getPostByName();

/** @var Post[] $posts */
$posts = $library->getPostsByName();

/** @var Post[] $posts */
$posts = $library->getPostsByDate();

/** @var Post[] $posts */
$posts = $library->getPostsByCategory();

/** @var Post[] $posts */
$posts = $library->getPostsByTag();

```

You can now display your blog using any template you want. Example:
```php
getLibrary();
$allPosts = $library->getAllPosts();

return $this->render(
'default/index.html.twig',
['posts' => $allPosts]
);
}

/**
* @return Library
*/
private function getLibrary()
{
return $this->get('markdown_blog.library');
}
}
```

You can have a look at the [markdown-blog-bundle-example](https://github.com/matks/markdown-blog-bundle-example).
It displays a blog using bootstrap templates.

## Tests

### Stand alone context

In a bundle isolation context, just install the dev dependencies with composer
```bash
$ composer install
```

Run the unit tests suite with atoum binary
```bash
$ vendor/bin/atoum -bf vendor/autoload.php -d Tests/Unit/
```

Run functional tests with behat binary using the Symfony2 fixture application
```bash
$ vendor/bin/behat -c behat.ci.yml
```