Skip to content

Instantly share code, notes, and snippets.

View onimenotsuki's full-sized avatar
🎯
Focusing

Edgar Talledos Robledos onimenotsuki

🎯
Focusing
View GitHub Profile
/**
* Layout component that queries for data
* with Gatsby's useStaticQuery component
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/
import React from 'react';
import PropTypes from 'prop-types';
import { useStaticQuery, graphql } from 'gatsby';
/**
* SEO component that queries for data with
* Gatsby's useStaticQuery React hook
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/
import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import React from 'react';
import { useStaticQuery, graphql } from 'gatsby';
import Img from 'gatsby-image';
/*
* This component is built using `gatsby-image` to automatically serve optimized
* images with lazy loading and reduced file sizes. The image is loaded using a
* `useStaticQuery`, which allows us to load the image from directly within this
* component, rather than having to pass the image data down from pages.
*
import { Link } from 'gatsby';
import PropTypes from 'prop-types';
import React from 'react';
const Header = ({ siteTitle }) => (
<header
style={{
background: 'rebeccapurple',
marginBottom: '1.45rem',
}}
import React from 'react';
import { Link } from 'gatsby';
import Layout from '../components/layout';
import SEO from '../components/seo';
const SecondPage = () => (
<Layout>
<SEO title="Page two" />
<h1>Hi from the second page</h1>
import React from 'react';
import Layout from '../components/layout';
import SEO from '../components/seo';
const NotFoundPage = () => (
<Layout>
<SEO title="404: Not found" />
<h1>NOT FOUND</h1>
<p>You just hit a route that doesn&#39;t exist... the sadness.</p>
import React from 'react';
import { Link } from 'gatsby';
import Layout from '../components/layout';
import Image from '../components/image';
import SEO from '../components/seo';
const IndexPage = () => (
<Layout>
<SEO title="Home" />
@onimenotsuki
onimenotsuki / .stylelintrc.yaml
Created July 29, 2019 05:00
Creando un blog con GatsbyJS, Material Design y Contentful
extends: stylelint-config-standard
plugins:
- stylelint-selector-bem-pattern
- stylelint-scss
- stylelint-order
rules:
# Override stylelint-config-standard - we only use CSS comments for annotations that don't warrant an empty line
comment-empty-line-before: null
# Follow best practices
font-family-name-quotes: always-where-recommended
@onimenotsuki
onimenotsuki / .eslintrc.json
Created July 29, 2019 04:58
Creando un blog con GatsbyJS, Material Design y Contentful
{
"extends": "airbnb",
"parser": "babel-eslint",
"rules": {
"jsx-a11y/anchor-is-valid": ["error", {
"components": ["Link"],
"specialLink": ["hrefLeft", "hrefRight", "to"],
"aspects": ["noHref", "invalidHref", "preferButton"]
}],
"react/jsx-filename-extension": [1, { "extensions": [".jsx"] }],
@onimenotsuki
onimenotsuki / .eslintrc.json
Created June 12, 2019 21:44
Eslint configuration
{
"extends": "airbnb",
"parser": "babel-eslint",
"rules": {
"jsx-a11y/anchor-is-valid": ["error", {
"components": ["Link"],
"specialLink": ["hrefLeft", "hrefRight", "to"],
"aspects": ["noHref", "invalidHref", "preferButton"]
}],
"react/jsx-filename-extension": [1, { "extensions": [".jsx"] }],