fix cdn backed styles links

main
Mike Fix 6 years ago
parent 2d62122131
commit 3ed659e894

@ -12,7 +12,7 @@ export function Link({ href }) {
return ( return (
<Head> <Head>
<link rel="preload" as="style" href={href} /> <link rel="preload" as="style" href={href} />
<link key={href} rel="stylesheet" href={href} /> <link rel="stylesheet" href={href} />
</Head> </Head>
) )
} }
@ -64,8 +64,7 @@ export const MetaLinks = () => {
{LOCAL_STYLESHEETS.map(id => ( {LOCAL_STYLESHEETS.map(id => (
<Link key={id} href={`/static/themes/${id}.css`} /> <Link key={id} href={`/static/themes/${id}.css`} />
))} ))}
{CDN_STYLESHEETS.map(theme => { {CDN_STYLESHEETS.map(themeDef => {
const themeDef = THEMES_HASH[theme]
const href = `//cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.2/theme/${themeDef && const href = `//cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.2/theme/${themeDef &&
(themeDef.link || themeDef.id)}.min.css` (themeDef.link || themeDef.id)}.min.css`
return <Link key={href} href={href} /> return <Link key={href} href={href} />

Loading…
Cancel
Save