Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 5 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,8 @@
<p align="center">
<a href="https://www.gatsbyjs.com/?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter">
<img alt="Gatsby" src="https://www.gatsbyjs.com/Gatsby-Monogram.svg" width="60" />
</a>
</p>
<h1 align="center">
Gatsby minimal starter
</h1>
# Tutorial Example

## 🚀 Quick start
The example project built by following the [Gatsby Tutorial](https://gatsbyjs.com/docs/tutorial/).

1. **Create a Gatsby site.**
Start developing:

Use the Gatsby CLI to create a new site, specifying the minimal starter.

```shell
# create a new Gatsby site using the minimal starter
npm init gatsby
```

2. **Start developing.**

Navigate into your new site’s directory and start it up.

```shell
cd my-gatsby-site/
npm run develop
```

3. **Open the code and start customizing!**

Your site is now running at http://localhost:8000!

Edit `src/pages/index.js` to see your site update in real-time!

4. **Learn more**

- [Documentation](https://www.gatsbyjs.com/docs/?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter)

- [Tutorials](https://www.gatsbyjs.com/tutorial/?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter)

- [Guides](https://www.gatsbyjs.com/tutorial/?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter)

- [API Reference](https://www.gatsbyjs.com/docs/api-reference/?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter)

- [Plugin Library](https://www.gatsbyjs.com/plugins?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter)

- [Cheat Sheet](https://www.gatsbyjs.com/docs/cheat-sheet/?utm_source=starter&utm_medium=readme&utm_campaign=minimal-starter)

## 🚀 Quick start (Gatsby Cloud)

Deploy this starter with one click on [Gatsby Cloud](https://www.gatsbyjs.com/cloud/):

[<img src="https://www.gatsbyjs.com/deploynow.svg" alt="Deploy to Gatsby Cloud">](https://www.gatsbyjs.com/dashboard/deploynow?url=https://github.com/gatsbyjs/gatsby-starter-minimal)
1. `npm install`
1. `npm run develop`
1 change: 0 additions & 1 deletion src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const Layout = ({ pageTitle, children }) => {

return (
<div className={container}>
<title>{pageTitle} | {data.site.siteMetadata.title}</title>
<header className={siteTitle}>{data.site.siteMetadata.title}</header>
<nav>
<ul className={navLinks}>
Expand Down
20 changes: 20 additions & 0 deletions src/components/seo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as React from 'react'
import { graphql, useStaticQuery } from 'gatsby'

const Seo = ({ title }) => {
const data = useStaticQuery(graphql`
query {
site {
siteMetadata {
title
}
}
}
`)

return (
<title>{title} | {data.site.siteMetadata.title}</title>
)
}

export default Seo
4 changes: 3 additions & 1 deletion src/pages/404.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from "react"
import { Link } from "gatsby"
import Seo from '../components/seo'

// styles
const pageStyles = {
Expand Down Expand Up @@ -28,7 +29,6 @@ const codeStyles = {
const NotFoundPage = () => {
return (
<main style={pageStyles}>
<title>Not found</title>
<h1 style={headingStyles}>Page not found</h1>
<p style={paragraphStyles}>
Sorry 😔, we couldn’t find what you were looking for.
Expand All @@ -47,4 +47,6 @@ const NotFoundPage = () => {
)
}

export const Head = () => <Seo title="Not Found" />

export default NotFoundPage
3 changes: 3 additions & 0 deletions src/pages/about.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react'
import Layout from '../components/layout'
import Seo from '../components/seo'

const AboutPage = () => {
return (
Expand All @@ -9,4 +10,6 @@ const AboutPage = () => {
)
}

export const Head = () => <Seo title="About Me" />

export default AboutPage
3 changes: 3 additions & 0 deletions src/pages/blog/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react'
import { Link, graphql } from 'gatsby'
import Layout from '../../components/layout'
import Seo from '../../components/seo'

const BlogPage = ({ data }) => {
return (
Expand Down Expand Up @@ -38,4 +39,6 @@ export const query = graphql`
}
`

export const Head = () => <Seo title="My Blog Posts" />

export default BlogPage
3 changes: 3 additions & 0 deletions src/pages/blog/{mdx.frontmatter__slug}.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react'
import { graphql } from 'gatsby'
import { GatsbyImage, getImage } from 'gatsby-plugin-image'
import Layout from '../../components/layout'
import Seo from '../../components/seo'

const BlogPost = ({ data, children }) => {
const image = getImage(data.mdx.frontmatter.hero_image)
Expand Down Expand Up @@ -43,4 +44,6 @@ export const query = graphql`
}
`

export const Head = ({ data }) => <Seo title={data.mdx.frontmatter.title} />

export default BlogPost
3 changes: 3 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react'
import Layout from '../components/layout'
import { StaticImage } from 'gatsby-plugin-image'
import Seo from '../components/seo'

const IndexPage = () => {
return (
Expand All @@ -14,4 +15,6 @@ const IndexPage = () => {
)
}

export const Head = () => <Seo title="Home Page" />

export default IndexPage