Skip to content

Commit

Permalink
Chore: Changelog + README update
Browse files Browse the repository at this point in the history
  • Loading branch information
ceesvanegmond committed Mar 13, 2023
1 parent bb224a3 commit 301d7ec
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Changelog
All notable changes to this project will be documented in this file.

## [3.0] - 2023-03-13
### Fixed
- Fixed PHP8.2 compatiliby
- Take over package from pedroborges; big thanks to him!

### Breaking
- We've changed the references from pedroborges to wearejust


## [2.1.0] - 2021-07-19
### Fixed
- Instance cache. It now caches one instance per page.
Expand Down
35 changes: 14 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
# Kirby Meta Tags [![Release](https://img.shields.io/github/release/pedroborges/kirby-meta-tags.svg)](https://github.com/pedroborges/kirby-meta-tags/releases) [![Issues](https://img.shields.io/github/issues/pedroborges/kirby-meta-tags.svg)](https://github.com/pedroborges/kirby-meta-tags/issues)
# Kirby Meta Tags [![Release](https://img.shields.io/github/release/wearejust/kirby-meta-tags.svg)](https://github.com/wearejust/kirby-meta-tags/releases) [![Issues](https://img.shields.io/github/issues/wearejust/kirby-meta-tags.svg)](https://github.com/wearejust/kirby-meta-tags/issues)

HTML meta tags generator for Kirby. Supports [Open Graph](http://ogp.me), [Twitter Cards](https://dev.twitter.com/cards/overview), and [JSON Linked Data](https://json-ld.org) out of the box.

## Requirements
- Kirby 3
- PHP 7.1+
- PHP 8.0

## Installation

### Download
Download and copy this repository to `site/plugins/meta-tags`.

### Git submodule
```
git submodule add https://github.com/pedroborges/kirby-meta-tags.git site/plugins/meta-tags
```

### Composer
```
composer require pedroborges/kirby-meta-tags
composer require wearejust/kirby-meta-tags
```

> For Kirby 2, you can download [v1.1.1](https://github.com/pedroborges/kirby-meta-tags/archive/v1.1.1.zip) and copy the files to `site/plugins/meta-tags`.
## Basic Usage
After installing the Meta Tags plugin, you need to add one line to the `head` element on your template, or `header.php` snippet:

Expand Down Expand Up @@ -52,7 +45,7 @@ The plugin ships with some default meta tags enabled for your convenience:
```php
return [
// other options...
'pedroborges.meta-tags.default' => function ($page, $site) {
'wearejust.meta-tags.default' => function ($page, $site) {
return [
'title' => $site->title(),
'meta' => [
Expand All @@ -74,15 +67,15 @@ return [
]
```

**The `pedroborges.meta-tags.default` option is applied to all pages on your Kirby site.** Of course you can change the defaults. In order to do that, just copy this example to your `site/config/config.php` file and tweak it to fit your website needs.
**The `wearejust.meta-tags.default` option is applied to all pages on your Kirby site.** Of course you can change the defaults. In order to do that, just copy this example to your `site/config/config.php` file and tweak it to fit your website needs.

### Templates
Following the flexible spirit of Kirby, you also have the option to add template specific meta tags:

```php
return [
// other options...
'pedroborges.meta-tags.templates' => function ($page, $site) {
'wearejust.meta-tags.templates' => function ($page, $site) {
return [
'song' => [
'og' => [
Expand All @@ -108,13 +101,13 @@ For more information on all the `meta`, `link`, Open Graph and Twitter Card tags
- [Twitter Cards](https://dev.twitter.com/cards/overview)

## Options
Both the `pedroborges.meta-tags.default` and `pedroborges.meta-tags.templates` accept similar values:
Both the `wearejust.meta-tags.default` and `wearejust.meta-tags.templates` accept similar values:

### `pedroborges.meta-tags.default`
### `wearejust.meta-tags.default`
It accepts an array containing any or all of the following keys: `title`, `meta`, `link`, `og`, and `twitter`. With the exception of `title`, all other groups must return an array of key-value pairs. Check out the [tag groups](#tag-groups) section to learn which value types are accepted by each key.

```php
'pedroborges.meta-tags.default' => function ($page, $site) {
'wearejust.meta-tags.default' => function ($page, $site) {
return [
'title' => 'Site Name',
'meta' => [ /* meta tags */ ],
Expand All @@ -126,11 +119,11 @@ It accepts an array containing any or all of the following keys: `title`, `meta`
}
```

### `pedroborges.meta-tags.templates`
### `wearejust.meta-tags.templates`
This option allows you to define a template specific set of meta tags. It must return an array where each key corresponds to the template name you are targeting.

```php
'pedroborges.meta-tags.templates' => function ($page, $site) {
'wearejust.meta-tags.templates' => function ($page, $site) {
return [
'article' => [ /* tags groups */ ],
'about' => [ /* tags groups */ ],
Expand All @@ -139,7 +132,7 @@ This option allows you to define a template specific set of meta tags. It must r
}
```

When a key matches the current page template name, it is merged and overrides any repeating properties defined on the `pedroborges.meta-tags.default` option so you don't have to repeat yourself.
When a key matches the current page template name, it is merged and overrides any repeating properties defined on the `wearejust.meta-tags.default` option so you don't have to repeat yourself.

## Tag Groups
These groups accept string, closure, or array as their values. Being so flexible, the sky is the limit to what you can do with Meta Tags!
Expand Down Expand Up @@ -244,7 +237,7 @@ Where you can define [Open Graph](http://ogp.me) `<meta>` elements.
Of course you can use Open Graph [structured objects](http://ogp.me/#structured). Let's see a blog post example:

```php
'pedroborges.meta-tags.templates' => function ($page, $site) {
'wearejust.meta-tags.templates' => function ($page, $site) {
return [
'article' => [ // template name
'og' => [ // tags group name
Expand Down Expand Up @@ -377,7 +370,7 @@ Use this tag group to add [JSON Linked Data](https://json-ld.org) schemas to you
</p></details>

## Change Log
All notable changes to this project will be documented at: <https://github.com/pedroborges/kirby-meta-tags/blob/master/CHANGELOG.md>
All notable changes to this project will be documented at: <https://github.com/wearejust/kirby-meta-tags/blob/master/CHANGELOG.md>

## License
The Meta Tags plugin is open-sourced software licensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php).
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@include_once __DIR__.'/vendor/autoload.php';

Kirby::plugin('pedroborges/meta-tags', [
Kirby::plugin('wearejust/meta-tags', [
'pageMethods' => [
'metaTags' => function ($groups = null) {
return metaTags($this)->render($groups);
Expand Down

0 comments on commit 301d7ec

Please sign in to comment.