mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-04 20:27:40 +02:00
#431 Markdown as default parser
This commit is contained in:
@@ -56,10 +56,10 @@ class Page
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($page_content)) {
|
if (is_array($page_content)) {
|
||||||
$page['summary'] = $page['summary'];
|
$page['summary'] = $this->monstra['markdown']->text($page['summary']);
|
||||||
$page['content'] = $page['content'];
|
$page['content'] = $this->monstra['markdown']->text($page['content']);
|
||||||
} else {
|
} else {
|
||||||
$page['content'] = $page_content;
|
$page['content'] = $this->monstra['markdown']->text($page_content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -14,7 +14,6 @@ charset: UTF-8
|
|||||||
theme: default
|
theme: default
|
||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
- Markdown
|
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
flush_cache: false
|
flush_cache: false
|
||||||
|
@@ -1,24 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace Monstra;
|
|
||||||
|
|
||||||
class Markdown extends Plugin
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var Monstra
|
|
||||||
*/
|
|
||||||
protected $monstra;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Construct
|
|
||||||
*/
|
|
||||||
public function __construct(Monstra $c)
|
|
||||||
{
|
|
||||||
$this->monstra = $c;
|
|
||||||
$this->monstra['filters']->addListener('content', function($content) {
|
|
||||||
return $this->monstra['markdown']->text($content);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
new Markdown($monstra);
|
|
@@ -1,13 +0,0 @@
|
|||||||
name: Markdown
|
|
||||||
version: 1.0.0
|
|
||||||
description: "Markdown parser plugin for Monstra"
|
|
||||||
author:
|
|
||||||
name: Sergey Romanenko
|
|
||||||
email: awilum@msn.com
|
|
||||||
url: http://monstra.org
|
|
||||||
homepage: http://monstra.org
|
|
||||||
bugs: http://monstra.org
|
|
||||||
license: MIT
|
|
||||||
|
|
||||||
# Plugin settings
|
|
||||||
enabled: true
|
|
Reference in New Issue
Block a user