From 2cf13ae97315467144557369045f59c4241cc626 Mon Sep 17 00:00:00 2001 From: Christopher Patty Date: Fri, 12 Jul 2019 10:29:27 -0600 Subject: [PATCH] feat(gatsby-plugin-netlify-cms): add custom favicon to cms (#14883) --- packages/gatsby-plugin-netlify-cms/README.md | 8 ++++++++ packages/gatsby-plugin-netlify-cms/src/gatsby-node.js | 2 ++ 2 files changed, 10 insertions(+) diff --git a/packages/gatsby-plugin-netlify-cms/README.md b/packages/gatsby-plugin-netlify-cms/README.md index cd869e9e19b7e..84f2fd8303277 100644 --- a/packages/gatsby-plugin-netlify-cms/README.md +++ b/packages/gatsby-plugin-netlify-cms/README.md @@ -171,6 +171,13 @@ Customize the path to Netlify CMS on your Gatsby site. Customize the value of the `title` tag in your CMS HTML (shows in the browser bar). +### `htmlFavicon` + +(_optional_, type: `string`, default: `""`) + +Customize the value of the `favicon` tag in your CMS HTML (shows in the browser +bar). + ## Example Here is the plugin with example values for all options (note that no option is @@ -185,6 +192,7 @@ plugins: [ enableIdentityWidget: true, publicPath: `admin`, htmlTitle: `Content Manager`, + htmlFavicon: `path/to/favicon`, }, }, ] diff --git a/packages/gatsby-plugin-netlify-cms/src/gatsby-node.js b/packages/gatsby-plugin-netlify-cms/src/gatsby-node.js index 75308dab1e1f0..3ec4afdf00b3d 100644 --- a/packages/gatsby-plugin-netlify-cms/src/gatsby-node.js +++ b/packages/gatsby-plugin-netlify-cms/src/gatsby-node.js @@ -96,6 +96,7 @@ exports.onCreateWebpackConfig = ( publicPath = `admin`, enableIdentityWidget = true, htmlTitle = `Content Manager`, + htmlFavicon = ``, manualInit = false, } ) => { @@ -157,6 +158,7 @@ exports.onCreateWebpackConfig = ( // Auto generate CMS index.html page. new HtmlWebpackPlugin({ title: htmlTitle, + favicon: htmlFavicon, chunks: [`cms`], excludeAssets: [/cms.css/], }),