-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from thisislawatts/patch-1
docs: update setup steps
- Loading branch information
Showing
1 changed file
with
20 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,30 @@ | ||
# Kirby Plausible | ||
Simple plugin providing plausible iframe panel view to kirby panel and simple frontend snippet. | ||
Simple plugin providing Plausible iframe panel view to Kirby panel and frontend snippet. | ||
|
||
![CleanShot 2021-11-04 at 17 53 43](https://user-images.githubusercontent.com/4954323/140384031-efdf83d7-06a3-4ce3-a60b-3827fe63fd9c.png) | ||
## Instalation | ||
## Installation | ||
`composer require floriankarsten/kirby-plausible` | ||
or download from releases | ||
|
||
## How to use | ||
1. Create a shared link https://plausible.io/docs/shared-links | ||
2. Set `floriankarsten.plausible.sharedLink` in config.php | ||
|
||
There is also `floriankarsten.plausible.domain` which allows you to overwrite `data-domain` in the frontend snippet. | ||
|
||
`config.php` example | ||
```php | ||
'floriankarsten.plausible' => [ | ||
'sharedLink' => 'https://plausible.io/share/yourwebsiteurl.com?auth=Jz0mCWTPu5opXi0sAgRrq', | ||
'domain' => 'test.com', // not required if not set it will be taken from $site->url | ||
// To use a self-hosted Plausible instance | ||
//'scriptHost' => 'https://plausible.example.com', | ||
// To use Plausible script extensions | ||
//'scriptName' => 'plausible.outbound-links.exclusions' | ||
]; | ||
``` | ||
|
||
Frontend snippet place iside head tag. Automatically disabled when kirby is in debug mode. | ||
```php | ||
<?php snippet('plausible'); ?> | ||
``` | ||
1. Set `floriankarsten.plausible.sharedLink` in config.php | ||
```php | ||
// config/config.php | ||
'floriankarsten.plausible' => [ | ||
// Required | ||
'sharedLink' => 'https://plausible.io/share/yourwebsiteurl.com?auth=Jz0mCWTPu5opXi0sAgRrq', | ||
// Optional: The value that will be set in data-domain attribute of <script> tag. | ||
'domain' => 'test.com', // Defaults to $site->url() | ||
// Optional: To use a self-hosted Plausible instance | ||
// 'scriptHost' => 'https://plausible.example.com', | ||
// Optional: To use Plausible script extensions | ||
// 'scriptName' => 'plausible.outbound-links.exclusions' | ||
]; | ||
``` | ||
1. Add the following snippet inside your site's `<head>` tag. Note that this will not generate any output for logged in users or when Kirby is in debug mode. | ||
```php | ||
<?php snippet('plausible'); ?> | ||
``` | ||
This plugin wouldn't happen without [@garethworld](https://github.com/garethworld) who kindly hired me to make it and then wanted to have it released to Kirby community. Yaaaaay |