This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { createFilePath } = require(`gatsby-source-filesystem`) | |
| exports.onCreateNode = ({ node, getNode, actions }) => { | |
| const { createNodeField } = actions | |
| if (node.internal.type === `MarkdownRemark`) { | |
| const slug = createFilePath({ node, getNode, basePath: `pages` }) | |
| createNodeField({ | |
| node, | |
| name: `slug`, | |
| value: slug, | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { createFilePath } = require(`gatsby-source-filesystem`) | |
| exports.onCreateNode = ({ node, getNode }) => { | |
| if (node.internal.type === `MarkdownRemark`) { | |
| console.log(createFilePath({ node, getNode, basePath: `pages` })) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.onCreateNode = ({ node, getNode }) => { | |
| if (node.internal.type === `MarkdownRemark`) { | |
| const fileNode = getNode(node.parent) | |
| console.log(`\n`, fileNode.relativePath) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react" | |
| import { graphql } from "gatsby" | |
| import { css } from "@emotion/core" | |
| import { rhythm } from "../utils/typography" | |
| import Layout from "../components/layout" | |
| export default function Home({ data }) { | |
| console.log(data) | |
| return ( | |
| <Layout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react" | |
| import { graphql } from "gatsby" | |
| import { css } from "@emotion/core" | |
| import { rhythm } from "../utils/typography" | |
| import Layout from "../components/layout" | |
| export default function Home({ data }) { | |
| console.log(data) | |
| return ( | |
| <Layout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react" | |
| import { graphql } from "gatsby" | |
| import Layout from "../components/layout" | |
| export default function MyFiles({ data }) { | |
| console.log(data) | |
| return ( | |
| <Layout> | |
| <div> | |
| <h1>My Site's Files</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** @jsx jsx */ | |
| import React from "react" | |
| import { Styled, jsx } from "theme-ui" | |
| import { Link, graphql } from "gatsby" | |
| import Layout from "../components/Organisms/Layout" | |
| import SEO from "./seo" | |
| import Img from "gatsby-image" | |
| export const fluidImage = graphql` | |
| fragment fluidImage on File { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** @jsx jsx */ | |
| import React from "react" | |
| import { Styled, jsx } from "theme-ui" | |
| import { Link, graphql } from "gatsby" | |
| import Layout from "../components/Organisms/Layout" | |
| import SEO from "./seo" | |
| import Img from "gatsby-image" | |
| export const query = graphql` | |
| query { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import { useStaticQuery, graphql } from 'gatsby' | |
| import Img from 'gatsby-image' | |
| const data = useStaticQuery(graphql` | |
| query { | |
| file(relativePath: { eq: "bookshelf.jpg" }) { | |
| childImageSharp { | |
| fluid { | |
| base64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const object1 = { | |
| name: 'Flavio' | |
| } | |
| const object2 = { | |
| age: 35 | |
| } | |
| const object3 = {...object1, ...object2 } |