There hasn't been much worth writing about on the blog lately, so I've just been posting filler. Since I've gotten used to it, I might as well post another filler piece. As everyone knows, Flarum is software from overseas, so it uses Google's static resource library when loading resources. Because of China's Great Firewall, loading is extremely slow. Fortunately, there are also many open-source static resource libraries in China, which means we can use them as a replacement for googleapis.com. This article chooses BootCDN as the main subject.
Google Fonts
In the following files:
vendor/flarum/core/views/install/app.php
vendor/flarum/core/src/Http/WebApp/WebAppView.php
Change:
fonts.googleapis.com
to:
fonts.css.network
If you don't need Google Fonts, you can simply delete the entire line.
Emojione
In the following file:
vendor/flarum/flarum-ext-emoji/js/forum/dist/extension.js
Change:
jsdelivr.net/emojione
to:
bootcss.com/emojione/2.2.7
If you use the Emojione emoji preview plugin, because this plugin uses Cloudflare's CDN and is basically only friendly to mobile users (Hong Kong node), you also need to modify the following file:
vendor/clarkwinkelmann/flarum-ext-emojionearea/js/forum/dist/extension.js
Change:
https://cdnjs.cloudflare.com/ajax/libs/emojione/
to:
https://cdn.bootcss.com/emojione/
Highlight.js
In the following file:
vendor/s9e/text-formatter/src/Plugins/BBCodes/Configurator/repository.xml
Change the following four occurrences:
//cdnjs.cloudflare.com/ajax/libs/highlight.js
to:
//cdn.bootcss.com/highlight.js