gatsby config images

This commit is contained in:
Sergey Yarkov 2020-07-25 14:17:49 +03:00
parent f333e53b27
commit 1746ae6a7b
5 changed files with 165 additions and 46 deletions

View File

@ -15,7 +15,6 @@ module.exports = {
},
plugins: [
"gatsby-plugin-react-helmet",
`gatsby-plugin-sitemap`,
"gatsby-plugin-sass",
{
resolve: "gatsby-source-filesystem",
@ -24,6 +23,22 @@ module.exports = {
name: "assets",
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "content",
path: `${__dirname}/content`,
},
},
{
resolve: "gatsby-plugin-react-svg",
options: {
rule: {
include: /images/,
},
},
},
"gatsby-plugin-sitemap",
{
resolve: 'gatsby-plugin-robots-txt',
options: {
@ -96,18 +111,28 @@ module.exports = {
options: {
plugins: [
{
resolve: `gatsby-remark-relative-images`,
resolve: `gatsby-plugin-netlify-cms-paths`,
options: {
name: "assets",
cmsConfig: `/static/admin/config.yml`,
},
},
{
resolve: `gatsby-remark-images`,
},
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
maxWidth: 2400,
quality: 100,
withWebp: true,
loading: 'lazy',
linkImagesToOriginal: false,
}
},
`gatsby-remark-responsive-iframe`,
{
resolve: 'gatsby-remark-copy-linked-files',
options: {
destinationDir: 'static',
},
},
{
resolve: `gatsby-remark-autolink-headers`,
options: {
@ -135,24 +160,6 @@ module.exports = {
],
},
},
],
},
},
{
resolve: "gatsby-plugin-react-svg",
options: {
rule: {
include: /images/,
},
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "content",
path: `${__dirname}/content`,
},
},
"gatsby-plugin-netlify-cms",
],
}

109
package-lock.json generated
View File

