Stencil - 如何添加新字体?

Stencil - How are new fonts added?

这个变量是如何或在哪里定义在模板中的?

{{ getFontsCollection }}

我希望在主题中包含其他 google 字体。如果它们在 schema.json 中列出,是否会自动包括在内?

它们是通过 config file

添加的

根据Stencil DocsgetFontsCollection是一个handlebars injection helper function,用于帮助您在页面上加载资源:

{{getFontsCollection}}

getFontsCollection 助手是 Stencil 自定义的。它 returns 一个 link 标签加载所有选定的字体集合。它不需要参数。

helper method 从位于 config.json 文件中的全局 getThemeSettings() 中提取。查找 primary-fontsecondary-font 字段

"settings": {
        "primary-font": "Google_Lato_700,400,300",
        "secondary-font": "Google_Droid+Serif_400italic,400,700",
        ...
}