Skip to content

Commit e7804c3

Browse files
committed
Release v1.0.0
1 parent 5954a0a commit e7804c3

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

changelog.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,60 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [1.0.0] - 2017-11-15
5+
The previous version has been stable enough and no issue has been reported in 8 months :smiley:
6+
7+
I finally got time to make some improvements and update the documentation so it's time to release [v1.0.0](https://github.com/pedroborges/kirby-meta-tags/tree/v1.0.0).
8+
9+
### Changed
10+
- Options `meta-tags.default` and `meta-tags.templates` can now return a `closure` which receives `$page` and `$site` as arguments:
11+
12+
```php
13+
c::set('meta-tags.default', function(Page $page, Site $site) {
14+
return [
15+
'title' => $site->title(),
16+
'meta' => [
17+
'description' => $site->description()
18+
],
19+
'link' => [
20+
'canonical' => $page->url()
21+
],
22+
'og' => [
23+
'title' => $page->isHomePage()
24+
? $site->title()
25+
: $page->title(),
26+
'type' => 'website',
27+
'site_name' => $site->title(),
28+
'url' => $page->url()
29+
]
30+
];
31+
});
32+
```
33+
34+
- Closures in other places now receive `$site` and second argument as well:
35+
36+
```php
37+
'link' => [
38+
'canonical' => $page->url(),
39+
'alternate' => function(Page $page, Site $site) {
40+
$locales = [];
41+
42+
foreach ($site->languages() as $language) {
43+
if ($language->isDefault()) continue;
44+
45+
$locales[] = [
46+
'hreflang' => $language->code(),
47+
'href' => $page->url($language->code())
48+
];
49+
}
50+
51+
return $locales;
52+
}
53+
],
54+
```
55+
56+
Besides offering a better workflow, these changes also help avoid an issue where `site()` can't be called outside a closure from the config file in multi-language websites, as reported at getkirby/kirby#606.
57+
458
## [1.0.0-beta] - 2017-03-01
559
The plugin has gone under heavy refactor and is no longer focused only on Open Graph. For that reason the name has changed from Open Graph to Meta Tags.
660

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "meta-tags",
33
"author": "Pedro Borges <[email protected]>",
4-
"version": "1.0.0-beta",
4+
"version": "1.0.0",
55
"description": "Kirby Meta Tags",
66
"type": "kirby-plugin",
77
"license": "MIT"

0 commit comments

Comments
 (0)