10 |
11 | Kick off your project with this blog boilerplate. This starter ships with the main Gatsby configuration files you might need to get up and running blazing fast with the blazing fast app generator for React.
12 |
13 | _Have another more specific idea? You may want to check out our vibrant collection of [official and community-created starters](https://www.gatsbyjs.org/docs/gatsby-starters/)._
14 |
15 | ## 🚀 Quick start
16 |
17 | 1. **Create a Gatsby site.**
18 |
19 | Use the Gatsby CLI to create a new site, specifying the blog starter.
20 |
21 | ```sh
22 | # create a new Gatsby site using the blog starter
23 | gatsby new my-blog-starter https://github.com/gatsbyjs/gatsby-starter-blog
24 | ```
25 |
26 | 1. **Start developing.**
27 |
28 | Navigate into your new site’s directory and start it up.
29 |
30 | ```sh
31 | cd my-blog-starter/
32 | gatsby develop
33 | ```
34 |
35 | 1. **Open the source code and start editing!**
36 |
37 | Your site is now running at `http://localhost:8000`!
38 |
39 | _Note: You'll also see a second link: _`http://localhost:8000/___graphql`_. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the [Gatsby tutorial](https://www.gatsbyjs.org/tutorial/part-five/#introducing-graphiql)._
40 |
41 | Open the `my-blog-starter` directory in your code editor of choice and edit `src/pages/index.js`. Save your changes and the browser will update in real time!
42 |
43 | ## 🧐 What's inside?
44 |
45 | A quick look at the top-level files and directories you'll see in a Gatsby project.
46 |
47 | .
48 | ├── node_modules
49 | ├── src
50 | ├── .gitignore
51 | ├── .prettierrc
52 | ├── gatsby-browser.js
53 | ├── gatsby-config.js
54 | ├── gatsby-node.js
55 | ├── gatsby-ssr.js
56 | ├── LICENSE
57 | ├── package-lock.json
58 | ├── package.json
59 | └── README.md
60 |
61 | 1. **`/node_modules`**: This directory contains all of the modules of code that your project depends on (npm packages) are automatically installed.
62 |
63 | 2. **`/src`**: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template. `src` is a convention for “source code”.
64 |
65 | 3. **`.gitignore`**: This file tells git which files it should not track / not maintain a version history for.
66 |
67 | 4. **`.prettierrc`**: This is a configuration file for [Prettier](https://prettier.io/). Prettier is a tool to help keep the formatting of your code consistent.
68 |
69 | 5. **`gatsby-browser.js`**: This file is where Gatsby expects to find any usage of the [Gatsby browser APIs](https://www.gatsbyjs.org/docs/browser-apis/) (if any). These allow customization/extension of default Gatsby settings affecting the browser.
70 |
71 | 6. **`gatsby-config.js`**: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. (Check out the [config docs](https://www.gatsbyjs.org/docs/gatsby-config/) for more detail).
72 |
73 | 7. **`gatsby-node.js`**: This file is where Gatsby expects to find any usage of the [Gatsby Node APIs](https://www.gatsbyjs.org/docs/node-apis/) (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process.
74 |
75 | 8. **`gatsby-ssr.js`**: This file is where Gatsby expects to find any usage of the [Gatsby server-side rendering APIs](https://www.gatsbyjs.org/docs/ssr-apis/) (if any). These allow customization of default Gatsby settings affecting server-side rendering.
76 |
77 | 9. **`LICENSE`**: Gatsby is licensed under the MIT license.
78 |
79 | 10. **`package-lock.json`** (See `package.json` below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. **(You won’t change this file directly).**
80 |
81 | 11. **`package.json`**: A manifest file for Node.js projects, which includes things like metadata (the project’s name, author, etc). This manifest is how npm knows which packages to install for your project.
82 |
83 | 12. **`README.md`**: A text file containing useful reference information about your project.
84 |
85 | ## 🎓 Learning Gatsby
86 |
87 | Looking for more guidance? Full documentation for Gatsby lives [on the website](https://www.gatsbyjs.org/). Here are some places to start:
88 |
89 | - **For most developers, we recommend starting with our [in-depth tutorial for creating a site with Gatsby](https://www.gatsbyjs.org/tutorial/).** It starts with zero assumptions about your level of ability and walks through every step of the process.
90 |
91 | - **To dive straight into code samples, head [to our documentation](https://www.gatsbyjs.org/docs/).** In particular, check out the _Guides_, _API Reference_, and _Advanced Tutorials_ sections in the sidebar.
92 |
93 | ## 💫 Deploy
94 |
95 | [](https://app.netlify.com/start/deploy?repository=https://github.com/gatsbyjs/gatsby-starter-blog)
96 |
97 |
98 |
--------------------------------------------------------------------------------
/example/content/assets/gatsby-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/and-hyde/example/46276defa736abec63ef2f43e8f3b200d3cf40c2/example/content/assets/gatsby-icon.png
--------------------------------------------------------------------------------
/example/content/assets/profile-pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/and-hyde/example/46276defa736abec63ef2f43e8f3b200d3cf40c2/example/content/assets/profile-pic.jpg
--------------------------------------------------------------------------------
/example/content/blog/archives/2011-12-25-creating-rebase.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: creating rebase
3 | updated_at: 2011-12-26
4 | ---
5 |
6 | This is an archived post, and should only show up in the archives section
7 |
--------------------------------------------------------------------------------
/example/content/blog/hi-folks/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: New Beginnings
3 | date: "2015-05-28T22:40:32.169Z"
4 | description: This is a custom description for SEO and Open Graph purposes, rather than the default generated excerpt. Simply add a description field to the frontmatter.
5 | ---
6 |
7 | Far far away, behind the word mountains, far from the countries Vokalia and
8 | Consonantia, there live the blind texts. Separated they live in Bookmarksgrove
9 | right at the coast of the Semantics, a large language ocean. A small river named
10 | Duden flows by their place and supplies it with the necessary regelialia.
11 |
12 | ## On deer horse aboard tritely yikes and much
13 |
14 | The Big Oxmox advised her not to do so, because there were thousands of bad
15 | Commas, wild Question Marks and devious Semikoli, but the Little Blind Text
16 | didn’t listen. She packed her seven versalia, put her initial into the belt and
17 | made herself on the way.
18 |
19 | - This however showed weasel
20 | - Well uncritical so misled
21 | - this is very interesting
22 | - Goodness much until that fluid owl
23 |
24 | When she reached the first hills of the **Italic Mountains**, she had a last
25 | view back on the skyline of her hometown _Bookmarksgrove_, the headline of
26 | [Alphabet Village](http://google.com) and the subline of her own road, the Line
27 | Lane. Pityful a rethoric question ran over her cheek, then she continued her
28 | way. On her way she met a copy.
29 |
30 | ### Overlaid the jeepers uselessly much excluding
31 |
32 | But nothing the copy said could convince her and so it didn’t take long until a
33 | few insidious Copy Writers ambushed her, made her drunk with
34 | [Longe and Parole](http://google.com) and dragged her into their agency, where
35 | they abused her for their projects again and again. And if she hasn’t been
36 | rewritten, then they are still using her.
37 |
38 | > Far far away, behind the word mountains, far from the countries Vokalia and
39 | > Consonantia, there live the blind texts. Separated they live in Bookmarksgrove
40 | > right at the coast of the Semantics, a large language ocean.
41 |
42 | It is a paradisematic country, in which roasted parts of sentences fly into your
43 | mouth. Even the all-powerful Pointing has no control about the blind texts it is
44 | an almost unorthographic life One day however a small line of blind text by the
45 | name of Lorem Ipsum decided to leave for the far World of Grammar.
46 |
47 | ### According a funnily until pre-set or arrogant well cheerful
48 |
49 | The Big Oxmox advised her not to do so, because there were thousands of bad
50 | Commas, wild Question Marks and devious Semikoli, but the Little Blind Text
51 | didn’t listen. She packed her seven versalia, put her initial into the belt and
52 | made herself on the way.
53 |
54 | 1. So baboon this
55 | 2. Mounted militant weasel gregariously admonishingly straightly hey
56 | 3. Dear foresaw hungry and much some overhung
57 | 4. Rash opossum less because less some amid besides yikes jeepers frenetic
58 | impassive fruitlessly shut
59 |
60 | When she reached the first hills of the Italic Mountains, she had a last view
61 | back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet
62 | Village and the subline of her own road, the Line Lane. Pityful a rethoric
63 | question ran over her cheek, then she continued her way. On her way she met a
64 | copy.
65 |
66 | > The copy warned the Little Blind Text, that where it came from it would have
67 | > been rewritten a thousand times and everything that was left from its origin
68 | > would be the word "and" and the Little Blind Text should turn around and
69 | > return to its own, safe country.
70 |
71 | But nothing the copy said could convince her and so it didn’t take long until a
72 | few insidious Copy Writers ambushed her, made her drunk with Longe and Parole
73 | and dragged her into their agency, where they abused her for their projects
74 | again and again. And if she hasn’t been rewritten, then they are still using
75 | her. Far far away, behind the word mountains, far from the countries Vokalia and
76 | Consonantia, there live the blind texts.
77 |
78 | #### Silent delightfully including because before one up barring chameleon
79 |
80 | Separated they live in Bookmarksgrove right at the coast of the Semantics, a
81 | large language ocean. A small river named Duden flows by their place and
82 | supplies it with the necessary regelialia. It is a paradisematic country, in
83 | which roasted parts of sentences fly into your mouth.
84 |
85 | Even the all-powerful Pointing has no control about the blind texts it is an
86 | almost unorthographic life One day however a small line of blind text by the
87 | name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox
88 | advised her not to do so, because there were thousands of bad Commas, wild
89 | Question Marks and devious Semikoli, but the Little Blind Text didn’t listen.
90 |
91 | ##### Wherever far wow thus a squirrel raccoon jeez jaguar this from along
92 |
93 | She packed her seven versalia, put her initial into the belt and made herself on
94 | the way. When she reached the first hills of the Italic Mountains, she had a
95 | last view back on the skyline of her hometown Bookmarksgrove, the headline of
96 | Alphabet Village and the subline of her own road, the Line Lane. Pityful a
97 | rethoric question ran over her cheek, then she continued her way. On her way she
98 | met a copy.
99 |
100 | ###### Slapped cozy a that lightheartedly and far
101 |
102 | The copy warned the Little Blind Text, that where it came from it would have
103 | been rewritten a thousand times and everything that was left from its origin
104 | would be the word "and" and the Little Blind Text should turn around and return
105 | to its own, safe country. But nothing the copy said could convince her and so it
106 | didn’t take long until a few insidious Copy Writers ambushed her, made her drunk
107 | with Longe and Parole and dragged her into their agency, where they abused her
108 | for their projects again and again.
109 |
--------------------------------------------------------------------------------
/example/content/blog/my-second-post/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: My Second Post!
3 | date: "2015-05-06T23:46:37.121Z"
4 | ---
5 |
6 | Wow! I love blogging so much already.
7 |
8 | Did you know that "despite its name, salted duck eggs can also be made from
9 | chicken eggs, though the taste and texture will be somewhat different, and the
10 | egg yolk will be less rich."?
11 | ([Wikipedia Link](http://en.wikipedia.org/wiki/Salted_duck_egg))
12 |
13 | Yeah, I didn't either.
14 |
--------------------------------------------------------------------------------
/example/gatsby-browser.js:
--------------------------------------------------------------------------------
1 | // custom typefaces
2 | import "typeface-montserrat"
3 | import "typeface-merriweather"
4 |
--------------------------------------------------------------------------------
/example/gatsby-config.js:
--------------------------------------------------------------------------------
1 | // https://github.com/gatsbyjs/gatsby/issues/1457
2 | require('ts-node').register({ files: true })
3 |
4 | module.exports = {
5 | siteMetadata: {
6 | title: `rebase -i`,
7 | author: `Orta Therox`,
8 | description: `Writing.`,
9 | siteUrl: `https://orta.io/rebase/`,
10 | social: {
11 | twitter: `orta`,
12 | },
13 | },
14 | plugins: [
15 | "gatsby-plugin-codegen",
16 | "gatsby-plugin-typescript",
17 | {
18 | resolve: `gatsby-source-filesystem`,
19 | options: {
20 | path: `${__dirname}/content/blog`,
21 | name: `blog`,
22 | },
23 | },
24 | {
25 | resolve: `gatsby-source-filesystem`,
26 | options: {
27 | path: `${__dirname}/content/assets`,
28 | name: `assets`,
29 | },
30 | },
31 | {
32 | resolve: `gatsby-transformer-remark`,
33 | options: {
34 | plugins: [
35 | {
36 | resolve: `gatsby-remark-images`,
37 | options: {
38 | maxWidth: 590,
39 | },
40 | },
41 | {
42 | resolve: `gatsby-remark-responsive-iframe`,
43 | options: {
44 | wrapperStyle: `margin-bottom: 1.0725rem`,
45 | },
46 | },
47 | `gatsby-remark-prismjs`,
48 | `gatsby-remark-copy-linked-files`,
49 | `gatsby-remark-smartypants`,
50 | ],
51 | },
52 | },
53 | `gatsby-transformer-sharp`,
54 | `gatsby-plugin-sharp`,
55 | `gatsby-plugin-feed`,
56 | {
57 | resolve: `gatsby-plugin-manifest`,
58 | options: {
59 | name: `Gatsby Starter Blog`,
60 | short_name: `GatsbyJS`,
61 | start_url: `/`,
62 | background_color: `#ffffff`,
63 | theme_color: `#663399`,
64 | display: `minimal-ui`,
65 | icon: `content/assets/gatsby-icon.png`,
66 | },
67 | },
68 | `gatsby-plugin-offline`,
69 | `gatsby-plugin-react-helmet`,
70 | {
71 | resolve: `gatsby-plugin-typography`,
72 | options: {
73 | pathToConfigModule: `src/utils/typography`,
74 | },
75 | },
76 | ],
77 | }
78 |
--------------------------------------------------------------------------------
/example/gatsby-node.js:
--------------------------------------------------------------------------------
1 | // @ts-check
2 |
3 | const {createPages} = require("./src/lib/createPages")
4 | const {onCreateNode} = require("./src/lib/onCreateNode")
5 |
6 | exports.createPages = createPages
7 | exports.onCreateNode = onCreateNode
8 |
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "and-hyde-examples",
3 | "private": true,
4 | "description": "An example blog for and-hyde",
5 | "version": "0.1.0",
6 | "author": "",
7 | "bugs": {
8 | "url": "https://github.com/and-hyde/example"
9 | },
10 | "dependencies": {
11 | "@babel/core": "^7.6.0",
12 | "@babel/runtime": "7.3.0",
13 | "@types/node": "^12.7.4",
14 | "@types/react": "^16.9.2",
15 | "@types/react-dom": "^16.9.0",
16 | "@types/react-helmet": "^5.0.10",
17 | "@types/typography": "^0.16.3",
18 | "gatsby": "^2.15.14",
19 | "gatsby-image": "^2.2.18",
20 | "gatsby-plugin-codegen": "^1.0.3",
21 | "gatsby-plugin-feed": "^2.3.12",
22 | "gatsby-plugin-google-analytics": "^2.1.16",
23 | "gatsby-plugin-manifest": "^2.2.16",
24 | "gatsby-plugin-offline": "^3.0.6",
25 | "gatsby-plugin-react-helmet": "^3.1.7",
26 | "gatsby-plugin-sharp": "^2.2.21",
27 | "gatsby-plugin-typography": "^2.3.7",
28 | "gatsby-remark-copy-linked-files": "^2.1.19",
29 | "gatsby-remark-images": "^3.1.21",
30 | "gatsby-remark-prismjs": "^3.3.13",
31 | "gatsby-remark-responsive-iframe": "^2.2.16",
32 | "gatsby-remark-smartypants": "^2.1.8",
33 | "gatsby-source-filesystem": "^2.1.22",
34 | "gatsby-transformer-remark": "^2.6.22",
35 | "gatsby-transformer-sharp": "^2.2.14",
36 | "prismjs": "^1.17.1",
37 | "react": "^16.9.0",
38 | "react-dom": "^16.9.0",
39 | "react-helmet": "^5.2.1",
40 | "react-typography": "^0.16.19",
41 | "ts-node": "^8.3.0",
42 | "typeface-merriweather": "0.0.72",
43 | "typeface-montserrat": "0.0.75",
44 | "typescript": "^3.6.2",
45 | "typography": "^0.16.19",
46 | "typography-theme-wordpress-2016": "^0.16.19",
47 | "gatsby-plugin-typescript": "^2.1.7",
48 | "prettier": "^1.18.2"
49 | },
50 | "resolutions": {
51 | "@types/react": "16.9.2"
52 | },
53 | "homepage": "https://github.com/and-hyde/example#readme",
54 | "keywords": [
55 | "gatsby"
56 | ],
57 | "license": "MIT",
58 | "main": "n/a",
59 | "repository": {
60 | "type": "git",
61 | "url": "git+https://github.com/and-hyde/example.git"
62 | },
63 | "scripts": {
64 | "build": "gatsby build",
65 | "type-check": "tsc --noEmit",
66 | "develop": "gatsby develop",
67 | "format": "prettier --write src/**/*.{js,jsx}",
68 | "start": "npm run develop",
69 | "serve": "gatsby serve",
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/example/src/ambient.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'typography-theme-wordpress-2016';
2 |
--------------------------------------------------------------------------------
/example/src/components/__generated__/BioQuery.d.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | // This file was automatically generated and should not be edited.
4 |
5 | // ====================================================
6 | // GraphQL query operation: BioQuery
7 | // ====================================================
8 |
9 | export interface BioQuery_avatar_childImageSharp_fixed {
10 | __typename: "ImageSharpFixed";
11 | base64: string | null;
12 | width: number | null;
13 | height: number | null;
14 | src: string | null;
15 | srcSet: string | null;
16 | }
17 |
18 | export interface BioQuery_avatar_childImageSharp {
19 | __typename: "ImageSharp";
20 | fixed: BioQuery_avatar_childImageSharp_fixed | null;
21 | }
22 |
23 | export interface BioQuery_avatar {
24 | __typename: "File";
25 | childImageSharp: BioQuery_avatar_childImageSharp | null;
26 | }
27 |
28 | export interface BioQuery_site_siteMetadata_social {
29 | __typename: "SiteSiteMetadataSocial";
30 | twitter: string | null;
31 | }
32 |
33 | export interface BioQuery_site_siteMetadata {
34 | __typename: "SiteSiteMetadata";
35 | author: string | null;
36 | social: BioQuery_site_siteMetadata_social | null;
37 | }
38 |
39 | export interface BioQuery_site {
40 | __typename: "Site";
41 | siteMetadata: BioQuery_site_siteMetadata | null;
42 | }
43 |
44 | export interface BioQuery {
45 | avatar: BioQuery_avatar | null;
46 | site: BioQuery_site | null;
47 | }
48 |
--------------------------------------------------------------------------------
/example/src/components/__generated__/SEOMetadata.d.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | // This file was automatically generated and should not be edited.
4 |
5 | // ====================================================
6 | // GraphQL query operation: SEOMetadata
7 | // ====================================================
8 |
9 | export interface SEOMetadata_site_siteMetadata {
10 | __typename: "SiteSiteMetadata";
11 | title: string | null;
12 | description: string | null;
13 | author: string | null;
14 | }
15 |
16 | export interface SEOMetadata_site {
17 | __typename: "Site";
18 | siteMetadata: SEOMetadata_site_siteMetadata | null;
19 | }
20 |
21 | export interface SEOMetadata {
22 | site: SEOMetadata_site | null;
23 | }
24 |
--------------------------------------------------------------------------------
/example/src/components/bio.tsx:
--------------------------------------------------------------------------------
1 | import React from "react"
2 | import { graphql, useStaticQuery } from "gatsby"
3 | import Image from "gatsby-image"
4 |
5 | import { rhythm } from "../utils/typography"
6 |
7 | export default function Bio() {
8 | const data = useStaticQuery(bioQuery)
9 | const { author, social } = data.site.siteMetadata
10 |
11 | return (
12 |