Browse Source

Renamed 'examples' folder to 'codepen' for clarity

main
Brian Vaughn 7 years ago
parent
commit
6eef46d1cb
  1. 0
      codepen/hello-world.js
  2. 0
      codepen/introducing-jsx.js
  3. 2
      content/docs/hello-world.md
  4. 2
      content/docs/introducing-jsx.md
  5. 6
      gatsby-node.js

0
examples/hello-world.js → codepen/hello-world.js

0
examples/introducing-jsx.js → codepen/introducing-jsx.js

2
content/docs/hello-world.md

@ -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:

2
content/docs/introducing-jsx.md

@ -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).

6
gatsby-node.js

@ -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,

Loading…
Cancel
Save