Skip to content

Commit

Permalink
Added option to generate generator meta tag
Browse files Browse the repository at this point in the history
  • Loading branch information
karsasmus committed Dec 21, 2016
1 parent 4849200 commit 8c7e944
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/source/classes/Controller/APIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
5 changes: 3 additions & 2 deletions app/source/installer/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', '<p>Sorry for the inconvenience but we&rsquo;re performing some maintenance at the moment. We&rsquo;ll be back online shortly!</p><p>&mdash; The Team</p>');
Setting::add('navigation', '[{"label":"Home","link":"/"}]');
Setting::add('posts_per_page', '10');
Setting::add('tagline', 'Go forth and create!');
Expand All @@ -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', '<p>Sorry for the inconvenience but we&rsquo;re performing some maintenance at the moment. We&rsquo;ll be back online shortly!</p><p>&mdash; The Team</p>');

// Insert owner
try {
Expand Down
6 changes: 5 additions & 1 deletion app/source/templates/helpers/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@
// Handles the output for {{leafpub_head}}
'leafpub_head' => function($options) {
$html = '';


if (\Leafpub\Setting::get('generator') == 'on'){
$html .= '<meta name="generator" content="Leafpub v' . LEAFPUB_VERSION . '">';
}

// If we're editing a post, add required code
if($options['data']['meta']['editable']) {
// Inject Leafpub data and editor stylesheet
Expand Down
8 changes: 8 additions & 0 deletions app/source/templates/settings.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@
</div>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="generator" value="on"{{#is @settings.generator 'on'}} checked{{/is}}>
{{L 'generator_enabled'}}<br>
</label>
</div>
</div>
{{!-- Maintenance Mode --}}
<h3 class="mt-3">{{L 'maintenance'}}</h3>
<div class="form-group">
Expand Down

0 comments on commit 8c7e944

Please sign in to comment.