Repository navigation
chore: include katex fonts in resources - #9673
AllanChain wants to merge 1 commit into
Conversation
|
@AllanChain Hi. Unfortunately this isn't helpful to us as these are a large number of unverified resources and that puts our users at risk. If we are to bring a large number of resources like this, it would need to be automated and come from an official distributor. I've added a note about this in number 7 under https://github.com/logseq/logseq/blob/master/CONTRIBUTING.md#pr-guidelines. At some point we may introduce a proxy CDN for resources like this to ensure more stability in regions |
|
However, it's very easy to verify the resource. In logseq repo: cd resources/fonts/katex
sha256sum *In a temp dir: wget https://github.com/KaTeX/KaTeX/releases/download/v0.16.7/katex.zip
cd katex/fonts
sha256sum *.woff2Also, a proxy CDN is not an optimal choice. It costs money and it's not helpful for the future growth of logseq. We can just add an extra build step to download the resources from GitHub / NPM. Currently, KaTeX fonts are the only resource that rely on jsdelivr. If you do think jsdelivr stability is a problem, including the fonts is the best way to fix it for now. |
|
@AllanChain I'm okay if can setup a pipeline to validate the sha256sum from official source instead of just putting the static resource
|
|
@AllanChain Like @cnrpman said, if you can have these resources integrated into our build process through, gulp, npm and/or shadow-cljs, then we are open to the change. Just copying and pasting this many resources is needless risk and a maintenance burden for us |
The KaTeX fonts are not included in the resources and are fetched for jsdelivr for some (unknown and historical) reasons. But jsdelivr is not quite stable in some regions and loading the font from the Internet can have some problems when offline.
I downloaded the fonts from the KaTeX GitHub release and kept only the woff2 fonts. I also updated the font URL.