@ -9152,6 +9152,17 @@
"webpack": "^4.43.0"
}
},
"gatsby-plugin-netlify-cms-paths": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/gatsby-plugin-netlify-cms-paths/-/gatsby-plugin-netlify-cms-paths-1.3.0.tgz",
"integrity": "sha512-XnpUu14URfD93vC36Z0xn8vx/Qd36rEMfgL2Q5TPgxkZQB9aspPsdOYbprpLCa/PWhFrNtMNFFnbH0McsQaw5g==",
"requires": {
"babel-runtime": "^6.26.0",
"read-yaml-promise": "^1.0.2",
"slash": "^3.0.0",
"unist-util-select": "^1.5.0"
}
},
"gatsby-plugin-nprogress": {
"version": "2.3.10",
"resolved": "https://registry.npmjs.org/gatsby-plugin-nprogress/-/gatsby-plugin-nprogress-2.3.10.tgz",
@ -9555,6 +9566,39 @@
}
}
},
"gatsby-remark-copy-linked-files": {
"version": "2.3.11",
"resolved": "https://registry.npmjs.org/gatsby-remark-copy-linked-files/-/gatsby-remark-copy-linked-files-2.3.11.tgz",
"integrity": "sha512-uU0CWXEnPKlrKFO+kqqjZAEVTSbt1WuJrJYU2S8Fe2ql8N2SM7Db2yce5r4PTSqLNg6RSzOXEQBIIoeTq/yVbQ==",
"requires": {
"@babel/runtime": "^7.10.3",
"cheerio": "^1.0.0-rc.3",
"fs-extra": "^8.1.0",
"is-relative-url": "^3.0.0",
"lodash": "^4.17.15",
"path-is-inside": "^1.0.2",
"probe-image-size": "^4.1.1",
"unist-util-visit": "^1.4.1"
},
"dependencies": {
"unist-util-visit": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz",
"integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==",
"requires": {
"unist-util-visit-parents": "^2.0.0"
}
},
"unist-util-visit-parents": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz",
"integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==",
"requires": {
"unist-util-is": "^3.0.0"
}
}
}
},
"gatsby-remark-images": {
"version": "3.3.17",
"resolved": "https://registry.npmjs.org/gatsby-remark-images/-/gatsby-remark-images-3.3.17.tgz",
@ -9646,6 +9690,36 @@
}
}
},
"gatsby-remark-responsive-iframe": {
"version": "2.4.11",
"resolved": "https://registry.npmjs.org/gatsby-remark-responsive-iframe/-/gatsby-remark-responsive-iframe-2.4.11.tgz",
"integrity": "sha512-LJwMffpKMVrn3OkFjH3FiTjlt5NresUKIHSCZs5RLKGta8zd4I1vd/uMnjuO7EI5csIRkr0iHS7iCMQeC4oXbQ==",
"requires": {
"@babel/runtime": "^7.10.3",
"cheerio": "^1.0.0-rc.3",
"common-tags": "^1.8.0",
"lodash": "^4.17.15",
"unist-util-visit": "^1.4.1"
},
"dependencies": {
"unist-util-visit": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz",
"integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==",
"requires": {
"unist-util-visit-parents": "^2.0.0"
}
},
"unist-util-visit-parents": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz",
"integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==",
"requires": {
"unist-util-is": "^3.0.0"
}
}
}
},
"gatsby-remark-vscode": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/gatsby-remark-vscode/-/gatsby-remark-vscode-3.0.1.tgz",
@ -17974,6 +18048,41 @@
}
}
},
"read-yaml": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/read-yaml/-/read-yaml-1.1.0.tgz",
"integrity": "sha1-DSc6wMlb6SIw3A1MTE9biWCjNtY=",
"requires": {
"extend-shallow": "^2.0.1",
"js-yaml": "^3.8.2"
},
"dependencies": {
"extend-shallow": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"requires": {
"is-extendable": "^0.1.0"
}
}
}
},
"read-yaml-promise": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/read-yaml-promise/-/read-yaml-promise-1.0.2.tgz",
"integrity": "sha1-YEthE/J/dzeQ9KdGLQQnMF7QZHs=",
"requires": {
"es6-promise": "^2.0.0",
"read-yaml": "^1.0.0"
},
"dependencies": {
"es6-promise": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-2.3.0.tgz",
"integrity": "sha1-lu258v2wGZWCKyY92KratnSBgbw="
}
}
},
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",

View File

@ -24,6 +24,7 @@
"gatsby-plugin-firebase": "^0.2.0-beta.4",
"gatsby-plugin-manifest": "^2.4.17",
"gatsby-plugin-netlify-cms": "^4.3.9",
"gatsby-plugin-netlify-cms-paths": "^1.3.0",
"gatsby-plugin-nprogress": "^2.3.10",
"gatsby-plugin-react-helmet": "^3.3.8",
"gatsby-plugin-react-svg": "^3.0.0",
@ -32,8 +33,10 @@
"gatsby-plugin-sharp": "^2.6.17",
"gatsby-plugin-sitemap": "^2.4.11",
"gatsby-remark-autolink-headers": "^2.3.10",
"gatsby-remark-copy-linked-files": "^2.3.11",
"gatsby-remark-images": "^3.3.17",
"gatsby-remark-relative-images": "^0.3.0",
"gatsby-remark-responsive-iframe": "^2.4.11",
"gatsby-remark-vscode": "^3.0.1",
"gatsby-source-filesystem": "^2.3.18",
"gatsby-transformer-remark": "^2.8.23",

View File

@ -2,8 +2,8 @@ backend:
name: github
repo: sergeyyarkov/devthread.ru
locale: 'ru'
media_folder: "static/images/uploads"
public_folder: "/images/uploads"
media_folder: "static/assets"
public_folder: "/assets"
collections:
- name: "articles"
label: "Article"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 KiB