-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gatsby-plugin-manifest): add i18n, localization (#13471)
* feat(gatsby-plugin-manifest): add i18n, localization * feat(gatsby-plugin-manifest): update readme * fix(gatsby-plugin-manifest): make map callback prop more readable Co-Authored-By: CanRau <cansrau@gmail.com> * fix(gatsby-plugin-manifest): make find callback prop more readable Co-Authored-By: CanRau <cansrau@gmail.com> * fix(gatsby-plugin-manifest): make find callback prop more readable Co-Authored-By: CanRau <cansrau@gmail.com> * docs(gatsby-plugin-manifest): decrease config header level Co-Authored-By: CanRau <cansrau@gmail.com> * feat(gatsby-plugin-manifest): integrate suggestions by moonmeister language manifests in the `manifests` prop now merge top level options as suggested here #13471 (comment) use option merging style in README docs: change features as suggested here #13471 (comment) * feat(gatsby-plugin-manifest): incorporate suggestions * rename `manifests` to `localize` * rename `language` to `lang` * include `lang` in manifest file * merge root options and locales * ensure root only merges if it has start_url provided * always generate root options * remove regex * use start_url as matcher * update docs & test * docs(gatsby-plugin-manifest): merge moonmeisters description * feat(gatsby-plugin-manifest): merge moonmeisters naming suggestions * remove accidentally commited .patch file * fix: issue when makeManifest is run multiple times it concatenates the cache busting to file name. * feat: add basic caching so an icon isn't generated multiple times durring a single build. * fix: overriting manifest icons when using unique images for different locales. require name based cache busting fixes this issue the simplest. * refactor: modify code to only require name chache busting when a unique icon is specified for a locale in automatic mode * docs: update docs with link to i18n example * fix: tests and digest cache bug
- Loading branch information
1 parent
5bedc01
commit d93e478
Showing
7 changed files
with
402 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/gatsby-plugin-manifest/src/__tests__/__snapshots__/gatsby-node.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Test plugin manifest options correctly works with default parameters 1`] = `"{\\"name\\":\\"GatsbyJS\\",\\"short_name\\":\\"GatsbyJS\\",\\"start_url\\":\\"/\\",\\"background_color\\":\\"#f7f0eb\\",\\"theme_color\\":\\"#a2466c\\",\\"display\\":\\"standalone\\",\\"icons\\":[{\\"src\\":\\"icons/icon-48x48.png\\",\\"sizes\\":\\"48x48\\",\\"type\\":\\"image/png\\"},{\\"src\\":\\"icons/icon-72x72.png\\",\\"sizes\\":\\"72x72\\",\\"type\\":\\"image/png\\"},{\\"src\\":\\"icons/icon-96x96.png\\",\\"sizes\\":\\"96x96\\",\\"type\\":\\"image/png\\"},{\\"src\\":\\"icons/icon-144x144.png\\",\\"sizes\\":\\"144x144\\",\\"type\\":\\"image/png\\"},{\\"src\\":\\"icons/icon-192x192.png\\",\\"sizes\\":\\"192x192\\",\\"type\\":\\"image/png\\"},{\\"src\\":\\"icons/icon-256x256.png\\",\\"sizes\\":\\"256x256\\",\\"type\\":\\"image/png\\"},{\\"src\\":\\"icons/icon-384x384.png\\",\\"sizes\\":\\"384x384\\",\\"type\\":\\"image/png\\"},{\\"src\\":\\"icons/icon-512x512.png\\",\\"sizes\\":\\"512x512\\",\\"type\\":\\"image/png\\"}]}"`; | ||
|
||
exports[`Test plugin manifest options does file name based cache busting 1`] = ` | ||
[MockFunction] { | ||
"calls": Array [ | ||
Array [ | ||
"public/manifest.webmanifest", | ||
"{\\"name\\":\\"GatsbyJS\\",\\"short_name\\":\\"GatsbyJS\\",\\"start_url\\":\\"/\\",\\"background_color\\":\\"#f7f0eb\\",\\"theme_color\\":\\"#a2466c\\",\\"display\\":\\"standalone\\",\\"icons\\":[{\\"src\\":\\"icons/icon-48x48-contentDigest.png\\",\\"sizes\\":\\"48x48\\",\\"type\\":\\"image/png\\",\\"purpose\\":\\"all\\"},{\\"src\\":\\"icons/icon-128x128-contentDigest.png\\",\\"sizes\\":\\"128x128\\",\\"type\\":\\"image/png\\"}]}", | ||
], | ||
], | ||
"results": Array [ | ||
Object { | ||
"type": "return", | ||
"value": undefined, | ||
}, | ||
], | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.