-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
executable file
·51 lines (43 loc) · 1.17 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/*
* kirby 3 kirbytag - quote
* boostrap style blockquotes
*
* copyright: Jannik Beyerstedt | http://jannikbeyerstedt.de | [email protected]
* license: http://www.gnu.org/licenses/gpl-3.0.txt GPLv3 License
*/
Kirby::plugin('jbeyerstedt/quote', [
'options' => [
'default_style' => 'none'
],
'tags' => [
'quote' => [
'attr' => [
'author',
'class',
'cite'
],
'html' => function($tag) {
$html = '';
$class = $tag->class;
if ($tag->option('jbeyerstedt.quote.default_style') == 'bs') {
$class .= ' blockquote';
}
$html .= '<blockquote class="' . $class . '">';
$class_p = '';
if ($tag->option('jbeyerstedt.quote.default_style') == 'bs') {
$class_p .= ' mb-0';
}
$html .= '<p class="' . $class_p . '">'. $tag->value .'</p>';
if ($tag->author != '') {
$html .= '<footer class="blockquote-footer">' . $tag->author . '</footer>';
if ($tag->cite != '') {
$html .= '<cite>' . $tag->cite . '</cite>';
}
}
$html .= '</blockquote>';
return $html;
}
]
]
]);