How to use the gatsby-source-sanity.getFluidGatsbyImage function in gatsby-source-sanity

To help you get started, we’ve selected a few gatsby-source-sanity examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github queerjs / website / web / src / components / Figure.js View on Github external
export default ({ node, dataset }) => {
  const config = {
    projectId: process.env.GATSBY_SANITY_PROJECT_ID || 'atggkqis',
    dataset: process.env.GATSBY_SANITY_DATASET || dataset || 'production',
    token: process.env.SANITY_READ_TOKEN
  }
  const fluidProps = getFluidGatsbyImage(node.asset._id, { maxWidth: 675 }, config)
  return <img alt="{node.alt}">
}
github ehowey / gatsby-theme-catalyst / themes / gatsby-theme-catalyst-writer / src / components / sanity / figure-wide.js View on Github external
export default ({ node }) =&gt; {
  if (!node.asset) {
    return null
  }

  const sanityConfig = useSanityConfig()

  const fluidProps = getFluidGatsbyImage(
    node.asset._ref,
    { maxWidth: 1440 },
    sanityConfig
  )

  return (
    <figure>
      </figure>
github sanity-io / sanity-template-gatsby-portfolio / template / web / src / components / figure.js View on Github external
export default ({node}) =&gt; {
  if (!node.asset) {
    return null
  }

  const fluidProps = getFluidGatsbyImage(node.asset._ref, {maxWidth: 675}, clientConfig.sanity)

  return (
    <figure>
      <img alt="{node.alt}">
      {node.caption &amp;&amp; <figcaption>{node.caption}</figcaption>}
    </figure>
  )
}
github sanity-io / sanity-template-gatsby-blog / template / web / src / components / Figure.js View on Github external
export default ({node}) =&gt; {
  if (!node || !node.asset || !node.asset._id) { return null }
  const fluidProps = getFluidGatsbyImage(
    node.asset._id,
    {maxWidth: 675},
    clientConfig.sanity
  )
  return (
    <figure>
      <img alt="{node.alt}">
      <figcaption>{node.caption}</figcaption>
    </figure>
  )
}
github ehowey / gatsby-theme-catalyst / themes / gatsby-theme-catalyst-writer / src / components / sanity / figure.js View on Github external
export default ({ node }) =&gt; {
  if (!node.asset) {
    return null
  }

  const sanityConfig = useSanityConfig()

  const fluidProps = getFluidGatsbyImage(
    node.asset._ref,
    { maxWidth: 1440 },
    sanityConfig
  )

  return (
    <figure>
      </figure>
github sanity-io / sanity / packages / preview-gatsby-blog-web / src / components / Figure.js View on Github external
export default ({node}) =&gt; {
  const fluidProps = getFluidGatsbyImage(
    node.asset._id,
    {maxWidth: 675},
    clientConfig.sanity
  )
  return (
    <figure>
      <img alt="{node.alt}">
      <figcaption>{node.caption}</figcaption>
    </figure>
  )
}

gatsby-source-sanity

Gatsby source plugin for building websites using Sanity.io as a backend.

MIT
Latest version published 1 year ago

Package Health Score

60 / 100
Full package analysis

Popular gatsby-source-sanity functions