Added page option for markdown_extra

This commit is contained in:
Andy Miller 2014-08-25 09:29:35 -06:00
parent 65720df28d
commit b442aa2dd6
2 changed files with 10 additions and 2 deletions

View File

@ -70,6 +70,7 @@ class Page
protected $modular_twig; protected $modular_twig;
protected $process; protected $process;
protected $summary_size; protected $summary_size;
protected $markdown_extra;
/** /**
* @var Page Unmodified (original) version of the page. Used for copying and moving the page. * @var Page Unmodified (original) version of the page. Used for copying and moving the page.
@ -201,6 +202,9 @@ class Page
if (isset($this->header->date)) { if (isset($this->header->date)) {
$this->date = strtotime($this->header->date); $this->date = strtotime($this->header->date);
} }
if (isset($this->header->markdown_extra)) {
$this->markdown_extra = (bool)$this->header->markdown_extra;
}
if (isset($this->header->taxonomy)) { if (isset($this->header->taxonomy)) {
foreach ($this->header->taxonomy as $taxonomy => $taxitems) { foreach ($this->header->taxonomy as $taxonomy => $taxitems) {
$this->taxonomy[$taxonomy] = (array)$taxitems; $this->taxonomy[$taxonomy] = (array)$taxitems;
@ -214,7 +218,9 @@ class Page
$this->process[$process] = $status; $this->process[$process] = $status;
} }
} }
} }
return $this->header; return $this->header;
} }
@ -1517,7 +1523,9 @@ class Page
{ {
/** @var Config $config */ /** @var Config $config */
$config = self::$grav['config']; $config = self::$grav['config'];
if ($config->get('system.pages.markdown_extra')) {
// get the appropriate setting for markdown extra
if (isset($this->markdown_extra) ? $this->markdown_extra : $config->get('system.pages.markdown_extra')) {
$parsedown = new MarkdownExtra($this); $parsedown = new MarkdownExtra($this);
} else { } else {
$parsedown = new Markdown($this); $parsedown = new Markdown($this);

View File

@ -3,7 +3,7 @@ home:
pages: pages:
theme: antimatter theme: antimatter
markdown_extra: true markdown_extra: false
process: process:
markdown: true markdown: true
twig: false twig: false