Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
chore: fix single icon case
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Mar 15, 2022
1 parent 16b8091 commit 1f43030
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-manifest/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@redocly/gatsby-plugin-manifest",
"description": "Gatsby plugin which adds a manifest.webmanifest to make sites progressive web apps",
"version": "3.3.0",
"version": "3.3.1",
"author": "Kyle Mathews <[email protected]>",
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
Expand Down
11 changes: 6 additions & 5 deletions packages/gatsby-plugin-manifest/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ function getSharp() {
sharp = require(`./safe-sharp`)
sharp.simd(true)
}

// Handle Sharp's concurrency based on the Gatsby CPU count
// See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
// See: https://www.gatsbyjs.org/docs/multi-core-builds/
sharp.concurrency(cpuCoreCount())

return sharp
}

// Handle Sharp's concurrency based on the Gatsby CPU count
// See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency
// See: https://www.gatsbyjs.org/docs/multi-core-builds/
sharp.concurrency(cpuCoreCount())

async function generateIcon(icon, srcIcon) {
const imgPath = path.join(`public`, icon.src)

Expand Down
10 changes: 10 additions & 0 deletions packages/gatsby-plugin-manifest/src/gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ exports.onRenderBody = (
)
}
}
} else if (icons.length) {
// otherwise use first icon as favicon.
headComponents.push(
<link
key={`gatsby-plugin-manifest-icon-link-png`}
rel="icon"
href={withPrefix(addDigestToPath(icons[0].src, cacheDigest, `none`))}
type="image/png"
/>
)
}

// Add manifest link tag.
Expand Down

0 comments on commit 1f43030

Please sign in to comment.