File tree Expand file tree Collapse file tree 5 files changed +50
-46
lines changed
packages/gatsby-plugin-manifest Expand file tree Collapse file tree 5 files changed +50
-46
lines changed Original file line number Diff line number Diff line change 11/gatsby-node.js
22/gatsby-ssr.js
33/gatsby-browser.js
4+ /common.js
45/app-shell.js
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ plugins: [
4545 background_color: " #f7f0eb" ,
4646 theme_color: " #a2466c" ,
4747 display: " minimal-ui" ,
48- icon: src/ images/ icon .png // This path is relative to the root of the site.
48+ icon: " src/images/icon.png" // This path is relative to the root of the site.
4949 },
5050 },
5151];
Original file line number Diff line number Diff line change 1+ // default icons for generating icons
2+ exports . defaultIcons = [
3+ {
4+ "src" : `icons/icon-48x48.png` ,
5+ "sizes" : `48x48` ,
6+ "type" : `image/png` ,
7+ } ,
8+ {
9+ "src" : `icons/icon-72x72.png` ,
10+ "sizes" : `72x72` ,
11+ "type" : `image/png` ,
12+ } ,
13+ {
14+ "src" : `icons/icon-96x96.png` ,
15+ "sizes" : `96x96` ,
16+ "type" : `image/png` ,
17+ } ,
18+ {
19+ "src" : `icons/icon-144x144.png` ,
20+ "sizes" : `144x144` ,
21+ "type" : `image/png` ,
22+ } ,
23+ {
24+ "src" : `icons/icon-192x192.png` ,
25+ "sizes" : `192x192` ,
26+ "type" : `image/png` ,
27+ } ,
28+ {
29+ "src" : `icons/icon-256x256.png` ,
30+ "sizes" : `256x256` ,
31+ "type" : `image/png` ,
32+ } ,
33+ {
34+ "src" : `icons/icon-384x384.png` ,
35+ "sizes" : `384x384` ,
36+ "type" : `image/png` ,
37+ } ,
38+ {
39+ "src" : `icons/icon-512x512.png` ,
40+ "sizes" : `512x512` ,
41+ "type" : `image/png` ,
42+ } ,
43+ ]
44+
Original file line number Diff line number Diff line change 11const fs = require ( `fs` )
22const Promise = require ( `bluebird` )
33const sharp = require ( `sharp` )
4-
5- // default icons for generating icons
6- const defaultIcons = [
7- {
8- "src" : `icons/icon-48x48.png` ,
9- "sizes" : `48x48` ,
10- "type" : `image/png` ,
11- } ,
12- {
13- "src" : `icons/icon-72x72.png` ,
14- "sizes" : `72x72` ,
15- "type" : `image/png` ,
16- } ,
17- {
18- "src" : `icons/icon-96x96.png` ,
19- "sizes" : `96x96` ,
20- "type" : `image/png` ,
21- } ,
22- {
23- "src" : `icons/icon-144x144.png` ,
24- "sizes" : `144x144` ,
25- "type" : `image/png` ,
26- } ,
27- {
28- "src" : `icons/icon-192x192.png` ,
29- "sizes" : `192x192` ,
30- "type" : `image/png` ,
31- } ,
32- {
33- "src" : `icons/icon-256x256.png` ,
34- "sizes" : `256x256` ,
35- "type" : `image/png` ,
36- } ,
37- {
38- "src" : `icons/icon-384x384.png` ,
39- "sizes" : `384x384` ,
40- "type" : `image/png` ,
41- } ,
42- {
43- "src" : `icons/icon-512x512.png` ,
44- "sizes" : `512x512` ,
45- "type" : `image/png` ,
46- } ,
47- ]
4+ const defaultIcons = require ( `./common.js` ) . defaultIcons
485
496sharp . simd ( true )
507
Original file line number Diff line number Diff line change 11import React from "react"
22import { withPrefix } from "gatsby-link"
3+ import { defaultIcons } from "./common.js"
4+
35
46exports . onRenderBody = ( { setHeadComponents } , pluginOptions ) => {
57
6- const { icons } = pluginOptions
8+ const icons = pluginOptions . icons || defaultIcons
79 const iconPath = icons [ 0 ] . src . substring ( 0 , icons [ 0 ] . src . lastIndexOf ( `/` ) )
810
911 setHeadComponents ( [
You can’t perform that action at this time.
0 commit comments