-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into GraphQLParser-errors
- Loading branch information
Showing
37 changed files
with
733 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"env": { | ||
"browser": true | ||
}, | ||
"globals": { | ||
"graphql": false | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
public | ||
.cache | ||
node_modules |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# using-gatsby-remark-copy-linked-files | ||
|
||
https://using-gatsby-remark-copy-linked-files.gatsbyjs.org | ||
|
||
Stub README description |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
module.exports = { | ||
siteMetadata: { | ||
title: `Gatsby Starter Blog`, | ||
author: `Kyle Mathews`, | ||
}, | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-source-filesystem`, | ||
options: { | ||
path: `${__dirname}/src/pages`, | ||
name: `pages`, | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-transformer-remark`, | ||
options: { | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-remark-responsive-iframe`, | ||
options: { | ||
wrapperStyle: `margin-bottom: 1.0725rem`, | ||
}, | ||
}, | ||
`gatsby-remark-prismjs`, | ||
// { | ||
// resolve: `gatsby-remark-images`, | ||
// options: { | ||
// maxWidth: 740, | ||
// }, | ||
// }, | ||
{ | ||
resolve: `gatsby-remark-copy-linked-files`, | ||
options: { | ||
// `ignoreFileExtensions` defaults to [`png`, `jpg`, `jpeg`, `bmp`, `tiff`] | ||
// as we assume you'll use gatsby-remark-images to handle | ||
// images in markdown as it automatically creates responsive | ||
// versions of images. | ||
// | ||
// If you'd like to not use gatsby-remark-images and just copy your | ||
// original images to the public directory, set | ||
// `ignoreFileExtensions` to an empty array. | ||
ignoreFileExtensions: [], | ||
}, | ||
}, | ||
`gatsby-remark-smartypants`, | ||
], | ||
}, | ||
}, | ||
`gatsby-transformer-sharp`, | ||
`gatsby-plugin-sharp`, | ||
{ | ||
resolve: `gatsby-plugin-google-analytics`, | ||
options: { | ||
//trackingId: `ADD YOUR TRACKING ID HERE`, | ||
}, | ||
}, | ||
`gatsby-plugin-offline`, | ||
`gatsby-plugin-react-helmet`, | ||
{ | ||
resolve: `gatsby-plugin-typography`, | ||
options: { | ||
pathToConfigModule: `src/utils/typography`, | ||
}, | ||
}, | ||
], | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const _ = require(`lodash`) | ||
const Promise = require(`bluebird`) | ||
const path = require(`path`) | ||
|
||
exports.createPages = ({ graphql, boundActionCreators }) => { | ||
const { createPage } = boundActionCreators | ||
|
||
return new Promise((resolve, reject) => { | ||
const blogPost = path.resolve(`./src/templates/blog-post.js`) | ||
resolve( | ||
graphql( | ||
` | ||
{ | ||
allMarkdownRemark(limit: 1000) { | ||
edges { | ||
node { | ||
frontmatter { | ||
path | ||
} | ||
} | ||
} | ||
} | ||
} | ||
` | ||
).then(result => { | ||
if (result.errors) { | ||
console.log(result.errors) | ||
reject(result.errors) | ||
} | ||
|
||
// Create blog posts pages. | ||
_.each(result.data.allMarkdownRemark.edges, edge => { | ||
createPage({ | ||
path: edge.node.frontmatter.path, | ||
component: blogPost, | ||
context: { | ||
path: edge.node.frontmatter.path, | ||
}, | ||
}) | ||
}) | ||
}) | ||
) | ||
}) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"name": "using-remark-copy-linked-files", | ||
"private": true, | ||
"description": "Gatsby example site on gatsby-remark-copy-linked-files", | ||
"author": "Florian Kissling <[email protected]>", | ||
"dependencies": { | ||
"gatsby": "^1.9.108", | ||
"gatsby-link": "^1.6.24", | ||
"gatsby-plugin-google-analytics": "^1.0.12", | ||
"gatsby-plugin-offline": "^1.0.10", | ||
"gatsby-plugin-react-helmet": "^1.0.8", | ||
"gatsby-plugin-sharp": "^1.6.20", | ||
"gatsby-plugin-typography": "^1.7.10", | ||
"gatsby-remark-copy-linked-files": "^1.5.20", | ||
"gatsby-remark-images": "^1.5.31", | ||
"gatsby-remark-prismjs": "^1.2.9", | ||
"gatsby-remark-responsive-iframe": "^1.4.14", | ||
"gatsby-remark-smartypants": "^1.4.8", | ||
"gatsby-source-filesystem": "^1.5.8", | ||
"gatsby-transformer-remark": "^1.7.20", | ||
"gatsby-transformer-sharp": "^1.6.13", | ||
"hast-util-to-html": "^3.1.0", | ||
"lodash": "^4.15.0", | ||
"react-responsive-grid": "^0.3.3", | ||
"typeface-merriweather": "^0.0.35", | ||
"typeface-montserrat": "^0.0.37", | ||
"typography-theme-wordpress-2016": "^0.15.1" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^4.9.0", | ||
"eslint-plugin-react": "^7.4.0", | ||
"gh-pages": "^0.12.0", | ||
"prettier": "^1.8.1" | ||
}, | ||
"license": "MIT", | ||
"main": "n/a", | ||
"scripts": { | ||
"dev": "gatsby develop", | ||
"lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'", | ||
"develop": "gatsby develop", | ||
"build": "gatsby build", | ||
"deploy": "gatsby build --prefix-paths && gh-pages -d public", | ||
"fix-semi": "eslint --quiet --ignore-pattern node_modules --ignore-pattern public --parser babel-eslint --no-eslintrc --rule '{\"semi\": [2, \"never\"], \"no-extra-semi\": [2]}' --fix gatsby-node.js" | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
examples/using-remark-copy-linked-files/src/components/Bio.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from "react" | ||
|
||
// Import typefaces | ||
import "typeface-montserrat" | ||
import "typeface-merriweather" | ||
|
||
import profilePic from "./profile-pic.jpg" | ||
import { rhythm } from "../utils/typography" | ||
|
||
class Bio extends React.Component { | ||
render() { | ||
return ( | ||
<div | ||
style={{ | ||
display: `flex`, | ||
marginBottom: rhythm(2.5), | ||
}} | ||
> | ||
<img | ||
src={profilePic} | ||
alt={`Kyle Mathews`} | ||
style={{ | ||
marginRight: rhythm(1 / 2), | ||
marginBottom: 0, | ||
width: rhythm(2), | ||
height: rhythm(2), | ||
}} | ||
/> | ||
<p> | ||
Written by <strong>Kyle Mathews</strong> who lives and works in San | ||
Francisco building useful things.{` `} | ||
<a href="https://twitter.com/kylemathews"> | ||
You should follow him on Twitter | ||
</a> | ||
</p> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default Bio |
Binary file added
BIN
+8.92 KB
examples/using-remark-copy-linked-files/src/components/profile-pic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions
76
examples/using-remark-copy-linked-files/src/layouts/index.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import React from "react" | ||
import Link from "gatsby-link" | ||
import { Container } from "react-responsive-grid" | ||
|
||
import { rhythm, scale } from "../utils/typography" | ||
|
||
require(`prismjs/themes/prism-solarizedlight.css`) | ||
|
||
class Template extends React.Component { | ||
render() { | ||
const { location, children } = this.props | ||
let header | ||
|
||
let rootPath = `/` | ||
if (typeof __PREFIX_PATHS__ !== `undefined` && __PREFIX_PATHS__) { | ||
rootPath = __PATH_PREFIX__ + `/` | ||
} | ||
|
||
if (location.pathname === rootPath) { | ||
header = ( | ||
<h1 | ||
style={{ | ||
...scale(1.5), | ||
marginBottom: rhythm(1.5), | ||
marginTop: 0, | ||
}} | ||
> | ||
<Link | ||
style={{ | ||
boxShadow: `none`, | ||
textDecoration: `none`, | ||
color: `inherit`, | ||
}} | ||
to={`/`} | ||
> | ||
Gatsby Starter Blog | ||
</Link> | ||
</h1> | ||
) | ||
} else { | ||
header = ( | ||
<h3 | ||
style={{ | ||
fontFamily: `Montserrat, sans-serif`, | ||
marginTop: 0, | ||
marginBottom: rhythm(-1), | ||
}} | ||
> | ||
<Link | ||
style={{ | ||
boxShadow: `none`, | ||
textDecoration: `none`, | ||
color: `inherit`, | ||
}} | ||
to={`/`} | ||
> | ||
Gatsby Starter Blog | ||
</Link> | ||
</h3> | ||
) | ||
} | ||
return ( | ||
<Container | ||
style={{ | ||
maxWidth: rhythm(24), | ||
padding: `${rhythm(1.5)} ${rhythm(3 / 4)}`, | ||
}} | ||
> | ||
{header} | ||
{children()} | ||
</Container> | ||
) | ||
} | ||
} | ||
|
||
export default Template |
Binary file added
BIN
+63.4 KB
...es/2017-11-13-gatsby-remark-copy-linked-files/Creativecommons-informational-flyer_eng.pdf
Binary file not shown.
Binary file added
BIN
+3.35 MB
.../src/pages/2017-11-13-gatsby-remark-copy-linked-files/alex-holyoake- 388538.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.43 MB
...s/src/pages/2017-11-13-gatsby-remark-copy-linked-files/alex-holyoake-327106.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.32 MB
...s/src/pages/2017-11-13-gatsby-remark-copy-linked-files/alex-holyoake-340782.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.72 MB
...s/src/pages/2017-11-13-gatsby-remark-copy-linked-files/alex-holyoake-388536.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+580 KB
...ark-copy-linked-files/src/pages/2017-11-13-gatsby-remark-copy-linked-files/gatsbygram.mp4
Binary file not shown.
Oops, something went wrong.