Skip to content

Commit

Permalink
Renamed 'examples' folder to 'codepen' for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed Nov 6, 2017
1 parent 56735c4 commit 6eef46d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion content/docs/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ redirect_from:
- "docs/getting-started-zh-CN.html"
---

The easiest way to get started with React is to use <a href="/examples/hello-world" target="_blank">this Hello World example code on CodePen</a>. You don't need to install anything; you can just open it in another tab and follow along as we go through examples. If you'd rather use a local development environment, check out the [Installation](/docs/installation.html) page.
The easiest way to get started with React is to use <a href="/codepen/hello-world" target="_blank">this Hello World example code on CodePen</a>. You don't need to install anything; you can just open it in another tab and follow along as we go through examples. If you'd rather use a local development environment, check out the [Installation](/docs/installation.html) page.

The smallest React example looks like this:

Expand Down
2 changes: 1 addition & 1 deletion content/docs/introducing-jsx.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ReactDOM.render(
);
```

<a href="/examples/introducing-jsx" target="_blank">Try it on CodePen.</a>
<a href="/codepen/introducing-jsx" target="_blank">Try it on CodePen.</a>

We split JSX over multiple lines for readability. While it isn't required, when doing this, we also recommend wrapping it in parentheses to avoid the pitfalls of [automatic semicolon insertion](http://stackoverflow.com/q/2846283).

Expand Down
6 changes: 3 additions & 3 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ exports.createPages = async ({graphql, boundActionCreators}) => {
// Create Codepen redirects.
// These use the Codepen prefill API to JIT-create Pens.
// https://blog.codepen.io/documentation/api/prefill/
readdirSync('./examples').forEach(file => {
readdirSync('./codepen').forEach(file => {
const slug = file.substring(0, file.length - 3); // Trim extension
const code = readFileSync(`./examples/${file}`, 'utf8');
const code = readFileSync(`./codepen/${file}`, 'utf8');

createPage({
path: `/examples/${slug}`,
path: `/codepen/${slug}`,
component: resolve('./src/templates/codepen-example.js'),
context: {
code,
Expand Down

0 comments on commit 6eef46d

Please sign in to comment.