diff --git a/.gitignore b/.gitignore index 1a4aa37dc..6e3e25ec5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,10 @@ node_modules .cache/ # Build directory -public/ +public/* static/admin/*.bundle.* .DS_Store yarn-error.log +# Exception for files generated by gatsby-plugin-manifest to reduce production build time +!public/icons +!public/manifest.webmanifest diff --git a/README.md b/README.md index dc99c0dfa..fe76822a3 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ It follows the [JAMstack architecture](https://jamstack.org) by using Git as a s - Separate components for everything - Netlify deploy configuration - Perfect score on Lighthouse for SEO, Accessibility and Performance (wip:PWA) +- Web app manifest and app icons (favicon) generated from a source SVG with `gatsby-plugin-manifest`. Note that generated icons are code-committed to reduce production build time, and should be re-committed whenever the source SVG changes. - ..and more ## Prerequisites diff --git a/gatsby-config.js b/gatsby-config.js index 45f0a47c9..201f5c146 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -29,6 +29,18 @@ module.exports = { name: 'images', }, }, + { + resolve: `gatsby-plugin-manifest`, + options: { + name: `Kaldi`, + short_name: `Kaldi`, + start_url: `/`, + background_color: `#FFFFFF`, + theme_color: `#FFFFFF`, + icon: `src/img/favicon.svg`, + include_favicon: true, + }, + }, 'gatsby-plugin-sharp', 'gatsby-transformer-sharp', { diff --git a/package-lock.json b/package-lock.json index 3a0daec84..ebce8c9eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6213,8 +6213,7 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true, - "optional": true + "bundled": true }, "aproba": { "version": "1.2.0", @@ -6232,13 +6231,11 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6251,18 +6248,15 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "concat-map": { "version": "0.0.1", - "bundled": true, - "optional": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "core-util-is": { "version": "1.0.2", @@ -6365,8 +6359,7 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "optional": true + "bundled": true }, "ini": { "version": "1.3.5", @@ -6376,7 +6369,6 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -6389,20 +6381,17 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "optional": true + "bundled": true }, "minipass": { "version": "2.3.5", "bundled": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -6419,7 +6408,6 @@ "mkdirp": { "version": "0.5.1", "bundled": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -6492,8 +6480,7 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "optional": true + "bundled": true }, "object-assign": { "version": "4.1.1", @@ -6503,7 +6490,6 @@ "once": { "version": "1.4.0", "bundled": true, - "optional": true, "requires": { "wrappy": "1" } @@ -6579,8 +6565,7 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true, - "optional": true + "bundled": true }, "safer-buffer": { "version": "2.1.2", @@ -6610,7 +6595,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -6628,7 +6612,6 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -6667,13 +6650,11 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, - "optional": true + "bundled": true }, "yallist": { "version": "3.0.3", - "bundled": true, - "optional": true + "bundled": true } } }, @@ -6952,6 +6933,16 @@ "prop-types": "^15.6.1" } }, + "gatsby-plugin-manifest": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/gatsby-plugin-manifest/-/gatsby-plugin-manifest-2.0.19.tgz", + "integrity": "sha512-pUjjVgWdL2hhT2UnP5uUeweQsH2546dMcjjCLt/b6ho79u3K8lX14tYQoss1XEeEIpyEviZ16ur+g4EppP74cA==", + "requires": { + "@babel/runtime": "^7.0.0", + "bluebird": "^3.5.0", + "sharp": "^0.21.3" + } + }, "gatsby-plugin-netlify": { "version": "2.0.11", "resolved": "https://registry.npmjs.org/gatsby-plugin-netlify/-/gatsby-plugin-netlify-2.0.11.tgz", diff --git a/package.json b/package.json index 21560b0c2..368a6910e 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "bulma": "^0.7.0", "gatsby": "^2.0.66", "gatsby-image": "^2.0.23", + "gatsby-plugin-manifest": "^2.0.19", "gatsby-plugin-netlify": "^2.0.6", "gatsby-plugin-netlify-cms": "^3.0.9", "gatsby-plugin-purgecss": "^3.1.0", diff --git a/public/icons/icon-144x144.png b/public/icons/icon-144x144.png new file mode 100644 index 000000000..f60741bb1 Binary files /dev/null and b/public/icons/icon-144x144.png differ diff --git a/public/icons/icon-192x192.png b/public/icons/icon-192x192.png new file mode 100644 index 000000000..c7dc5812b Binary files /dev/null and b/public/icons/icon-192x192.png differ diff --git a/public/icons/icon-256x256.png b/public/icons/icon-256x256.png new file mode 100644 index 000000000..0471484c8 Binary files /dev/null and b/public/icons/icon-256x256.png differ diff --git a/public/icons/icon-384x384.png b/public/icons/icon-384x384.png new file mode 100644 index 000000000..1a5c2824b Binary files /dev/null and b/public/icons/icon-384x384.png differ diff --git a/public/icons/icon-48x48.png b/public/icons/icon-48x48.png new file mode 100644 index 000000000..f32bd2910 Binary files /dev/null and b/public/icons/icon-48x48.png differ diff --git a/public/icons/icon-512x512.png b/public/icons/icon-512x512.png new file mode 100644 index 000000000..89441d90a Binary files /dev/null and b/public/icons/icon-512x512.png differ diff --git a/public/icons/icon-72x72.png b/public/icons/icon-72x72.png new file mode 100644 index 000000000..859e6c3b0 Binary files /dev/null and b/public/icons/icon-72x72.png differ diff --git a/public/icons/icon-96x96.png b/public/icons/icon-96x96.png new file mode 100644 index 000000000..c020c8e80 Binary files /dev/null and b/public/icons/icon-96x96.png differ diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest new file mode 100644 index 000000000..e0b16032d --- /dev/null +++ b/public/manifest.webmanifest @@ -0,0 +1 @@ +{"name":"Kaldi","short_name":"Kaldi","start_url":"/","background_color":"#FFFFFF","theme_color":"#FFFFFF","include_favicon":true,"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"}]} \ No newline at end of file diff --git a/src/components/Layout.js b/src/components/Layout.js index f3c93af9d..0e4fa59f2 100644 --- a/src/components/Layout.js +++ b/src/components/Layout.js @@ -28,32 +28,6 @@ const TemplateWrapper = ({ children }) => ( name="description" content={data.site.siteMetadata.description} /> - - - - - - - - diff --git a/src/img/favicon.svg b/src/img/favicon.svg new file mode 100644 index 000000000..0284f88b7 --- /dev/null +++ b/src/img/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/img/favicon-16x16.png b/static/img/favicon-16x16.png deleted file mode 100644 index 18985a381..000000000 Binary files a/static/img/favicon-16x16.png and /dev/null differ diff --git a/static/img/favicon-32x32.png b/static/img/favicon-32x32.png deleted file mode 100644 index 2d52effff..000000000 Binary files a/static/img/favicon-32x32.png and /dev/null differ diff --git a/yarn.lock b/yarn.lock index f5cf62f46..a13642f86 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4760,6 +4760,15 @@ gatsby-link@^2.0.10: "@types/reach__router" "^1.0.0" prop-types "^15.6.1" +gatsby-plugin-manifest@^2.0.19: + version "2.0.19" + resolved "https://registry.yarnpkg.com/gatsby-plugin-manifest/-/gatsby-plugin-manifest-2.0.19.tgz#5f8bd5e18dec1f91e5a552faeab0eb4a63e213d2" + integrity sha512-pUjjVgWdL2hhT2UnP5uUeweQsH2546dMcjjCLt/b6ho79u3K8lX14tYQoss1XEeEIpyEviZ16ur+g4EppP74cA== + dependencies: + "@babel/runtime" "^7.0.0" + bluebird "^3.5.0" + sharp "^0.21.3" + gatsby-plugin-netlify-cms@^3.0.9: version "3.0.12" resolved "https://registry.yarnpkg.com/gatsby-plugin-netlify-cms/-/gatsby-plugin-netlify-cms-3.0.12.tgz#1812653fba2690f85b2796fa22e4b59b7b169520"