我正在使用Gatsby.js及其带有Irving 主题的Typography插件。
此主题需要 Google 字体"Exo"和"Yrsa"<head>
,并在导出的静态 html 文件部分添加导入:
<link href="//fonts.googleapis.com/css?family=Exo:700|Yrsa:400,700" rel="stylesheet" type="text/css"/>
此导入是阻止渲染的内容,如果可能的话,对于用户和我的 Google PageSpeed Insights 分数,我都希望避免它。
我尝试使用gatsby-plugin-google-fonts并将以下内容添加到我的gatsby-config.js 中:
{
resolve: `gatsby-plugin-google-fonts`,
options: {
fonts: [
`Exo\:700`,
`Yrsa\:400,700`,
],
}
},
然而,这只是增加了第二个导入调用。我应该将它们放在静态目录中吗?即使那样,我如何配置 Typography 以仍然使用这些字体而不单独导入它们?