Skip to content

Commit b64b4ac

Browse files
authored
Merge pull request #19 from diesdasdigital/develop
Bug fixes and small enhancements
2 parents 316779c + e9526b5 commit b64b4ac

File tree

6 files changed

+77
-26
lines changed

6 files changed

+77
-26
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ We'd also like to thank @distantnative for his help along the way! Without him t
1919

2020
## Config options
2121

22-
By default the *Page Title* will be rendered before the *Site Title*. Resulting in a title tag that looks like this: `<title>Page Title – Site Title</title>`. If you want the *Site Title* to come first, simply add the following lines to your Kirby `config.php` file:
22+
### Site title
23+
24+
#### Order
25+
26+
By default the _Page Title_ will be rendered before the _Site Title_. Resulting in a title tag that looks like this: `<title>Page Title – Site Title</title>`. If you want the _Site Title_ to come first, simply add the following lines to your Kirby `config.php` file:
2327

2428
```
2529
'diesdasdigital.meta-knight' => [
@@ -29,6 +33,18 @@ By default the *Page Title* will be rendered before the *Site Title*. Resulting
2933

3034
You'll then get a title tag that looks like this: `<title>Site Title – Page Title</title>`.
3135

36+
#### Hide page title on home page
37+
38+
By default the title tag of the home page will include both the _page title_ and the _site title_ and look like this: `<title>Page Title – Site Title</title>`. If you want to only display the site title on the homepage, simply add the following lines to your Kirby `config.php` file:
39+
40+
```
41+
'diesdasdigital.meta-knight' => [
42+
'siteTitleAsHomePageTitle' => false,
43+
],
44+
```
45+
46+
The title tage of your home page will then look like this: `<title>Site Title</title>`
47+
3248
---
3349

3450
## Installation

index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
Kirby::plugin('diesdasdigital/kirby-meta-knight', [
3+
Kirby::plugin('diesdasdigital/meta-knight', [
44
'sections' => [
55
'google_search_preview' => require_once __DIR__ . '/sections/google_search_preview.php',
66
'facebook_sharing_preview' => require_once __DIR__ . '/sections/facebook_sharing_preview.php',
@@ -24,5 +24,9 @@
2424
'metaknight.meta_description_missing' => 'Description Missing.',
2525
'metaknight.meta_keywords_missing' => 'Keywords Missing.',
2626
],
27+
],
28+
'options' => [
29+
'siteTitleAfterPageTitle' => true,
30+
'siteTitleAsHomePageTitle' => false
2731
]
2832
]);

sections/google_search_preview.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@
1313
'url' => function () {
1414
return $this->model()->url();
1515
},
16+
'uid' => function () {
17+
return $this->model()->uid();
18+
},
1619
'siteTitleAfterPageTitle' => function () {
1720
return option('diesdasdigital.meta-knight.siteTitleAfterPageTitle', true);
21+
},
22+
'siteTitleAsHomePageTitle' => function () {
23+
return option('diesdasdigital.meta-knight.siteTitleAsHomePageTitle', false);
1824
}
1925
]
2026
];

0 commit comments

Comments
 (0)