1
0
Fork 0

Upgrade to Kirby 3

This commit is contained in:
Jannik Beyerstedt 2021-01-24 18:05:39 +01:00
parent 80004a968c
commit 03ab30b8c1
64 changed files with 524 additions and 683 deletions

View file

@ -1 +0,0 @@
../../modules/columns-plugin

View file

@ -0,0 +1,27 @@
<?php
# copied at 2021-01-23 from https://getkirby.com/docs/cookbook/extensions/columns-in-kirbytext
Kirby::plugin('kirby/columns', [
'hooks' => [
'kirbytags:before' => function ($text, array $data = []) {
$text = preg_replace_callback('!\(columns(…|\.{3})\)(.*?)\((…|\.{3})columns\)!is', function($matches) use($text, $data) {
$columns = preg_split('!(\n|\r\n)\+{4}\s+(\n|\r\n)!', $matches[2]);
$html = [];
$classItem = $this->option('kirby.columns.item', 'column');
$classContainer = $this->option('kirby.columns.container', 'columns');
foreach ($columns as $column) {
$html[] = '<div class="' . $classItem . '">' . $this->kirbytext($column, $data) . '</div>';
}
return '<div class="' . $classContainer . '">' . implode($html) . '</div>';
}, $text);
return $text;
}
]
]);

View file

@ -1 +0,0 @@
../../modules/kirby-plugin-kirbytextRaw

View file

@ -1 +0,0 @@
.idea

View file

@ -1,33 +0,0 @@
# Piwik plugin
A plugin for [Kirby CMS](http://getkirby.com) that generates piwik analytics code to use in your templates.
## Installation
Put the `piwik` folder in `/site/plugins`.
Configure piwik URL and site id in your page config.
### Config Variables
- spicy.piwik.active: true / false (Default: true)
- spicy.piwik.url: 'stats.yourpage.com'
- spicy.piwik.id: 1 (replace with the page ID in your piwik installation)
## How to use it
You can use this in a template file.
## Example usage
### Snippets
```php
<!-- use this right before closing </body> tag -->
<?php echo piwik(); ?>
```
## Author
Michael Fürmann @ Spicy Web
<https://spicyweb.de>

View file

@ -1,18 +0,0 @@
<?php
/**
* Piwik Plugin
*
* @author Michael Fürmann <michael@spicyweb.de>
* @version 1.0.0
*/
function piwik($options = array()) {
if(!c::get('spicy.piwik.active', true) || !c::get('spicy.piwik.url') || !c::get('spicy.piwik.id'))
return;
$options['url'] = c::get('spicy.piwik.url');
$options['id'] = c::get('spicy.piwik.id');
// Return template HTML
return tpl::load(__DIR__ . DS . 'template.php', $options);
}
?>

View file

@ -1,15 +0,0 @@
<!-- Piwik -->
<script type="text/javascript" nonce="nRfqpuKWNuYyUAFPTr6WVNZk9">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="<?= $url?>/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', <?= $id?>]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="<?= $url?>/piwik.php?idsite=<?= $id?>" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->

View file

@ -1 +0,0 @@
../../modules/kirby-plugin-thumbExt