From 340aded09e3ee751cf18cde091001dee9ac6d957 Mon Sep 17 00:00:00 2001 From: Awilum Date: Thu, 13 Dec 2018 12:49:04 +0300 Subject: [PATCH 1/9] Config: set error report false --- site/config/settings.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/config/settings.yaml b/site/config/settings.yaml index 2bd4c329..baf80709 100644 --- a/site/config/settings.yaml +++ b/site/config/settings.yaml @@ -13,7 +13,7 @@ locale: en pages: main: home errors: - display: true + display: false cache: enabled: true prefix: flextype From c4c5832672a5aa1eeec141eb1379d4454d4b9573 Mon Sep 17 00:00:00 2001 From: Awilum Date: Thu, 13 Dec 2018 12:50:04 +0300 Subject: [PATCH 2/9] remove heavy "imagine/imagine": "1.2.0" for now --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 6ade4a2e..4e3e292d 100755 --- a/composer.json +++ b/composer.json @@ -20,7 +20,6 @@ "doctrine/cache": "1.8.0", "symfony/yaml": "4.2.1", "thunderer/shortcode": "0.6.5", - "imagine/imagine": "1.2.0", "flextype-components/arr" : "1.2.3", "flextype-components/assets" : "1.0.1", "flextype-components/cookie" : "1.2.0", From ac82dfefe52eeb510b8c6aee28cb234e02b51359 Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 14 Dec 2018 02:19:13 +0300 Subject: [PATCH 3/9] "flextype-components/errorhandler" : "1.0.5" --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4e3e292d..248edd37 100755 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "flextype-components/date" : "1.0.0", "flextype-components/debug" : "1.0.0", "flextype-components/event" : "1.0.4", - "flextype-components/errorhandler" : "1.0.4", + "flextype-components/errorhandler" : "1.0.5", "flextype-components/filesystem" : "1.1.3", "flextype-components/form" : "1.0.1", "flextype-components/i18n" : "1.2.0", From 53141310137a44bd4f02860f3e5e6dc136b8a11b Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 14 Dec 2018 02:27:31 +0300 Subject: [PATCH 4/9] CHANGELOG.md UPDATES --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09e79c88..0cb1f493 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# Flextype 0.7.4, 2018-12-14 +* Config: set error reporting - false +* Super heavy "imagine/imagine": "1.2.0" - removed +* Flextype Component - Errorhandler updated to 1.0.5 + # Flextype 0.7.3, 2018-12-13 * Content: visibility hidden for pages - added * Settings merged into one settings.yaml file From 56db1ac568753eb97ff2501d8adc20b9af7588ea Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 14 Dec 2018 02:50:46 +0300 Subject: [PATCH 5/9] Content: new frontMatterParser() - added --- flextype/Content.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/flextype/Content.php b/flextype/Content.php index 3fa685b2..c2a36a34 100755 --- a/flextype/Content.php +++ b/flextype/Content.php @@ -313,6 +313,22 @@ class Content return Content::$shortcode; } + /** + * Front matter parser + * + * @param string $content Content to parse + * @access public + * @return array + */ + public static function frontMatterParser(string $content) : array + { + $parts = preg_split('/^[\s\r\n]?---[\s\r\n]?$/sm', PHP_EOL.ltrim($content)); + + if (count($parts) < 3) return ['matter' => [], 'body' => $content]; + + return ['matter' => trim($parts[1]), 'body' => implode(PHP_EOL.'---'.PHP_EOL, array_slice($parts, 2))]; + } + /** * Process page * @@ -335,9 +351,9 @@ class Content } else { // Create $page_frontmatter and $page_content - $page = explode('---', $page, 3); - $page_frontmatter = $page[1]; - $page_content = $page[2]; + $page = Content::frontMatterParser($page); + $page_frontmatter = $page['matter']; + $page_content = $page['body']; // Create empty $_page $_page = []; From 8b4a9003cb564f4a50fba5d7a124af9bb311580f Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 14 Dec 2018 02:50:56 +0300 Subject: [PATCH 6/9] CHANGELOG.md UPDATES --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cb1f493..a2c70cc3 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Flextype 0.7.4, 2018-12-14 +* Content: new frontMatterParser() - added * Config: set error reporting - false * Super heavy "imagine/imagine": "1.2.0" - removed * Flextype Component - Errorhandler updated to 1.0.5 From 604085e8b216cebbbcc8a3128237b6aa28a304b3 Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 14 Dec 2018 03:28:11 +0300 Subject: [PATCH 7/9] Update theme simple according to the php template syntax guidelines --- site/themes/simple/views/partials/head.php | 22 ++++++++++--------- .../simple/views/partials/navigation.php | 4 ++-- site/themes/simple/views/partials/tail.php | 8 ++++--- .../themes/simple/views/templates/default.php | 2 +- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/site/themes/simple/views/partials/head.php b/site/themes/simple/views/partials/head.php index c12e4b39..a90528d5 100755 --- a/site/themes/simple/views/partials/head.php +++ b/site/themes/simple/views/partials/head.php @@ -3,26 +3,28 @@ use Flextype\Component\{Event\Event, Http\Http, Registry\Registry, Assets\Assets, Text\Text, Html\Html}; ?> - + - + - - - - + + + + - <?php echo Html::toText($page['title']); ?> | <?php echo Html::toText(Registry::get('settings.title')); ?> + <?= Html::toText($page['title']); ?> | <?= Html::toText(Registry::get('settings.title')); ?> - - - + + + + + diff --git a/site/themes/simple/views/partials/navigation.php b/site/themes/simple/views/partials/navigation.php index 53309223..99f65f90 100755 --- a/site/themes/simple/views/partials/navigation.php +++ b/site/themes/simple/views/partials/navigation.php @@ -4,14 +4,14 @@ ?>