Skip to content

Commit

Permalink
Load katex style
Browse files Browse the repository at this point in the history
  • Loading branch information
timothymcmackin committed Dec 11, 2024
1 parent 199bd52 commit 3c18e3e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
// But unsafe-eval should NOT be in production builds
// Also, put GTM first because sometimes the ';' in the escaped single quotes causes the browser to think it's the end
const scriptSrc = process.env.NODE_ENV === 'development' ?
`https://*.googletagmanager.com 'self' 'unsafe-inline' 'unsafe-eval'`
: `https://*.googletagmanager.com 'self' 'unsafe-inline'`;
`https://*.googletagmanager.com https://cdn.jsdelivr.net 'self' 'unsafe-inline' 'unsafe-eval'`
: `https://*.googletagmanager.com https://cdn.jsdelivr.net 'self' 'unsafe-inline'`;

const contentSecurityPolicy = `
default-src 'none';
base-uri 'self';
manifest-src 'self';
script-src ${scriptSrc};
style-src 'self' 'unsafe-inline';
font-src 'self';
style-src https://cdn.jsdelivr.net 'self' 'unsafe-inline';
font-src https://cdn.jsdelivr.net 'self';
img-src 'self' https://*.googletagmanager.com https://*.google-analytics.com data:;
media-src 'self';
form-action 'self';
Expand Down Expand Up @@ -157,5 +157,14 @@ module.exports = async function createConfigAsync() {
//... other Algolia params
},
}),
stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
type: 'text/css',
integrity:
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
crossorigin: 'anonymous',
},
],
};
};

0 comments on commit 3c18e3e

Please sign in to comment.