How to use the gatsby.withPrefix function in gatsby

To help you get started, we’ve selected a few gatsby 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 TylerBarnes / gatsby-plugin-transition-link / src / utils / triggerTransition.js View on Github external
event.preventDefault()

	if (inTransition) return false

	let hash

	// handle anchor links to ID's
	if (to.includes('#')) {
		const toSplit = to.split('#')
		to = toSplit[0]
		hash = toSplit[1]
	}

	// these globals prevent the back button from being pressed during a transition as that can have unexpected results
	window.__tl_inTransition = true
	window.__tl_desiredPathname = withPrefix(to)

	updateContext({
		inTransition: true,
		exitDelay: 0,
		exitLength: 0,
		appearAfter: 0,
		exitState: {},
	})

	if (trigger && typeof trigger === 'function') {
		trigger(pages)
	}

	const {
		length: exitLength = 0,
		delay: exitDelay = 0,
github apollographql / gatsby-theme-apollo / packages / gatsby-theme-apollo-core / src / components / sidebar-nav / index.js View on Github external
function isPageSelected(path, pathname) {
  const [a, b] = [withPrefix(path), pathname].map(string =>
    string.replace(/\/$/, '')
  );
  return a === b;
}
github wp-graphql / wp-graphql / docs / src / gatsby-theme-apollo-core / components / sidebar-nav / index.js View on Github external
function isPageSelected(path, pathname) {
  const [a, b] = [withPrefix(path), pathname].map(string =>
    string.replace(/\/$/, '')
  )
  return a === b
}
github dantehemerson / dantecalderon.dev / src / styles / index.js View on Github external
background-image: url("${withPrefix('icons/data.svg')}");
      }
      i.js {
        background-image: url("${withPrefix('icons/javascript.svg')}");
      }
      i.cp {
        background-image: url("${withPrefix('icons/algorithm.svg')}");
      }
      i.back {
        background-image: url("${withPrefix('icons/server.svg')}");
      }
      i.more {
        background-image: url("${withPrefix('icons/web-development.svg')}");
      }
      i.game {
        background-image: url("${withPrefix('icons/pacman.svg')}");
      }
    }
  }

  &__interests__title {
    font-family: 'Open Sans';
    text-transform: uppercase;
    background: #3384a0;
    color: white;
    font-size: 16px;
    padding: 10px 85px;
    display: inline-block;
  }
}

p.para {
github RetailMeNot / anchor / docs / src / pages / index.tsx View on Github external
<a href="//retailmenot.com">
                        <img src="{withPrefix('/images/r-mark.svg')}">
                    </a>
                    <a href="//github.com/RetailMeNot/anchor">
                        <img src="{withPrefix('/images/octocat.svg')}">
                    </a>
                
            
        
    
);
github diegonvs / gatsby-boilerplate / src / components / Sidebar / Navigation.js View on Github external
const Anchor = ({active, page, onclick}) =&gt; {
    let style = active ? 'active nav-link ' : 'nav-link ';

    if (page.items) {
        style += 'collapse-toggle';

        return(
            <a href="#no">
                <span>{page.title}</span>
                <svg>
                    
                </svg>
            </a>
        );
    }

    return (
        
            <span>{page.title}</span>
        
    );
};
github kyma-project / website / src / sitemetadata / SiteMetadata.tsx View on Github external
content="width=device-width, initial-scale=1, shrink-to-fit=no"
        /&gt;
        
        
        
        
        
        
        
        
        
        {tags.map(tag =&gt; (
          
        ))}
github kyma-project / website / src / html.js View on Github external
name="viewport"
          content="width=device-width, initial-scale=1, shrink-to-fit=no"
        /&gt;
github kyma-project / website / src / html.js View on Github external
{headComponents}
      
      
        {preBodyComponents}
        <div id="___gatsby"></div>