forked from gatsby-uc/gatsby-plugin-s3
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c8dcb6
commit 9b455a0
Showing
11 changed files
with
143 additions
and
97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,3 +67,5 @@ yarn-error.log | |
.pnp.js | ||
# Yarn Integrity file | ||
.yarn-integrity | ||
.serverless | ||
|
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 |
---|---|---|
@@ -1,14 +1,23 @@ | ||
exports.createPages = ({ actions }) => { | ||
exports.createPages = ({actions}) => { | ||
// create some test redirects | ||
actions.createRedirect({ | ||
fromPath: '/', | ||
toPath: '/page-2', | ||
toPath: '/page-2/', | ||
isPermanent: true, | ||
redirectInBrowser: true | ||
}); | ||
actions.createRedirect({ | ||
fromPath: '/hello-there', | ||
toPath: '/high-ground', | ||
toPath: '/high-ground/', | ||
isPermanent: false | ||
}); | ||
}; | ||
}; | ||
|
||
// Required for client only paths to work | ||
exports.onCreatePage = async ({page, actions}) => { | ||
const {createPage} = actions | ||
if (page.path.match(/^\/client-only/)) { | ||
page.matchPath = "/client-only/*" | ||
createPage(page) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,42 +1,42 @@ | ||
import { Link } from 'gatsby'; | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import { Link } from "gatsby"; | ||
import PropTypes from "prop-types"; | ||
import React from "react"; | ||
|
||
const Header = ({ siteTitle }) => ( | ||
<div | ||
style={{ | ||
background: "rebeccapurple", | ||
marginBottom: "1.45rem", | ||
}} | ||
> | ||
<div | ||
style={{ | ||
background: 'rebeccapurple', | ||
marginBottom: '1.45rem' | ||
}} | ||
style={{ | ||
margin: "0 auto", | ||
maxWidth: 960, | ||
padding: "1.45rem 1.0875rem", | ||
}} | ||
> | ||
<div | ||
style={{ | ||
margin: '0 auto', | ||
maxWidth: 960, | ||
padding: '1.45rem 1.0875rem' | ||
}} | ||
<h1 style={{ margin: 0 }}> | ||
<Link | ||
to="/" | ||
style={{ | ||
color: "white", | ||
textDecoration: "none", | ||
}} | ||
> | ||
<h1 style={{ margin: 0 }}> | ||
<Link | ||
to="/" | ||
style={{ | ||
color: 'white', | ||
textDecoration: 'none' | ||
}} | ||
> | ||
{siteTitle} | ||
</Link> | ||
</h1> | ||
</div> | ||
{siteTitle} | ||
</Link> | ||
</h1> | ||
</div> | ||
</div> | ||
); | ||
|
||
Header.propTypes = { | ||
siteTitle: PropTypes.string | ||
siteTitle: PropTypes.string, | ||
}; | ||
|
||
Header.defaultProps = { | ||
siteTitle: '' | ||
siteTitle: "", | ||
}; | ||
|
||
export default Header; |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import Layout from '../components/layout'; | ||
import React from "react"; | ||
import Layout from "../components/layout"; | ||
|
||
const NotFoundPage = () => ( | ||
<Layout> | ||
<h1>NOT FOUND</h1> | ||
<p>You just hit a route that doesn't exist... the sadness.</p> | ||
</Layout> | ||
<Layout> | ||
<h1>NOT FOUND</h1> | ||
<p>You just hit a route that doesn't exist... the sadness.</p> | ||
</Layout> | ||
); | ||
|
||
export default NotFoundPage; |
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,23 @@ | ||
import React from "react"; | ||
import { Router } from "@reach/router"; | ||
import { Link } from "gatsby"; | ||
|
||
const Home = () => ( | ||
<div> | ||
<p>Welcome to the app!</p> | ||
<Link to="/client-only/secret"> | ||
Here's a secret route that doesn't exist on the server | ||
</Link> | ||
</div> | ||
); | ||
|
||
const Secret = () => <div>You're visiting me from the client side!</div>; | ||
|
||
const ClientOnlyRoutes = () => ( | ||
<Router basepath="/client-only"> | ||
<Home path="/" /> | ||
<Secret path="/secret" /> | ||
</Router> | ||
); | ||
|
||
export default ClientOnlyRoutes; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import React from 'react'; | ||
import { Link } from 'gatsby'; | ||
import Layout from '../components/layout'; | ||
import React from "react"; | ||
import { Link } from "gatsby"; | ||
import Layout from "../components/layout"; | ||
|
||
const SecondPage = () => ( | ||
<Layout> | ||
<h1>Hi from the second page</h1> | ||
<p>Welcome to page 2</p> | ||
<Link to="/">Go back to the homepage</Link> | ||
</Layout> | ||
<Layout> | ||
<h1>Hi from the second page</h1> | ||
<p>Welcome to page 2</p> | ||
<Link to="/">Go back to the homepage</Link> | ||
</Layout> | ||
); | ||
|
||
export default SecondPage; |