2017 © Pedro Peláez
 

yii2-extension yii2-markdown-pages

A simple flat-file Markdown renderer

image

dpwlabs/yii2-markdown-pages

A simple flat-file Markdown renderer

  • Monday, March 26, 2018
  • by RAvenGEr
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

Yii2 Markdown Pages

yii2-markdown-pages provides a simple way to write pages in individual Markdown files with YAML frontmatter, render them on the fly and use the rendered HTML and frontmatter however you like., (*1)

Give updates on your Yii2 site or have a list of posts for a simple blog or news feed. Store your posts in version control with the rest of your code. No database required!, (*2)

This extension was forked from CorWatts/yii2-markdown-files, (*3)

Installation

Install via composer:, (*4)

composer require 'dpwlabs/yii2-markdown-pages'

Configuration

Enable the module by adding the snippet below to your main.php configuration file., (*5)

'modules' => [
  'pages' => [ // name this module what you like
    'class' => \dpwlabs\MarkdownPages\Module::className(),
    'pages' => '@frontend/views/markdown/pages',
    'drafts' => '@frontend/views/markdown/drafts',
  ]
],
  • class: is the namespaced class for this module
  • pages: is a path pointing to the directory containing publishable markdown files. The path can contain Yii2 aliases.
  • drafts: is a path pointing to the directory containing markdown files that aren't quite ready for publishing. The path can contain Yii2 aliases. Drafts are only rendered in the Yii2 dev environment.

Note: If you're going to use the included console command ensure this configuration is added somewhere the console application can access (like common/config/main.php)., (*6)

Usage

Before rendering and displaying posts the individual post files must be created. A simple way to scaffold new posts is using the console command included in this extension. See below for instructions on how to set it up and use it., (*7)

It is easy to create new posts without the included console command. Posts follow a specific ruleset:, (*8)

  • Create a file in the pages or drafts directory path specified in the module configuration above.
  • Similar to Jekyll, the filename has a specific format. It should start with the date (YYYY-MM-DD format) followed by a snake_cased description, and ending with the .md extension. Something like 2017-05-20_test_post_1.md. When these files are processed the date is extracted from the filename. The rest of the descriptive filename is used to select when using the page() method.

The Versions

26/03 2018

dev-master

9999999-dev https://github.com/RAvenGEr/yii2-markdown-pages

A simple flat-file Markdown renderer

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by David Webb

file yii2 markdown blog flat

26/03 2018

2.2.2

2.2.2.0 https://github.com/RAvenGEr/yii2-markdown-pages

A simple flat-file Markdown renderer

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by David Webb

file yii2 markdown blog flat

22/03 2018

2.2.1

2.2.1.0 https://github.com/RAvenGEr/yii2-markdown-pages

A simple flat-file Markdown renderer

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by David Webb

file yii2 markdown blog flat

28/02 2018

2.2.0

2.2.0.0 https://github.com/RAvenGEr/yii2-markdown-pages

A simple flat-file Markdown renderer

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by David Webb

file yii2 markdown blog flat

28/02 2018

2.1.1

2.1.1.0 https://github.com/RAvenGEr/yii2-markdown-pages

A simple flat-file Markdown renderer

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by David Webb

file yii2 markdown blog flat

22/02 2018

2.1.0

2.1.0.0 https://github.com/RAvenGEr/yii2-markdown-pages

A simple flat-file Markdown renderer

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by David Webb

file yii2 markdown blog flat

01/07 2017

2.0.1

2.0.1.0 https://github.com/CorWatts/yii2-markdown-files

A simple flat-file Markdown renderer

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Corey Watts

file yii2 markdown blog flat

16/06 2017

2.0.0

2.0.0.0 https://github.com/CorWatts/yii2-markdown-files

A simple flat-file Markdown renderer

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Corey Watts

file yii2 markdown blog flat

29/05 2017

1.0.1

1.0.1.0 https://github.com/CorWatts/yii2-markdown-files

A simple flat-file Markdown renderer

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Corey Watts

file yii2 markdown blog flat

25/05 2017

1.0.0

1.0.0.0 https://github.com/CorWatts/yii2-markdown-files

A simple flat-file Markdown renderer

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Corey Watts

file yii2 markdown blog flat