Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gatsby-remark-images] new images 404 or end up being 0x0 pixels #3545

Closed
patreeceeo opened this issue Jan 16, 2018 · 23 comments
Closed

[gatsby-remark-images] new images 404 or end up being 0x0 pixels #3545

patreeceeo opened this issue Jan 16, 2018 · 23 comments

Comments

@patreeceeo
Copy link

In effect, I can't add new images to my blog using gatsby-remark-images

Environment

Gatsby version: 1.9.157
Node.js version: 8.6.0
Operating System: macOS 10.12.6

File contents (if changed):

gatsby-config.js:

module.exports = {
    siteMetadata: {
        title: `Personal site of Patrick Canfield`,
        description: ``,
        siteUrl: `https://patrickcanfield.com`
    },
    plugins: [
        `gatsby-plugin-react-helmet`,
        {

            resolve: `gatsby-plugin-feed`,
            options: {
                query: `
                    {
                      site {
                        siteMetadata {
                          title
                          description
                          siteUrl
                          site_url: siteUrl
                        }
                      }
                    }
                `,
                feeds: [
                    {
                        serialize: ({ query: { site, allMarkdownRemark } }) => {
                            return allMarkdownRemark.edges.map(edge => {
                                return Object.assign({}, edge.node.frontmatter, {
                                    description: edge.node.excerpt,
                                    url: site.siteMetadata.siteUrl + edge.node.frontmatter.path,
                                    guid: site.siteMetadata.siteUrl + edge.node.frontmatter.path,
                                    custom_elements: [{ 'content:encoded': edge.node.html }],
                                });
                            });
                        },
                        query: `
                            {
                              allMarkdownRemark(
                                limit: 1000,
                                sort: { order: DESC, fields: [frontmatter___date] },
                              ) {
                                edges {
                                  node {
                                    excerpt
                                    html
                                    frontmatter {
                                      title
                                      date
                                      path
                                    }
                                  }
                                }
                              }
                            }
                          `,
                        output: '/rss.xml',
                        feedTitle: 'Blog of Patrick Canfield'
                    }
                ]
            }
        },
        {
            resolve: `gatsby-plugin-typography`,
            options: {
                pathToConfigModule: `src/utils/typography.js`,
            },
        },
        {
            resolve: `gatsby-source-filesystem`,
            options: {
                path: `${__dirname}/src/blog`,
                name: 'pages',
            },
        },
        {
            resolve: 'gatsby-transformer-remark',
            options: {
                plugins: [
                    `gatsby-remark-smartypants`,
                    {
                        resolve: `gatsby-remark-images`,
                        options: {
                            // It's important to specify the maxWidth (in pixels) of
                            // the content container as this plugin uses this as the
                            // base for generating different widths of each image.
                            maxWidth: 800,
                            // Remove the default behavior of adding a link to each
                            // image.
                            linkImagesToOriginal: false,
                        },
                    },
                    {
                        resolve: 'gatsby-remark-copy-linked-files',
                        options: {
                            // `ignoreFileExtensions` defaults to [`png`, `jpg`, `jpeg`, `bmp`, `tiff`]
                            // as we assume you'll use gatsby-remark-images to handle
                            // images in markdown as it automatically creates responsive
                            // versions of images.
                            //
                            // If you'd like to not use gatsby-remark-images and just copy your
                            // original images to the public directory, set
                            // `ignoreFileExtensions` to an empty array.
                            // ignoreFileExtensions: [],
                        },
                    }
                ]
            }
        },
        {
            resolve: `gatsby-plugin-google-analytics`,
            options: {
                trackingId: '...',
                // Setting this parameter is optional
                anonymize: true
            },
        },
    ],
};

package.json:

