Symfony Blog Bundle

Symfony Blog Bundle

codecov Maintainability Scrutinizer Code Quality

A Symfony Bundle for adding simple blog functionality to existing or new Symfony project.
Subsplit from harentius/blog minimalistic blogging engine, which is designed to use Markdown files for content and transform them into blogs, and harentius/blog only stores and shows blogs.

Installation

  1. Install the bundle
    $ composer.phar require harentius/blog-bundle
    
  2. Add bundles (in config/bundles.php or Kernel):
<?php
// config/bundles.php

return [
//...
    Harentius\BlogBundle\HarentiusBlogBundle::class => ['all' => true],
//...
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
    Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
    Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
    Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
    Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true],
];
  1. Include routes:
    # config/routes.yaml
    blog:
     resource: "@HarentiusBlogBundle/Resources/config/routing.yaml"
     prefix:   /
    
  2. Include default configs: Note: this step can be skipped if you decide to configure bundles (i.e. DoctrineBundle, SecurityBundle, etc) yourself
# config/packages/harentius_blog.yaml
imports:
    - { resource: '@HarentiusBlogBundle/Resources/config/config.yaml' }

Configuration

Config reference:

harentius_blog:
    title: Blog Title
    theme: default|dark # default dark
    highlight_code: true|false # load highlight js library or not, default false
  1. Create/Update your DB according to chosen installation type
    bin/console doctrine:database:create
    bin/console doctrine:schema:create
    
  2. Install assets
    bin/console assets:install