Skip to content

Commit

Permalink
Merge pull request #14 from thisislawatts/patch-1
Browse files Browse the repository at this point in the history
docs: update setup steps
  • Loading branch information
iskrisis committed Jul 29, 2024
2 parents 054fae0 + 840ba80 commit 4ec477d
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions readme.md
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

0 comments on commit 4ec477d

Please sign in to comment.