{
  "name": "gatsby-starter-default",
  "description": "Gatsby default starter",
  "version": "1.0.0",
  "author": "Kyle Mathews <[email protected]>",
  "dependencies": {
    "classnames": "^2.2.5",
    "font-awesome": "^4.7.0",
    "gatsby": "^1.9.112",
    "gatsby-cli": "^1.1.19",
    "gatsby-link": "^1.6.22",
    "gatsby-plugin-feed": "^1.3.11",
    "gatsby-plugin-google-analytics": "^1.0.11",
    "gatsby-plugin-react-helmet": "^1.0.8",
    "gatsby-plugin-sharp": "^1.6.15",
    "gatsby-plugin-typography": "^1.7.10",
    "gatsby-remark-copy-linked-files": "^1.5.21",
    "gatsby-remark-images": "^1.5.36",
    "gatsby-remark-smartypants": "^1.4.8",
    "gatsby-source-filesystem": "^1.5.5",
    "gatsby-transformer-remark": "^1.7.18",
    "lodash.omit": "^4.5.0",
    "react-fontawesome": "^1.6.1",
    "react-html-parser": "^2.0.1",
    "react-popper": "^0.7.4",
    "resize-observer-polyfill": "^1.5.0",
    "sharp": "^0.18.4",
    "typography-theme-lawton": "^0.15.10"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "main": "n/a",
  "scripts": {
    "build": "gatsby build",
    "develop": "gatsby develop",
    "format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "devDependencies": {
    "prettier": "^1.7.4"
  }
}

gatsby-node.js:

const path = require('path');

exports.createPages = ({ boundActionCreators, graphql }) => {
    const { createPage } = boundActionCreators;

    const blogPostTemplate = path.resolve(`src/templates/blog-post.js`);

    return graphql(`{
        allMarkdownRemark(
          sort: { order: DESC, fields: [frontmatter___date] }
          limit: 1000
        ) {
          edges {
            node {
              excerpt(pruneLength: 250)
              html
              id
              frontmatter {
                date
                path
                title
              }
            }
          }
        }
      }`
    ).then(result => {
        if (result.errors) {
            return Promise.reject(result.errors);
        }

        result.data.allMarkdownRemark.edges
            .forEach(({ node }) => {
                createPage({
                    path: node.frontmatter.path,
                    component: blogPostTemplate,
                    context: {} // additional data can be passed via context
                });
            });
    });
};

gatsby-browser.js: not changed
gatsby-ssr.js: not changed

Before submitting this issue I tried:

  • changing the image format from PNG to JPEG
  • using different images
  • changing the path of the blog post
  • resizing the image
  • upgrading to latest version of plugin

Steps to reproduce

Here's a page on my blog with the issue: https://patrickcanfield.com/blog/2016/01/15/sleep-mindfulness-art/

Here's the source code for that post: https://raw.githubusercontent.com/pzatrick/patrickcanfield.com/master/gatsby/src/blog/test.md

For now my workaround is to use an img tag with an absolute URL to the image in the Gatby-generated static assets.

@KyleAMathews
Copy link
Contributor

Looks like you need to add gatsby-plugin-sharp to your gatsby-config.js — which... isn't in the instructions so totally get why you didn't see that :-( I'll fix up the README real quick https://www.gatsbyjs.org/packages/gatsby-remark-images/

@patreeceeo
Copy link
Author

patreeceeo commented Jan 16, 2018

@KyleAMathews Did I do this right? I updated my config per that README, did gatsby build && gatsby serve and I'm still experiencing the issue locally. Here's my config now:

module.exports = {
    siteMetadata: {
        title: `Personal site of Patrick Canfield`,
        description: ``,
        siteUrl: `https://patrickcanfield.com`
    },
    plugins: [
        `gatsby-plugin-react-helmet`,
        {

            resolve: `gatsby-plugin-feed`,
            options: {
                query: `
                    {
                      site {
                        siteMetadata {
                          title
                          description
                          siteUrl
                          site_url: siteUrl
                        }
                      }
                    }
                `,
                feeds: [
                    {
                        serialize: ({ query: { site, allMarkdownRemark } }) => {
                            return allMarkdownRemark.edges.map(edge => {
                                return Object.assign({}, edge.node.frontmatter, {
                                    description: edge.node.excerpt,
                                    url: site.siteMetadata.siteUrl + edge.node.frontmatter.path,
                                    guid: site.siteMetadata.siteUrl + edge.node.frontmatter.path,
                                    custom_elements: [{ 'content:encoded': edge.node.html }],
                                });
                            });
                        },
                        query: `
                            {
                              allMarkdownRemark(
                                limit: 1000,
                                sort: { order: DESC, fields: [frontmatter___date] },
                              ) {
                                edges {
                                  node {
                                    excerpt
                                    html
                                    frontmatter {
                                      title
                                      date
                                      path
                                    }
                                  }
                                }
                              }
                            }
                          `,
                        output: '/rss.xml',
                        feedTitle: 'Blog of Patrick Canfield'
                    }
                ]
            }
        },
        {
            resolve: `gatsby-plugin-typography`,
            options: {
                pathToConfigModule: `src/utils/typography.js`,
            },
        },
        {
            resolve: `gatsby-source-filesystem`,
            options: {
                path: `${__dirname}/src/blog`,
                name: 'pages',
            },
        },
        {
            resolve: 'gatsby-transformer-remark',
            options: {
                plugins: [
                    `gatsby-remark-smartypants`,
                    `gatsby-plugin-sharp`, // for gatsby-remark-images
                    {
                        resolve: `gatsby-remark-images`,
                        options: {
                            // It's important to specify the maxWidth (in pixels) of
                            // the content container as this plugin uses this as the
                            // base for generating different widths of each image.
                            maxWidth: 800,
                            // Remove the default behavior of adding a link to each
                            // image.
                            linkImagesToOriginal: false,
                        },
                    },
                    {
                        resolve: 'gatsby-remark-copy-linked-files',
                        options: {
                            // `ignoreFileExtensions` defaults to [`png`, `jpg`, `jpeg`, `bmp`, `tiff`]
                            // as we assume you'll use gatsby-remark-images to handle
                            // images in markdown as it automatically creates responsive
                            // versions of images.
                            //
                            // If you'd like to not use gatsby-remark-images and just copy your
                            // original images to the public directory, set
                            // `ignoreFileExtensions` to an empty array.
                            // ignoreFileExtensions: [],
                        },
                    }
                ]
            }
        },
        {
            resolve: `gatsby-plugin-google-analytics`,
            options: {
                trackingId: '...',
                // Setting this parameter is optional
                // anonymize: true
            },
        },
    ],
};

@KyleAMathews
Copy link
Contributor

Not quite — you added gatsby-plugin-sharp as a "sub-plugin" to gatsby-transformer-remark. You want to add it as a top-level plugin at the same level as the other non-remark plugins.

@patreeceeo
Copy link
Author

Ok, I changed my config accordingly, did gatsby build && gatsby serve, cleared my cache, yet the issue seems to persist.

@KyleAMathews
Copy link
Contributor

Not sure — compare your site to the blog starter to see if there's a difference. Also try installing the blog starter to make sure there's not something misconfigured on your computer https:/gatsbyjs/gatsby-starter-blog

@ralrom
Copy link

ralrom commented Mar 5, 2018

Not quite — you added gatsby-plugin-sharp as a "sub-plugin" to gatsby-transformer-remark. You want to add it as a top-level plugin at the same level as the other non-remark plugins.

The instructions in the README (see jastack@301833e) don't reflect your statement. I took a look at the starter-blog template and it also adds gatsby-plugin-sharp as a top-level plugin so I believe the README is wrong

@jlengstorf
Copy link
Contributor

@KyleAMathews Is it gatsby-plugin-sharp or gatsby-transformer-sharp?

I just checked my own site and I'm using the transformer, but maybe I'm doing it wrong? (FWIW, adding images works on my site.)

I tweaked those docs in gatsby-starter-blog and can submit a PR once there's a confirmation that it's working for everyone.

@ralrom @pzatrick Here are the relevant settings my config, for reference:

module.exports = {
  plugins: [
    // ...
    'gatsby-transformer-sharp',
    {
      resolve: 'gatsby-transformer-remark',
      options: {
        plugins: [
          {
            resolve: 'gatsby-remark-images',
            options: {
              maxWidth: 1380,
              linkImagesToOriginal: false,
            },
          },
          // ...
        ],
      },
    },
  ],
};

@KyleAMathews
Copy link
Contributor

  • gatsby-plugin-sharp is a utility library that other plugins can use for image processing primitives.
  • gatsby-transformer-sharp is a transformer plugin that converts File nodes into ImageSharp nodes letting you run queries that process images in a variety of ways. It uses gatsby-plugin-sharp under the hood to do the actual processing.
  • gatsby-remark-images automatically resizes images referenced in markdown files so they're responsive and not overly large.

jlengstorf added a commit to jlengstorf/gatsby that referenced this issue Mar 6, 2018
@jlengstorf
Copy link
Contributor

Okay — so in my case, the gatsby-plugin-sharp is available to gatsby-remark-images because I'm using gatsby-transformer-sharp, I assume. Should gatsby-plugin-sharp be a dependency of gatsby-remark-images? Or a peerDependency?

It seems inconsistent that gatsby-transformer-sharp depends on gatsby-plugin-sharp but doesn't require it to be manually installed, but gatsby-remark-images does.

Let me know if you want me to open a new issue for this. In the meantime, I'll send a PR to update the docs for gatsby-remark-images.

@KyleAMathews
Copy link
Contributor

@jlengstorf you don't have gatsby-plugin-sharp in the plugins array in your gatsby-config.js? It's required there.

It should be a peerDependency for both gatsby-remark-image and gatsby-transformer-sharp not a direct dependency. Yeah, that is inconsistent then and we should fix it. Would you like to do a PR for that?

Thanks for looking into these and cleaning things up!

calcsam pushed a commit that referenced this issue Mar 6, 2018
* Support URLs that end in SemVer ranges (#3305)

Fixes #3164.

* page path defaults to '/' (#3325)

* page path defaults to '/'

* Add test

* Use graymatter excerpt in gatsby-transformer-remark (#2883)

* Check for graymatter excerpt

Checks to see if there is a gray-matter excerpt before returning a
pruned character count

* Fix test

Remove a variable that wasn't being used

* Create page to describe excerpts

* Update using-remark example

* Remove package-lock.json

* Remove console.log statements

* Update copy

Updates copy to be a bit more descriptive

* Update header for example page

* Begin stubbing out extend-node.js tests

Created a basic framework for creating a markdown node via the
onCreateNode function. This should be expanded to factor in the changes
that occur in the setFieldsOnGraphQLNodeType function.

* Add query test

Adds a test that uses graphql to query a node with its excerpt

* Regroup tests

Regroups tests so that graphql queries and node tests are in their own
groups

* Fix linting errors

Fixes linting errors that were causing issues on travisCI

* Format

* handles integer with valida date format correctly (#3461)

* Upgrade style-loader to fix CSS modules issue (#3283)

* Upgrade style-loader to 0.19.0 to fix webpack-contrib/style-loader#182

* Update to last version

* format/bootstrap

* Publish

 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]

* Updated links for Glamor and Styled Components (#3462)

* Updated links for Glamor and Styled Components

* Update index.md

* Update tutorial.js

* Add link to the using-remark website

* Don't create pages for test files (#3464)

* Don't generate pages for test files

* Use parsedPath.base instead of path

* Add gatsby-source-behance to plugins list (#3465)

* activated mergeLinkHeaders (#3463)

* Add cache-control examples to caching docs page (#3468)

* Publish

 - [email protected]
 - [email protected]
 - [email protected]

* Revert "Upgrade style-loader to fix CSS modules issue (#3283)"

This reverts commit 834dcb8.

A number of people were reporting that this broke the default starter in
node 8 e.g. https://twitter.com/Lehanism/status/951397594953076737

* Publish

 - [email protected]

* Fix Links Redirection (#3471)

* Fix Links Redirection

* Fix Glamor Link Redirection

* Fix typo (#3470)

* Update tutorial-links.yml

* Cleanup Glamor / Styled Component mini-tutorials (#3474)

* Cleanup Glamor / Styled Component mini-tutorials

* Tweaks

* Fix typo in building with components section (#3476)

reusabilty => reusability

* Fix typo (#3477)

* Update Deploy Gatsby page - Gitlab Pages (#3482)

* Update Deploy Gatsby page - Gitlab Pages

Have made a few edits, mainly to include the Path Prefix plugin, which is needed when using Gitlab pages without a custom domain. This has basically been shamelessly copied from the Github pages example...
Also did a bit of formatting.

* fix typo

* correct key behavior (#3483)

* correct key behavior

* remove trailing slash logic

* remove adding new variable

* Publish

 - [email protected]
 - [email protected]
 - [email protected]

* Add Strata starter (#3488)

Add Strata starter to the list.

* Use `_.isPlainObject` to prevent false Array positives (#3490)

* Publish

 - [email protected]

* update styled-jsx dep in gatsby-plugin-styled-jsx (#3493)

* update styled-jsx dep in gatsby-plugin-styled-jsx

* move styled-jsx to peerDependencies in gatsby-plugin-styled-jsx

* Publish

 - [email protected]

* gatsby-image docs (#3500)

* Update CONTRIBUTING.md

small typo

* Update README.md

typo fixes and additional section

* Update awesome-gatsby.md

* Update README.md

* Easy edits based off of observing Eden go thru tutorials (#3501)

A few typo corrections and clarified wording. There are more big changes to address later.

*  [gatsby] don't run service-workers outside of https or localhost  (#3502)

* [gatsby] don't run service-workers outside of https or localhost
see: #3385

* add detail around running local changes to CONTRIBUTING.md

* Update CONTRIBUTING.md

* format

* format

* Publish

 - [email protected]
 - [email protected]

* Properly use `withPrefix` in adding-images-fonts-files docs (#3503)

I came across this while browsing through the documentation. The `withPrefix` import was left unused in the "escape hatch" example, which I'm pretty sure is not intentional.

* Create new npm keyword for gatsby components (#3507)

* Publish

 - [email protected]

* Fix typo in docs (#3511)

* Add Netlify CMS plugin, related docs (#3509)

* add Netlify CMS plugin

* add Netlify CMS guide

* add Netlify to deploy docs

* Update deploy-gatsby.md

* Publish

 - [email protected]

* Fix clone instructions (#3514)

* Publish

 - [email protected]

* Fix instructions for cloning the docs

* Search and replace the hostname in URLs. (#3498)

* Search and replace the hostname in URLs.
#3450

* Fixed code styling issues

* Missed backticks for the timers requirement

* Updated readme with search and replace options

* Removed async, wrapped json parse in a try catch and updated blacklist function

* Updated search and replace api and updated documentation

* Added logging for invalid search and replace option

* make option more explicit, updated default value & removed redundant logging

* Updated the variable name making it clearer

* Add documentation on adding list of blog posts (#3510)

* Add documentation on adding list of blog posts

* Update adding-a-list-of-markdown-blog-posts.md

* Import the component

* [DOCS] Adding Markdown pages: Remove useless fields (#3517)

* [DOCS] Adding Markdown pages: Remove useless fields

* Update adding-markdown-pages.md

* [DOCS] Links: Remove emphasis from implem stubs (#3518)

* [DOCS] Links: Remove emphasis from implem stubs

Some docs have been implemented but are still marked as stubs in the navigation drawer

* Update doc-links.yaml

* fix link (#3513)

* Add missing comma in sitemap example (#3520)

* Move inlined webpack manifest to the end of body element (#3519)

* Adds email capture to bottom of blog (#3333)

* Adds email capture to bottom of blog

* Adds email capture to bottom of blog

* Adds Mailchimp functionality

* Refactors postEmailToMailchimp method, updates cc

* updates rhythm css, installs & uses validator module

* Fiddle with design

* Fix `gatsby-plugin-nprogress` default options param (#3533)

* Fix default `pluginOptions` parameter

This PR fixes #3484

Correctly merge `defaultOptions` with `pluginOptions`

* Indent `styles` template string correctly

* Change default

* Format

* Publish

 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]

* Don't use internal name when reporting there's an error in gatsby-node.js fixes #2945 (#3536)

* Don't use internal name when reporting there's an error in gatsby-node.js fixes #2945

* Move var initialization into tighter scope

* can I code???

* Publish

 - [email protected]

* Add Developer Ecosystem to websites (#3540)

* Removes words like 'simple' & 'easy' from docs/www (#3523)

* Removes words like 'simple' & 'easy' from docs/www

* Additional optimizations

* Update gatsby-v1.md

* Update add-404-page.md

* Update gatsby-style-guide.md

* Update styled-components.md

* Update index.md

* Update index.md

* cpinnix/verious starter (#3543)

* Added verious-boilerplate to gatsby starters documentation.

* Added Charles Pinnix Website and Verious to Showcase.

* gatsby-plugin-sharp: Remove warning for resolutions when requested width and image width are equal (#3537)

* Add to instructions that you need gatsby-plugin-sharp fixes #3545 (#3547)

* Update katex package to 0.8.3 (#3548)

* add unique titles to docs, tutorial, blog (#3550)

* Fix typo in KaTeX usage example (#3549)

* format

* Publish

 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]

* [www] Fix <link rel=„author“> href (#3555)

* [www] Fix email-capture-form cross browser issues (#3553)

* pull shared <input>/<button> styles into constant
* add default background color
* add placeholder styles
* use Futura instead of Spectral for form inputs* help Safari rendering <button> and <input> at equal height (tested in v11.0.2)
* add focus styles
* add focus styles to CtaButton

* Add docs page with overview of Gatsby's usage of GraphQL (#3557)

* Add docs page with overview of Gatsby's usage of GraphQL

* Add missing word

* Debugging HTML Builds - fix copy&paste error (#3565)

the point of the code-demo is that if we wrap the module it does not fail

* Update outdated snapshot (#3566)

* Update readme with demo link (#3573)

* Move script loader after webpack manifest (#3569)

This should ensure that when any external scripts are loaded using
script loader, the webpack manifest is already present.

* Publish

 - [email protected]
 - [email protected]

* Added 'Steve Meredith's Portfolio' to 'Showcase' (#3576)

* City of Boston case study blog post (#3583)

* boston blog post

* blog v2

* Add Put.io landing page to showcase (#3580)

* Allow arrays with more than one file path & ignore empty strings (#3577)

* Publish

 - [email protected]

* Add search form to site (#3421)

* Add search form to site header

* Prevent sidebar from overlapping search results

* Override default search result styles

* Reduce size of mask image

* Prettier

* Add a class name for the DocSearch crawlers

As mentioned in the DocSearch signup message: #3097 (comment)

* Disable DocSearch's debug mode

* Capture default navigation events, replace with client-side navigation

* Add a second identifier class for DocSearch

* Improve mobile styles

* Improve styling

- Increase specificity so styles work in production build
- Tidy up layout at medium and small breakpoints
- Prettier

* Load external CSS after document body

* Some minor edits (#3586)

* Some minor edits

I also think it could be cool to explain just a few use cases that answer this question: "Why is GraphQL so cool?"

I also expected to see code examples for image stuff. Also, a random thing about colons that I learned last year is this:

a full sentence must precede the colon :)

* Tweak

* Add sample code showing off gatsby-image + image processing to query with GraphQL page (#3589)

* Add sample code showing off gatsby-image + image processing to query with GraphQL page

* Update querying-with-graphql.md

* Update README.md

* Improve documentation for createParentChildLink (#3594)

* Improve documentation for createParentChildLink

* Format

* edit

* Some updates to the awesome gatsby page (#3595)

* Add Ryan Wiemer's Portfolio to the showcase (#3578)

* Updated Plugins.md (#3593)

Added Gatsby Directus Source Plugin

* [www] Add gatsby-plugin-postcss-sass (#3590)

* [www] Improve docsearch UI for small devices (#3597)

* [www] Improve docsearch for small devices

* ditch css.global(…) and instead use css.insert() for all CSS overriding/building upon the stock docsearch.css – couldn’t figure out any advantages in using css.global over css.insert()
* full-width result list items and calmer subcategory titles for small devices
* „purpelize“ UI and replace a few more stock colors with equivalents from utils/presets
* slightly wider result dropdown for desktop and above
* remove result dropdown outer padding and fiddle with whitespace

* debug:false

* Add section why GraphQL is *cool* (#3606)

* [www] Increase navigation z-index (#3599)

Prevent the author link on blog post cards from showing above the new docsearch dropdown.

* Added `gatsby-plugin-bugherd` to community plugins (#3605)

* [gatsby-source-contentful] Delete original link regardless of ID validity (#3592)

* wip

* [gatsby-source-contentful] Delete original link regardless of presence of resolvable ID

* Publish

 - [email protected]
 - [email protected]
 - [email protected]

* Create new page docs/creating-hybrid-pages-with-static-and-dynamic-components.md (#3579)

* Update  docs/creating-and-modifying-pages.md to expand on the use of client-only routes to create a hybrid or "app-shell" Gatsby app

* + Split hybrid page docs into its own page and update linked pages

* Update creating-and-modifying-pages.md

* Update and rename creating-hybrid-pages-with-static-and-dynamic-components.md to building-apps-with-gatsby

* Update creating-and-modifying-pages.md

* Rename building-apps-with-gatsby to building-apps-with-gatsby.md

* Update README.md

* Update building-apps-with-gatsby.md

* Add link to new docs page

* Enable filtering on linked nodes (#3600)

Add support to filter on linked nodes.

Close #3190

* Update comment

* Publish

 - [email protected]
 - [email protected]

* Bundle Netlify CMS styles (#3611)

* define webpack loader.exclude with array for extensibility

* generate separate CSS bundle for Netlify CMS plugin

* Fix images disappearing from rendered markdown files (#3612)

* Fix images disappearing from rendered markdown files

Fixes #3608

* Revert invalid indentation changes

* Revert "Enable filtering on linked nodes" (#3613)

* Revert "Fix images disappearing from rendered markdown files (#3612)"

This reverts commit 01022ab.

* Revert "Bundle Netlify CMS styles (#3611)"

This reverts commit d19ec31.

* Revert "Publish"

This reverts commit 53f66a4.

* Revert "Update comment"

This reverts commit 2b22c2c.

* Revert "Enable filtering on linked nodes (#3600)"

This reverts commit 7120e5a.

* Publish

 - [email protected]
 - [email protected]
 - [email protected]

* Add yerevancoder (#3598)

* Fix gatsby-remark-image (#3620)

* Publish

 - [email protected]
 - [email protected]
 - [email protected]

* WordPress Media Download Basic Auth Fix (#3614)

* WordPress Media Download Basic Auth Fix

* format

* Publish

 - [email protected]
 - [email protected]
 - [email protected]

* Set default auth object

* Publish

 - [email protected]
 - [email protected]
 - [email protected]

* Improve checks on authentication so have wiggle room in future

* Publish

 - [email protected]
 - [email protected]
 - [email protected]

* Fix passing auth info to createRemoteFileNode (#3628)

* Fix copying "dev-404-page.js" to the cache folder on Windows (#3627)

* Fix images disappearing from rendered markdown files

Fixes #3608

* Revert invalid indentation changes

* Fix copying "dev-404-page.js" to the cache folder on Windows

Fixes #2819

* Fix snapshot tests

* Revert invalid improper snapshot test modification

* Publish

 - [email protected]

* Publish

 - [email protected]
 - [email protected]

* Tweak copy on the new building apps with gatsby docs page (#3631)

* Added gatsby-starter-lumen

* Add link to Gentics Mesh source community plugin (#3629)

* Add section about deploying with now to the docs (#3641)

* Add section to the deploy docs page for deploying to now

* Add section to the deploy docs page for deploying to now

* Add install code snippet

* Update deploy-gatsby.md

* docs: gatsby config options (#3095) (#3646)

* index.md (#3638)

* index.md

I am not the only one who got this problem. I think some other junior leaner will do the same. My English is poor.If the idea is good, please change it to correct spelling and grammar.
here is the question link: #1739

* Update index.md

* All the author info for Pierre (#3651)

I'm pretty sure I need to update the actual blog post. It's not in master branch on my computer yet, so will just edit it via web

* Strapi blog post content (#3618)

* Strapi blog post content

Avatar and bio still coming, will make those edits and edit yaml later

* Updated author info

Also I just realized that the images in here might not work if we don't have original files in the directory. Is this true, @kylemathews?

* Add tutorial series links to docs (#3634)

* Add tutorial series links to docs

* Update awesome-gatsby.md

* [WIP] Update Gatsbygram to make it work with current (unofficial) JSON API. (#3349)

* Update Gatsbygram to make it work with current (unofficial) JSON API.

* Revert back to previous data structure; add case study URL to README.

* Contributing (#3619)

* Contributing

Not sure if "adding unit or functional tests" makes sense. Took it from webpack example.

Also added your hierarchy of helpfulness under ### special note on issues. Don't know if the sentence introducing them is the best advice...

Also check the plugin naming convention.

Hope I'm getting the header levels right here.

There is some overlap here with the Gatsby style guide. I've got it on a to-do list to think through division of information between the two docs

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* [gatsby-transformer-remark] Add `htmlAst` field (#3596)

This implements a GraphQL field that presents the rehype AST as JSON, allowing for this information to be consumed from a page template and presented dynamically.

* Publish

 - [email protected]

* Update building-apps-with-gatsby.md (#3653)

* fix extract-text--webpack-plugin instance reuse errors (#3652)

* Publish

 - [email protected]

* Minor change to tutorial part four index.md (#3649)

* Minor change to tutorial part four index.md

Changed one liner 2 steps to <ol> style.
More readable.

* Update index.md

* Added deploy task to gh-pages in Org pages (#3642)

Added the task to deploy to Github Pages in Organizations pages like organization.github.io

* Added community plugin: gatsby-plugin-pathdata (#3644)

* Add gatsby-starter-strict (#3645)

* blog: add getting started with gatsby and wordpress (#3647)

* blog: add getting started with gatsby and wordpress

* Make links local to gatsbyjs.org + a few other tweaks

* [www] Search shortcut (#3654)

* Add keyboard shortcut for focussing the search input

* Blur input on result selection

* Remove note about their being more parts to the tutorial (#3655)

* Remove note about their being more parts to the tutorial

We'll ship more stuff when we do. No reason to make it sound less than useful as it is.

* format

* Add images in Strapi tutorial (#3660)

* Add images in Strapi tutorial

* Remove package-lock.json files

* added gatsby ^1.0.0 as a peer dependency for all plugins (#3637)

* README showcase update (#3661)

* updated README with two of my gatsbyjs projects.

I hope this alright, if not I totally understand

* Updated README

fix space issue

* Add gatsby-starter-portfolio-emilia (#3664)

Also grouped both starters into one bulletpoint (as talked about on Discord) and changed some minor stuff.

* [gatsby-source-medium] fetch users and publications (#3623)

* Add support for fetching a users payload along with publications from Medium

* Update gatsby-source-medium readme, add note for @ for usernames

* Undo any changes to `links` variable

* Publish

 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]
 - [email protected]

* [gatsby-source-contentful] Make base64 query to field-level to speed up asset queries (#3617)

* [gatsby-source-contentful] Add withBase64 option to speed up image queries

* Revert "[gatsby-source-contentful] Add withBase64 option to speed up image queries"

This reverts commit bb080f7.

* remove base64 from resolveResponsiveResolution

* create base64 resolver

* update sizes, reset resize to original state

* update tests

* update resize and tests

* Publish

 - [email protected]

* show help and recommend when the command is wrong (#3668)

* Fix gatsby-starter-portfolio-emilia PR (#3667)

Seems like "Features" or something other is messing up the indentation and therefore messing up the whole idea of two sub-entries. So I just did two separate entries now.

* Add Flooring Factories Outlets to Showcase (#3666)

Added a website made for a client... built with gatsby / netlify :)

* Publish

 - [email protected]
 - [email protected]

* Add a podcast website/player to the showcase (#3672)

* [www] Update/consolidate palette, monogram and logo, favicons (#3639)

* #744c9e/116,76,158 -> #9966cc/102, 51, 153 (rebeccapurple)

* [WIP] Consolidate palette

* Ditch B100 in favor of B200

* Neutral diagram stripe color at least for now

* Fussing around with saturation

* Adjustting hues (still WIP ;-))

* Roll back all palette colors but brand/„B700“

* Throw in chroma.js, output presets.B*, chroma.js palette at /colors

* B200 -> B100
* B300 -> B200
* colors.b[0] -> B100
  * components/diagram „box“ border
  * layouts/index sidebar border-right

* Grab chroma-js from npm now that 1.3.6 is published

* Add redrawn monogram and logo (monogram + wordmark)

* remove gatsby-calm.svg for now – was only used on the blog page, where we’re for now using the regular monogram
* remove gatsby-negative.png, not in use – will regenerate the favicons that were probably based on this and add them ASAP
* remove gatsby-positive.svg, unused
* rename gatsby-negative.svg to monogram.svg, update it with the redrawn version
* replace logo and <h1> wordmark in components/navigation with the newly added logo.svg

* Update favicons

* fix apple-touch-icon.png, which had a transparent background which iOS resolves to black which looks 😒
* fix non-anti-aliased edges in all favicons
* add a white background for the „G and chopped edge“ shape of the favicon which was transparent before
* fix Safari pinned tab color

* Add hex2rgba, remove presets.shadowColor (matches presets.B500)

* Inherit text color

* Move colors from presets to colors

* Remove orange logo

* Bump favicon.ico

* Optimize favicons, update Windows tile icons

* Update manifest theme/background_color

* Remove some leftover anchors; invert logo for iOS, Windows tile

* Add Windows tile browserconfig.xml

* Oops

* Remove chroma (…), back to descriptive color names

* Make presets.calm pass WCAG AA

* Fix icon colors

* Remove presets.brandDark

* Add colors.gray

* :D

* Make presets.calm pass WCAG AA again

* rebeccapurple links in blog articles

* Fix logo offset

* Ditch colors.brand, add colors.ui, don’t litter colors in presets 🙄

* rename `brand` to `gatsby`
* expose `utils/colors` at `presets.colors`
* move UI colors to `colors.ui`
* add colors.success, colors.warning

* Update logo wordmark, optimize SVGs

* Update building-apps-with-gatsby.md

* Add plugins.js and searchbar-body.js for searching and displaying gatsby plugins

* Remove unneccesary css

* Removed package-lock.json and renamed plugins.js to packages.js

* Add algolia-npm search and url syncing

* Add background color  when plugin selected

* Fix doubling-up layout bug, add border to hits component, add margin to text in packages

* Remove unnecessary dependencies from package.json

* Remove withUrlSync.js

* Change Algolia link from Link to a tag

* Add gatsby-component as keyword search, change searchbox placeholder

* Add email-validator to package.json to merge with updated site

* Add source plugin to pull in npm package info, add metadata to cards and package detail page

* Remove results display when no results

* Remove multiple div

* Remove startes and filters from packages description

* Update searchbar styles

* Remove searchbar scroll

* Update packages.js

* Empty commit

* Empty commit

* Add plugins.js and searchbar-body.js for searching and displaying gatsby plugins

* Remove unneccesary css

* Removed package-lock.json and renamed plugins.js to packages.js

* Add algolia-npm search and url syncing

* Add background color  when plugin selected

* Fix doubling-up layout bug, add border to hits component, add margin to text in packages

* Remove unnecessary dependencies from package.json

* Remove withUrlSync.js

* Change Algolia link from Link to a tag

* Add gatsby-component as keyword search, change searchbox placeholder

* Add email-validator to package.json to merge with updated site

* Add source plugin to pull in npm package info, add metadata to cards and package detail page

* Remove results display when no results

* Remove multiple div

* Remove startes and filters from packages description

* Add plugins.js and searchbar-body.js for searching and displaying gatsby plugins

* Remove unneccesary css

* Removed package-lock.json and renamed plugins.js to packages.js

* Add algolia-npm search and url syncing

* Add background color  when plugin selected

* Fix doubling-up layout bug, add border to hits component, add margin to text in packages

* Remove unnecessary dependencies from package.json

* Remove withUrlSync.js

* Change Algolia link from Link to a tag

* Add email-validator to package.json to merge with updated site

* Add source plugin to pull in npm package info, add metadata to cards and package detail page

* Remove results display when no results

* Remove multiple div

* Remove startes and filters from packages description

* Update searchbar styles

* Remove searchbar scroll

* Update packages.js

* Empty commit

* Update template-docs to account for both local and remote packages

* Remove duplicate code

* Remove commented out code

* linting fixes to run tests

* removed package-lock

* minor fixes to html head, package.json description, TODO notes

* minor fixes across files in prep for merge

react-icons instead of svgs, updated gitignores for gatsby-node files

removed obsolete gatsby-source-npm that was refactored and renamed gatsby-source-npm-package-search

shortened css file

* removed unused icons

* removed unused gatsby-browser.js, used createNodeId on readmes

* conditional rendering for packages that aren't found, UI tweaks to search bar on wide screens

* plugin library mobile layout

* 2nd implementation of mobile ui

* Fix getting access to createNodeId

createNodeId is a utility library that's passed in and not an NPM package

* css deletions overhaul

* separate components for template doc packages

* using package readme component on template doc packages

* added missing dependencies (date-fns and react-instant-search) to package.json

* keeping undefined objects from being accessed with default values, conditional rendering of specific metadata not pulled by every package

* fix loadNodeContent error, remove old comments

* added infinite scroll for plugins

* highlighting results list with pagination fix

* refactor create page logic to make sure all packages have pages created, and added PropTypes and not found data so undefined errors don't break package readme template components
@patreeceeo
Copy link
Author

@KyleAMathews I'm still running in to this issue. I've tracked it down to https:/gatsbyjs/gatsby/blob/master/packages/gatsby-remark-images/src/index.js#L61. Seems like responsiveSizesResult doesn't have a base64 property, which results in inline CSS on the blur-up span like this:

padding-bottom:63.16666666666667%;
position:relative;
bottom:0;
left:0;
background-image:url('data:image/jpeg;background-size:cover;display:block

@ChrisBoon
Copy link

I'm having the same issue as @pzatrick - when I build the project (gatsby build) I get this as the span result:

<span class="gatsby-resp-image-background-image" 
  style="padding-bottom:76.50273224043715%;
    position:relative;
    bottom:0px;
    left:0px;
    background-image:url('data:image/png;background-size:cover;display:block;" 
  data-reactid="396"
>

The background-image property isn't compiling correctly so it treats all css after it as one declaration. This means there is a failed image request and the css doesn't render correctly.

However when I view the development files (gatsby develop) I get this slightly different code:

<span class="gatsby-resp-image-background-image" 
  style="padding-bottom: 76.5027%; 
    position: relative; 
    bottom: 0px; 
    left: 0px; 
    background-image: url(&quot;data:image/png&quot;); 
    background-size: cover; 
    display: block;"
>

The background-image property still doesn't seem right as there is basically no data, but at least it doesn't break the rest of the css.

I can provide details on my setup if that is useful, not sure if this is a known issue, but this is the first time I've seen someone say they have the same error as me.

@patreeceeo
Copy link
Author

@ChrisBoon yep, I'm having the exact same issue. Make any progress on it?

@patreeceeo
Copy link
Author

My gatsby-config:

module.exports = {
    siteMetadata: {
        title: `Personal site of Patrick Canfield`,
        description: ``,
        siteUrl: `https://patrickcanfield.com`
    },
    plugins: [
        {
            resolve: `gatsby-source-filesystem`,
            options: {
                path: `${__dirname}/src/blog`,
                name: 'pages',
            },
        },
        {
            resolve: `gatsby-transformer-remark`,
            options: {
                plugins: [
                    {
                        resolve: `gatsby-remark-images`,
                        options: {
                            maxWidth: 800,
                        },
                    },
                    'gatsby-remark-prismjs',
                    'gatsby-remark-copy-linked-files',
                    'gatsby-remark-smartypants',
                ],
            },
        },
        `gatsby-transformer-sharp`,
        `gatsby-plugin-sharp`,
        {
            resolve: `gatsby-plugin-google-analytics`,
            options: {
                //trackingId: `ADD YOUR TRACKING ID HERE`,
            },
        },
        {

            resolve: `gatsby-plugin-feed`,
            options: {
                query: `
                    {
                      site {
                        siteMetadata {
                          title
                          description
                          siteUrl
                          site_url: siteUrl
                        }
                      }
                    }
                `,
                feeds: [
                    {
                        serialize: ({ query: { site, allMarkdownRemark } }) => {
                            return allMarkdownRemark.edges.map(edge => {
                                return Object.assign({}, edge.node.frontmatter, {
                                    description: edge.node.excerpt,
                                    url: site.siteMetadata.siteUrl + edge.node.frontmatter.path,
                                    guid: site.siteMetadata.siteUrl + edge.node.frontmatter.path,
                                    custom_elements: [{ 'content:encoded': edge.node.html }],
                                });
                            });
                        },
                        query: `
                            {
                              allMarkdownRemark(
                                limit: 1000,
                                sort: { order: DESC, fields: [frontmatter___date] },
                              ) {
                                edges {
                                  node {
                                    excerpt
                                    html
                                    frontmatter {
                                      title
                                      date
                                      path
                                    }
                                  }
                                }
                              }
                            }
                          `,
                        output: '/rss.xml',
                        feedTitle: 'Blog of Patrick Canfield'
                    }
                ]
            }
        },
        `gatsby-plugin-react-helmet`,
        {
            resolve: 'gatsby-plugin-typography',
            options: {
                pathToConfigModule: 'src/utils/typography',
            },
        },
    ],
};

@ChrisBoon
Copy link

ChrisBoon commented Mar 29, 2018

@pzatrick no, I've not had much chance to look into it. I didn't really need the 'blur up' feature, so I just added 'display: block' in my own CSS to make sure the image displays. I'd like to resolve it because I'm not happy with the failed get requests happening in a live site, but most people will never notice it.

I have noticed that somehow in the last day the issue partially improved as the deployed site is now the same as the develop version - background-image: url(&quot;data:image/png&quot;); so the rest of the css applies correctly. What's odd is I don't think I've done anything that would have changed it.

@lfittl
Copy link

lfittl commented Apr 1, 2018

FWIW, running into the same issue as described in the last few comments.

@KyleAMathews should that be a new issue, or can we re-open this issue?

@lfittl
Copy link

lfittl commented Apr 1, 2018

Actually nevermind, this seems to be a bug in https:/rhysd/rehype-react - when processing your Markdown generated HTML through that (as described here: https://using-remark.gatsbyjs.org/custom-components/) it seems to stop processing anything in each style key-value pair after encountering the first ; in the value.

At least in my case thats the reason for running into the described error - the base64 value itself is generated correctly.

Fixed by syntax-tree/hast-to-hyperscript#13 for me, which can be applied to your app using yarn add git:/lfittl/hast-to-hyperscript for testing / hotfixing this issue.

cc @ChrisBoon @pzatrick

@ChrisBoon
Copy link

@lfittl Awesome, just tried it and it fixed it for me.

@kevinhughes27
Copy link

I had the same thing and this fix worked for me! Thanks for sharing.

joelburget added a commit to monic-co/blog that referenced this issue Jul 16, 2018
@SpicyPete
Copy link

Running into this same issue.
Is there a fix for it yet? Or instructions on how to use the fix posted up a few comments?

@lfittl
Copy link

lfittl commented Jul 19, 2018

@pzenger Seems the issue was resolved in hast-to-hyperscript recently (by using an external library for CSS parsing) - that means you should be able to use their master branch (or release when there is one) instead of my fork now.

@kevinhughes27
Copy link

looks like hast-to-hyperscript 5.0.0 is out now and includes the fix. I tried locally and it works for me.

@SpicyPete
Copy link

@lfittl Indeed it is working now! Thanks for making that PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants