-
Notifications
You must be signed in to change notification settings - Fork 0
/
extend.php
28 lines (24 loc) · 1.18 KB
/
extend.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
<?php
use Flarum\Extend;
use Flarum\Frontend\Document;
use Cosname\Listener;
use Illuminate\Contracts\Events\Dispatcher;
return [
// Load JS script
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js'),
// Add CSS and JS resources
(new Extend\Frontend('forum'))
->content(function (Document $document) {
$document->head = array_merge($document->head,
[
'<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css" integrity="sha256-V8SV2MO1FUb63Bwht5Wx9x6PVHNa02gv8BgH/uH3ung=" crossorigin="anonymous" />',
'<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.js" integrity="sha256-F/Xda58SPdcUCr+xhSGz9MA2zQBPb0ASEYKohl8UCHc=" crossorigin="anonymous"></script>',
'<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/contrib/auto-render.min.js" integrity="sha256-90d2pnfw0r4K8CZAWPko4rpFXQsZvJhTBGYNkipDprI=" crossorigin="anonymous"></script>'
]
);
}),
// Add listener
(new Extend\Event)
->subscribe(Listener\FindLatexExpressions::class)
];