Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Jan 23, 2022
1 parent 302487d commit 0c25d93
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ packages/docusaurus-*/lib/*
packages/docusaurus-*/lib-next/
packages/create-docusaurus/lib/*
packages/create-docusaurus/templates/
website/static/katex/katex.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ module.exports = {

## Self-hosting KaTeX assets

Loading stylesheets, fonts, and javascript libraries from CDN sources is a good practice for popular libraries and assets. Provided such assets are widely used across various websites, those assets will not be downloaded every time we visit a new website that uses the same assets, rather they would be cached by the browser reducing network load. In case you prefer to self-host the `katex.min.css` (along with required KaTeX fonts), you can download the latest version from [KaTeX GitHub releases](https://github.com/KaTeX/KaTeX/releases). Extract and copy `katex.min.css` and `fonts` directory (only `.woff2` font types should be enough) to docusaurus `static` directory. And in `docusaurus.config.js`, replace the css `href` from CDN url to your local path (say, `/katex/katex.min.css`).
Loading stylesheets, fonts, and javascript libraries from CDN sources is a good practice for popular libraries and assets. If the same assets are used across various websites, they will be cached by the browser instead of being downloaded every time we visit a new website, reducing network load. In case you prefer to self-host the `katex.min.css` (along with required KaTeX fonts), you can download the latest version from [KaTeX GitHub releases](https://github.com/KaTeX/KaTeX/releases), extract and copy `katex.min.css` and `fonts` directory (only `.woff2` font types should be enough) to your site's `static` directory, and in `docusaurus.config.js`, replace the stylesheet's `href` from the CDN url to your local path (say, `/katex/katex.min.css`).

```js title="docusaurus.config.js"
module.exports = {
Expand Down
Loading

0 comments on commit 0c25d93

Please sign in to comment.