diff --git a/content-sample/index.md b/content-sample/index.md index 209369b..b1c8529 100644 --- a/content-sample/index.md +++ b/content-sample/index.md @@ -5,8 +5,8 @@ Description: Pico is a stupidly simple, blazing fast, flat file CMS. ## Welcome to Pico -Congratulations, you have successfully installed [Pico](http://picocms.org/). -%meta.description% +Congratulations, you have successfully installed [Pico](http://picocms.org/) +%version%. %meta.description% ## Creating Content diff --git a/lib/Pico.php b/lib/Pico.php index 025b537..df494d4 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -26,6 +26,13 @@ */ class Pico { + /** + * Pico version + * + * @var string + */ + const VERSION = '1.1.0-dev'; + /** * Sort files in alphabetical ascending order * @@ -907,6 +914,9 @@ class Pico . "(?:(.*?)(?:\r)?\n)?(?(2)\*\/|---)[[:blank:]]*(?:(?:\r)?\n|$)/s"; $content = preg_replace($metaHeaderPattern, '', $rawContent, 1); + // replace %version% + $content = str_replace('%version%', static::VERSION, $content); + // replace %site_title% $content = str_replace('%site_title%', $this->getConfig('site_title'), $content); @@ -1267,6 +1277,7 @@ class Pico 'current_page' => $this->currentPage, 'next_page' => $this->nextPage, 'is_front_page' => ($this->requestFile === $frontPage), + 'version' => static::VERSION ); }