From 8c7e944acc2f137e1963913ab6c434205620fbc1 Mon Sep 17 00:00:00 2001 From: karsasmus Date: Wed, 21 Dec 2016 09:02:21 +0100 Subject: [PATCH] Added option to generate generator meta tag --- app/source/classes/Controller/APIController.php | 1 + app/source/installer/install.php | 5 +++-- app/source/templates/helpers/theme.php | 6 +++++- app/source/templates/settings.hbs | 8 ++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/source/classes/Controller/APIController.php b/app/source/classes/Controller/APIController.php index 2e65bec..3fe4df1 100644 --- a/app/source/classes/Controller/APIController.php +++ b/app/source/classes/Controller/APIController.php @@ -909,6 +909,7 @@ public function updateSettings($request, $response, $args) { 'cover' => $params['cover'], 'logo' => $params['logo'], 'favicon' => $params['favicon'], + 'generator' => $params['generator'] === 'on' ? 'on' : 'off', 'default_title' => $params['default-title'], 'default_content' => $params['default-content'], 'language' => $params['language'], diff --git a/app/source/installer/install.php b/app/source/installer/install.php index 03e596f..e25dffb 100644 --- a/app/source/installer/install.php +++ b/app/source/installer/install.php @@ -194,11 +194,14 @@ Setting::add('frag_page', 'page'); Setting::add('frag_search', 'search'); Setting::add('frag_tag', 'tag'); +Setting::add('generator', 'on'); Setting::add('hbs_cache', 'on'); Setting::add('head_code', ''); Setting::add('homepage', ''); Setting::add('language', 'en-us'); Setting::add('logo', 'source/assets/img/logo-color.png'); +Setting::add('maintenance', 'off'); +Setting::add('maintenance_message', '

Sorry for the inconvenience but we’re performing some maintenance at the moment. We’ll be back online shortly!

— The Team

'); Setting::add('navigation', '[{"label":"Home","link":"/"}]'); Setting::add('posts_per_page', '10'); Setting::add('tagline', 'Go forth and create!'); @@ -207,8 +210,6 @@ Setting::add('title', 'A Leafpub Blog'); Setting::add('twitter', ''); Setting::add('password_min_length', '8'); -Setting::add('maintenance', 'off'); -Setting::add('maintenance_message', '

Sorry for the inconvenience but we’re performing some maintenance at the moment. We’ll be back online shortly!

— The Team

'); // Insert owner try { diff --git a/app/source/templates/helpers/theme.php b/app/source/templates/helpers/theme.php index 5b43caf..956c523 100644 --- a/app/source/templates/helpers/theme.php +++ b/app/source/templates/helpers/theme.php @@ -230,7 +230,11 @@ // Handles the output for {{leafpub_head}} 'leafpub_head' => function($options) { $html = ''; - + + if (\Leafpub\Setting::get('generator') == 'on'){ + $html .= ''; + } + // If we're editing a post, add required code if($options['data']['meta']['editable']) { // Inject Leafpub data and editor stylesheet diff --git a/app/source/templates/settings.hbs b/app/source/templates/settings.hbs index aa27bcd..939f24f 100644 --- a/app/source/templates/settings.hbs +++ b/app/source/templates/settings.hbs @@ -217,6 +217,14 @@ +
+
+ +
+
{{!-- Maintenance Mode --}}

{{L 'maintenance'}}