Skip to content

Loads content from a Gaufrette filesystem, compiles various markup languages into HTML and renders pages using a Symfony2 Templating compatible engine.

License

Notifications You must be signed in to change notification settings

cocur/page-bundle

Repository files navigation

CocurPageBundle

Loads content from a Gaufrette filesystem, compiles various markup languages into HTML and renders pages using a Symfony2 Templating compatible engine.

Build Status Scrutinizer Quality Score Code Coverage

Features

Content Loaders

In theory content can be loaded from every filesystem supported by Gaufrette. In practice only the local filesystem is fully supported and tested and other filesystems might require additional packages, configuration or even some code to work properly.

Some filesystems supported by Gaufrette are:

  • Amazon S3
  • Databases compatible with Doctrine DBAL
  • Dropbox
  • FTP
  • Rackspace

Gaufrette is exensible and additional filesystems can be added.

Front Matter Parsers

The front matter are options for a page or piece of content. Currently the following formats are supported:

  • JSON
  • YAML

Compilers

CocurPageBundle supports a number of different markup systems to write content in. Compilers take the markup and generate the HTML. The compiler is selected on a per file basis depending on the file extension. The following formats are currently supported:

  • Markdown (.md and .markdown) and Markdown Extra (.mdx)
  • HTML (.htm and .html)
  • Plain text (.txt)

Renderes

The bundle uses Symfony2 Templating to render page. Therefore you can use any templating engine that has support for Symfony2 templating.

Events

  • cocur_page.pre_load: PreLoadEvent is dispatched before the content is loaded from the filesystem. The event constructor takes the key as argument.
  • cocur_page.post_load: PostLoadEvent is dispatched immediately after the content is loaded. The content is the only argument the event constructor expects.
  • cocur_page.pre_compile: PreCompileEvent is dispatched before the content is compiled and the constructor takes the content as argument.
  • cocur_page.post_compile: PostCompileEvent is dispatched after the content is compiled and takes an array of variables as argument. The compiled content is stored at index content.
  • cocur_page.pre_render: PreRenderEvent is dispatched before the content is rendered and takes an array of variables as argument.
  • cocur_page.post_render: PostRenderEvent is dispatched after the content is rendered and takes an instance of Response as argument.

Credits

License

This package is subject to the MIT license that is bundled with this package in the file LICENSE.

Bitdeli Badge

About

Loads content from a Gaufrette filesystem, compiles various markup languages into HTML and renders pages using a Symfony2 Templating compatible engine.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages