Add Pico::VERSION constant
This commit is contained in:
parent
43705d0f76
commit
479926eeb4
@ -5,8 +5,8 @@ Description: Pico is a stupidly simple, blazing fast, flat file CMS.
|
|||||||
|
|
||||||
## Welcome to Pico
|
## Welcome to Pico
|
||||||
|
|
||||||
Congratulations, you have successfully installed [Pico](http://picocms.org/).
|
Congratulations, you have successfully installed [Pico](http://picocms.org/)
|
||||||
%meta.description% <!-- replaced by the above Description meta header -->
|
%version%. %meta.description% <!-- replaced by the above Description header -->
|
||||||
|
|
||||||
## Creating Content
|
## Creating Content
|
||||||
|
|
||||||
|
11
lib/Pico.php
11
lib/Pico.php
@ -26,6 +26,13 @@
|
|||||||
*/
|
*/
|
||||||
class Pico
|
class Pico
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Pico version
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
const VERSION = '1.1.0-dev';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sort files in alphabetical ascending order
|
* Sort files in alphabetical ascending order
|
||||||
*
|
*
|
||||||
@ -907,6 +914,9 @@ class Pico
|
|||||||
. "(?:(.*?)(?:\r)?\n)?(?(2)\*\/|---)[[:blank:]]*(?:(?:\r)?\n|$)/s";
|
. "(?:(.*?)(?:\r)?\n)?(?(2)\*\/|---)[[:blank:]]*(?:(?:\r)?\n|$)/s";
|
||||||
$content = preg_replace($metaHeaderPattern, '', $rawContent, 1);
|
$content = preg_replace($metaHeaderPattern, '', $rawContent, 1);
|
||||||
|
|
||||||
|
// replace %version%
|
||||||
|
$content = str_replace('%version%', static::VERSION, $content);
|
||||||
|
|
||||||
// replace %site_title%
|
// replace %site_title%
|
||||||
$content = str_replace('%site_title%', $this->getConfig('site_title'), $content);
|
$content = str_replace('%site_title%', $this->getConfig('site_title'), $content);
|
||||||
|
|
||||||
@ -1267,6 +1277,7 @@ class Pico
|
|||||||
'current_page' => $this->currentPage,
|
'current_page' => $this->currentPage,
|
||||||
'next_page' => $this->nextPage,
|
'next_page' => $this->nextPage,
|
||||||
'is_front_page' => ($this->requestFile === $frontPage),
|
'is_front_page' => ($this->requestFile === $frontPage),
|
||||||
|
'version' => static::VERSION
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user