Merge pull request #335 from vzhou842/svgs

Integrate gatsby-plugin-optimize-svgs + add SVG media
This commit is contained in:
Alexander Shelepenok
2019-08-02 22:46:21 +03:00
committed by GitHub
5 changed files with 36 additions and 5 deletions

View File

@@ -45,4 +45,6 @@ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac tu
}
```
Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus.
Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus.
![Test SVG](/media/cpu.svg)

View File

@@ -200,6 +200,7 @@ module.exports = {
}
}
},
'gatsby-plugin-flow'
'gatsby-plugin-flow',
'gatsby-plugin-optimize-svgs',
]
};

View File

@@ -51,6 +51,7 @@
"gatsby-plugin-netlify": "^2.1.3",
"gatsby-plugin-netlify-cms": "^4.1.6",
"gatsby-plugin-offline": "^2.2.4",
"gatsby-plugin-optimize-svgs": "^1.0.3",
"gatsby-plugin-react-helmet": "^3.1.2",
"gatsby-plugin-sass": "^2.1.3",
"gatsby-plugin-sharp": "^2.2.9",
@@ -87,11 +88,11 @@
"@babel/plugin-transform-flow-strip-types": "^7.4.4",
"@babel/preset-env": "7.5.5",
"@babel/preset-react": "7.0.0",
"babel-preset-gatsby": "0.2.8",
"autoprefixer": "9.6.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.2",
"babel-jest": "24.8.0",
"babel-preset-gatsby": "0.2.8",
"browserslist": "4.6.6",
"concurrently": "4.1.1",
"eslint": "6.1.0",
@@ -101,8 +102,8 @@
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.14.3",
"eslint-watch": "6.0.0",
"flow-typed": "^2.6.1",
"flow-bin": "^0.104.0",
"flow-typed": "^2.6.1",
"gh-pages": "2.0.1",
"identity-obj-proxy": "3.0.0",
"jest": "24.8.0",

7
static/media/cpu.svg Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
<g><path d="M418.3,91.7h-81.7V10h81.7V91.7L418.3,91.7z M91.7,581.7H10v81.7h81.7V581.7z M91.7,459.2H10v81.7h81.7V459.2z M91.7,336.7H10v81.7h81.7V336.7z M91.7,132.5c0-22.5,18.3-40.8,40.8-40.8h163.3V10H132.5C64.8,10,10,64.9,10,132.5v163.3h81.7V132.5z M540.8,10h-81.7v81.7h81.7V10z M663.3,10h-81.7v81.7h81.7V10z M527.4,484.1c0-13.3-8.7-16.2-22-16.2h-19v32.4h19C518.7,500.2,527.4,497.4,527.4,484.1z M173.3,173.3h653.3v653.3H173.3V173.3z M583.4,524.3c0,38.6,22.4,57.3,60.7,57.3c37.4,0,60.9-18.7,60.9-57.3v-86.9h-37v86.9c0,19.5-6.6,25.2-23.8,25.2c-18.1,0-23.8-8.6-23.8-25.2v-86.9h-36.9V524.3z M449.3,578.7h37v-47.9h27c32.2,0,50-19.4,50-46.7c0-27.8-18.3-46.7-50-46.7h-64.1V578.7L449.3,578.7z M296.7,508.6c0,41.2,26.4,73.1,69.5,73.1c33.7,0,59.1-19.5,62.9-62.1h-36c-6,44.8-59.4,39.3-59.4-10.9c0-23,9.3-42.1,32.5-42.1c12.5,0,23.5,7.6,25.8,23.4h36c-3.7-37.6-29.8-55.7-61.8-55.7C323.3,434.2,296.7,466.4,296.7,508.6z M908.3,540.8H990v-81.7h-81.7V540.8L908.3,540.8z M91.7,867.5V704.2H10v163.3C10,935.1,64.8,990,132.5,990h163.3v-81.7H132.5C110,908.3,91.7,890,91.7,867.5z M908.3,867.5c0,22.5-18.3,40.8-40.8,40.8H704.2V990h163.3c67.7,0,122.5-54.9,122.5-122.5V704.2h-81.7V867.5L908.3,867.5z M908.3,663.3H990v-81.7h-81.7V663.3L908.3,663.3z M908.3,418.3H990v-81.7h-81.7V418.3L908.3,418.3z M867.5,10H704.2v81.7h163.3c22.5,0,40.8,18.3,40.8,40.8v163.3H990V132.5C990,64.9,935.2,10,867.5,10z M336.7,990h81.7v-81.7h-81.7V990L336.7,990z M581.7,990h81.7v-81.7h-81.7V990z M459.2,990h81.7v-81.7h-81.7V990L459.2,990z"/></g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -5458,6 +5458,11 @@ for-own@^1.0.0:
dependencies:
for-in "^1.0.1"
foreachasync@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/foreachasync/-/foreachasync-3.0.0.tgz#5502987dc8714be3392097f32e0071c9dee07cf6"
integrity sha1-VQKYfchxS+M5IJfzLgBxyd7gfPY=
forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
@@ -5723,6 +5728,14 @@ gatsby-plugin-offline@^2.2.4:
slash "^3.0.0"
workbox-build "^3.6.3"
gatsby-plugin-optimize-svgs@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/gatsby-plugin-optimize-svgs/-/gatsby-plugin-optimize-svgs-1.0.3.tgz#fdabdbb8d56bea32f10aa856a6b0335742fd3b9e"
integrity sha512-lyHrBvtsCHLMNc3dAm3vMjafaQ6yvW1DcNpPgRwzSx29cphJH5sC1XXdzcykHs619CwKfKF2s5I2mLDM2IfBkg==
dependencies:
svgo "^1.3.0"
walk "^2.3.14"
gatsby-plugin-page-creator@^2.1.5:
version "2.1.5"
resolved "https://registry.yarnpkg.com/gatsby-plugin-page-creator/-/gatsby-plugin-page-creator-2.1.5.tgz#723fc0392a67978cab649a402ad88f6f06b74e4c"
@@ -13492,7 +13505,7 @@ svg-tags@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/svg-tags/-/svg-tags-1.0.0.tgz#58f71cee3bd519b59d4b2a843b6c7de64ac04764"
svgo@^1.0.0, svgo@^1.2.0:
svgo@^1.0.0, svgo@^1.2.0, svgo@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.3.0.tgz#bae51ba95ded9a33a36b7c46ce9c359ae9154313"
dependencies:
@@ -14409,6 +14422,13 @@ w3c-hr-time@^1.0.1:
dependencies:
browser-process-hrtime "^0.1.2"
walk@^2.3.14:
version "2.3.14"
resolved "https://registry.yarnpkg.com/walk/-/walk-2.3.14.tgz#60ec8631cfd23276ae1e7363ce11d626452e1ef3"
integrity sha512-5skcWAUmySj6hkBdH6B6+3ddMjVQYH5Qy9QGbPmN8kVmLteXk+yVXg+yfk1nbX30EYakahLrr8iPcCxJQSCBeg==
dependencies:
foreachasync "^3.0.0"
walker@^1.0.7, walker@~1.0.5:
version "1.0.7"
resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb"