├── .gitattributes
├── composer.json
├── index.css
├── index.js
├── index.php
├── readme.md
└── snippets
└── plausible.php
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "floriankarsten/kirby-plausible",
3 | "description": "",
4 | "type": "kirby-plugin",
5 | "license": "MIT",
6 | "authors": [
7 | {
8 | "name": "Florian Karsten",
9 | "email": "code@floriankarsten.com"
10 | }
11 | ],
12 | "require": {
13 | "getkirby/composer-installer": "^1.1",
14 | "getkirby/cms": "^4.0 || ^5.0"
15 | },
16 | "autoload": {
17 | },
18 | "config": {
19 | "optimize-autoloader": true
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/index.css:
--------------------------------------------------------------------------------
1 | .plausible-iframe {
2 | width: 1px;
3 | min-width: 100%;
4 | height: 1600px;
5 | margin-inline: -1.5rem;
6 | color-scheme: light;
7 | background-color: transparent;
8 | outline: none;
9 | }
10 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | panel.plugin("floriankarsten/plausible", {
2 | components: {
3 | "k-plausible-view": {
4 | template: `
5 |
6 |
7 |
8 |
16 |
17 |
18 |
23 | You need to set floriankarsten.plausible.sharedLink
in config.php
24 |
25 |
26 |
27 | `,
28 | props: {
29 | sharedLink: String,
30 | },
31 | computed: {
32 | theme() {
33 | return this.$panel.theme?.current ?? "light";
34 | },
35 | },
36 | },
37 | },
38 | });
39 |
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 | [
5 | 'plausible' => function ($kirby) {
6 | return [
7 | 'label' => 'Analytics',
8 | 'icon' => 'chart',
9 | 'disabled' => false,
10 | 'menu' => true,
11 | 'link' => 'plausible',
12 | 'views' => [
13 | [
14 | 'pattern' => 'plausible',
15 | 'action' => function () use ($kirby) {
16 | return [
17 | 'component' => 'k-plausible-view',
18 | 'title' => 'Analytics',
19 | 'props' => [
20 | 'sharedLink' => option('floriankarsten.plausible.sharedLink')
21 | ],
22 | ];
23 | }
24 | ]
25 | ]
26 | ];
27 | }
28 | ],
29 | 'snippets' => [
30 | 'plausible' => __DIR__ . '/snippets/plausible.php'
31 | ]
32 | ]);
33 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # Kirby Plausible
2 | Simple plugin providing Plausible iframe panel view to Kirby panel and frontend snippet.
3 |
4 | 
5 | ## Installation
6 | `composer require floriankarsten/kirby-plausible`
7 | or download from releases
8 |
9 | ## How to use
10 | 1. Create a shared link https://plausible.io/docs/shared-links
11 | 1. Set `floriankarsten.plausible.sharedLink` in config.php
12 | ```php
13 | // config/config.php
14 | 'floriankarsten.plausible' => [
15 | // Required
16 | 'sharedLink' => 'https://plausible.io/share/yourwebsiteurl.com?auth=Jz0mCWTPu5opXi0sAgRrq',
17 | // Optional: The value that will be set in data-domain attribute of
3 |
4 |
--------------------------------------------------------------------------------