Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created Volunteer Spotlight page, but it's not linked to the homepage yet #135

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12,280 changes: 6,685 additions & 5,595 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"dependencies": {
"gatsby": "^2.13.31",
"gatsby-image": "^2.0.23",
"gatsby-plugin-netlify-identity-widget": "1.1.1",
"gatsby-plugin-netlify": "2.2.1",
"gatsby-plugin-netlify-cms": "4.2.2",
"gatsby-plugin-netlify-identity-widget": "1.1.1",
"gatsby-plugin-purgecss": "^4.0.0",
"gatsby-plugin-react-helmet": "^3.0.4",
"gatsby-plugin-sass": "^2.0.7",
Expand All @@ -19,12 +19,12 @@
"gatsby-source-filesystem": "^2.0.26",
"gatsby-transformer-remark": "^2.6.9",
"gatsby-transformer-sharp": "^2.1.9",
"lodash": "^4.17.15",
"lodash": "^4.17.20",
"lodash-webpack-plugin": "^0.11.4",
"netlify-cms-app": "2.12.7",
"netlify-cms-media-library-cloudinary": "1.3.4",
"netlify-cms-media-library-uploadcare": "0.5.5",
"node-sass": "^4.11.0",
"node-sass": "^4.14.1",
"prop-types": "^15.6.0",
"react": "^16.8.4",
"react-dom": "^16.8.4",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ section:
button: Volunteer
url: https://example.com
contribute:
heading: Other ways to get get involved
heading: Other ways to get involved
channel:
- image: /img/github.png
heading: Developers
Expand Down
Binary file added src/pages/volunteer-spotlight/avatar-female.png
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 src/pages/volunteer-spotlight/avatar-male.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/pages/volunteer-spotlight/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
templateKey: volunteer-spotlight-page
path: /volunteer-spotlight
title: "Volunteer Spotlight"
---

John Doe:

![maleAvatar](./avatar-male.png)

Jane Doe:

![femaleAvater](./avatar-female.png)

Here is some sample text

56 changes: 56 additions & 0 deletions src/templates/volunteer-spotlight-page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React from 'react';
import PropTypes from 'prop-types';
import { graphql } from 'gatsby';
import Layout from '../components/Layout';
import Content, { HTMLContent } from '../components/Content';

export const VolunteerSpotlightPageTemplate = ({ title, content, contentComponent }) => {
const PageContent = contentComponent || Content;

return (
<div className="siteContent">
<div className="siteContent-inner">
<h1>{title}</h1>
<PageContent className="content" content={content} />
</div>
</div>
);
};


VolunteerSpotlightPageTemplate.propTypes = {
title: PropTypes.string.isRequired,
content: PropTypes.string,
contentComponent: PropTypes.func,
};

const VolunteerSpotlightPage = ({ data }) => {
const { markdownRemark: post } = data;

return (
<Layout>
<VolunteerSpotlightPageTemplate
contentComponent={HTMLContent}
title={post.frontmatter.title}
content={post.html}
/>
</Layout>
);
};

VolunteerSpotlightPage.propTypes = {
data: PropTypes.object.isRequired,
};

export default VolunteerSpotlightPage;

export const VolunteerSpotlightPageQuery = graphql`
query VolunteerSpotlightPage($id: String!) {
markdownRemark(id: { eq: $id }) {
html
frontmatter {
title
}
}
}
`;