Skip to content

Commit

Permalink
doc(gatsby-plugin-subfont): add options in README
Browse files Browse the repository at this point in the history
  • Loading branch information
palindrom615 committed Feb 27, 2020
1 parent d0c1914 commit 6d8f5bf
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions packages/gatsby-plugin-subfont/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,38 @@ If you want the ability to run font subsetting locally you'l need Python and ins
```javascript
// In your gatsby-config.js
module.exports = {
plugins: [{
resolve: `gatsby-plugin-subfont`,
options: {
silent: true,
fallback: false,
inlineFonts: true,
}
}],
plugins: [
{
resolve: `gatsby-plugin-subfont`,
options: {
silent: true,
fallback: false,
inlineFonts: true,
},
},
],
}
```

You can use any option of [https://github.com/Munter/subfont/blob/4b5a59afd17008ca35b6c32b52e3e922159e22fc/lib/subfont.js#L10](subfont)
## Options

See [subfont](https://github.com/Munter/subfont/blob/4b5a59afd17008ca35b6c32b52e3e922159e22fc/lib/subfont.js#L10) for a full list of options.

| Name | Default | Description |
| --------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `root` | `public` | Path to your web root |
| `canonicalRoot` | | URI root where the site will be deployed. Must be either an absolute, a protocol-relative, or a root-relative url |
| `output` | | Directory where results should be written to | | |
| `fallbacks` | `true` | Include fallbacks so the original font will be loaded when dynamic content gets injected at runtime. |
| `dynamic` | `false` | Also trace the usage of fonts in a headless browser with JavaScript enabled |
| `inPlace` | `true` | Modify HTML-files in-place. Only use on build artifacts |
| `inlineFonts` | `false` | Inline fonts as data-URIs inside the @font-face declaration |
| `inlineCss` | `true` | Inline CSS that declares the @font-face for the subset fonts |
| `fontDisplay` | `swap` | Injects a font-display value into the @font-face CSS. Valid values: auto, block, swap, fallback, optional |
| `formats` | `['woff2', 'woff']` | Font formats to use when subsetting. [choices: "woff2", "woff", "truetype"] |
| `subsetPerPage` | `false` | Create a unique subset for each page. |
| `recursive` | `false` | Crawl all HTML-pages linked with relative and root relative links. This stays inside your domain |
| `silent` | `true` | Do not write anything to stdout |
| `debug` | `false` | Verbose insights into font glyph detection |
| `dryRun` | `false` | Don't write anything to disk |
| `inputFiles` | `['public/index.html']` | htmlFile(s) or url(s) |

0 comments on commit 6d8f5bf

Please sign in to comment.