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

feat(www): Ecosystem page content - finished #9442

Merged
merged 25 commits into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d21ab82
feat(www): prepare featured items forEcosystem
greglobinski Oct 26, 2018
0d6efa8
feat(www): add new icons for Ecosystem
greglobinski Oct 26, 2018
ff39f86
feat(www): Ecosystem content
greglobinski Oct 26, 2018
e57066b
feat(www): create Ecosystem mobile styles
greglobinski Oct 26, 2018
90f236b
feat(www): add new variant of Button
greglobinski Oct 26, 2018
bcc7cbe
feat(www): Ecosystem desktop styles
greglobinski Oct 26, 2018
5be8786
feat(www): add thumbnail to featured starters
greglobinski Oct 26, 2018
c74e8d6
fix(www): fix button label
greglobinski Oct 26, 2018
4c8585a
fix(www): fix typo
greglobinski Oct 29, 2018
38ed5b9
refactor(www): prettify svg code
greglobinski Oct 29, 2018
cfb01ce
refactor(www): remove unnecessary destructuring
greglobinski Oct 29, 2018
1519fe3
fix(www): use slug to pick up featured starters
greglobinski Oct 29, 2018
bd034d6
refactor(www): remove unnecessary spreading to a new object
greglobinski Oct 29, 2018
444eff7
fix(www): fix stylelint errors
greglobinski Oct 29, 2018
3665e47
fix(www): use gatsby-transformer-yaml to pull featured Ecosystem items
greglobinski Oct 29, 2018
384e9ce
feat(www): add backkground icons to test it
greglobinski Oct 29, 2018
5dea1e2
refactor(www): remove unnecessary destructuring in Button
greglobinski Oct 29, 2018
d7682a5
fix(www): remove unnecessary infos
greglobinski Oct 30, 2018
717e084
fix(www): remove background
greglobinski Oct 30, 2018
a27b2fc
feat(www): add function preventing too long description of featured i…
greglobinski Oct 30, 2018
05b3a6d
fix(www): add border to starter thumbnails
greglobinski Oct 30, 2018
50a6820
fix(www): refine Tablet styles
greglobinski Oct 30, 2018
d67ee3f
fix(www): fix desktop section height on FF
greglobinski Oct 30, 2018
1ecdc99
fix(www): change Ecosystem sections headers
greglobinski Oct 30, 2018
9722f98
fix(www): remove unused imports
greglobinski Oct 30, 2018
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
7 changes: 7 additions & 0 deletions www/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ module.exports = {
path: `${__dirname}/../packages/`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `ecosystem`,
path: `${__dirname}/src/data/ecosystem/`,
},
},
{
resolve: `gatsby-plugin-typography`,
options: {
Expand Down
149 changes: 87 additions & 62 deletions www/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const getpkgjson = require(`get-package-json-from-github`)
const parseGHUrl = require(`parse-github-url`)
const { GraphQLClient } = require(`graphql-request`)

let ecosystemFeaturedItems

require(`dotenv`).config({
path: `.env.${process.env.NODE_ENV}`,
})
Expand Down Expand Up @@ -130,91 +132,97 @@ exports.createPages = ({ graphql, actions }) => {
)

// Query for markdown nodes to use in creating pages.
graphql(
`
query {
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] }
limit: 10000
filter: { fileAbsolutePath: { ne: null } }
) {
edges {
node {
fields {
slug
package
}
frontmatter {
title
draft
canonicalLink
publishedAt
tags
}
graphql(`
query {
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] }
limit: 10000
filter: { fileAbsolutePath: { ne: null } }
) {
edges {
node {
fields {
slug
package
}
frontmatter {
title
draft
canonicalLink
publishedAt
tags
}
}
}
allAuthorYaml {
edges {
node {
fields {
slug
}
}
allAuthorYaml {
edges {
node {
fields {
slug
}
}
}
allCreatorsYaml {
edges {
node {
fields {
slug
}
}
allCreatorsYaml {
edges {
node {
fields {
slug
}
}
}
allSitesYaml(filter: { main_url: { ne: null } }) {
edges {
node {
fields {
slug
}
}
allSitesYaml(filter: { main_url: { ne: null } }) {
edges {
node {
fields {
slug
}
}
}
allStartersYaml {
edges {
node {
id
fields {
starterShowcase {
slug
stub
}
}
allStartersYaml {
edges {
node {
id
fields {
starterShowcase {
slug
stub
}
url
repo
}
url
repo
}
}
allNpmPackage {
edges {
node {
}
allNpmPackage {
edges {
node {
id
title
slug
readme {
id
title
slug
readme {
childMarkdownRemark {
id
childMarkdownRemark {
id
html
}
html
}
}
}
}
}
`
).then(result => {
allEcosystemYaml {
edges {
node {
starters
plugins
}
}
}
}
`).then(result => {
if (result.errors) {
return reject(result.errors)
}
Expand Down Expand Up @@ -381,6 +389,9 @@ exports.createPages = ({ graphql, actions }) => {
}
})

// Read featured starters and plugins for Ecosystem
ecosystemFeaturedItems = result.data.allEcosystemYaml.edges[0].node

return resolve()
})
})
Expand Down Expand Up @@ -580,6 +591,20 @@ exports.onCreateNode = ({ node, actions, getNode, reporter }) => {
// end Community/Creators Pages
}

exports.onCreatePage = ({ page, actions }) => {
amberleyromo marked this conversation as resolved.
Show resolved Hide resolved
// add lists of featured items to Ecosystem page
if (page.path === "/ecosystem/") {
const { createPage, deletePage } = actions
const oldPage = Object.assign({}, page)

page.context.featuredStarters = ecosystemFeaturedItems.starters
page.context.featuredPlugins = ecosystemFeaturedItems.plugins

deletePage(oldPage)
createPage(page)
}
}

exports.onPostBuild = () => {
fs.copySync(
`../docs/blog/2017-02-21-1-0-progress-update-where-came-from-where-going/gatsbygram.mp4`,
Expand Down
4 changes: 4 additions & 0 deletions www/src/assets/ecosystem-icons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import PluginsIcon from "!raw-loader!./plugins-ecosystem.svg"
import StartersIcon from "!raw-loader!./starters.svg"

export { PluginsIcon, StartersIcon }
36 changes: 36 additions & 0 deletions www/src/assets/plugins-ecosystem.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions www/src/assets/starters.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions www/src/components/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const Button = ({
tag,
large,
small,
tiny,
secondary,
...rest
}) => {
Expand All @@ -31,9 +32,10 @@ const Button = ({
"&&": {
...buttonStyles.default,
...overrideCSS,
...(secondary && { ...buttonStyles.secondary }),
...(large && { ...buttonStyles.large }),
...(small && { ...buttonStyles.small }),
...(secondary && buttonStyles.secondary),
...(large && buttonStyles.large),
...(small && buttonStyles.small),
...(tiny && buttonStyles.tiny),
amberleyromo marked this conversation as resolved.
Show resolved Hide resolved
},
}

Expand Down
73 changes: 73 additions & 0 deletions www/src/components/ecosystem/ecosystem-board.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import React from "react"
import PropTypes from "prop-types"
import styled from "react-emotion"

import EcosystemSection from "./ecosystem-section"

import presets, { colors } from "../../utils/presets"

const EcosystemBoardRoot = styled("div")`
display: flex;
flex-direction: column;

${presets.Tablet} {
flex-direction: row;
flex-wrap: wrap;
height: calc(
100vh - (${presets.bannerHeight} + ${presets.headerHeight} + 1px)
);
padding: 2rem 1rem 1rem;
}
`

const EcosystemBoard = ({
icons: { plugins: PluginsIcon, starters: StartersIcon },
starters,
plugins,
background,
}) => {
return (
<EcosystemBoardRoot>
<EcosystemSection
title="Plugins"
description="With 429 plugins, lorem ipsum sunt we need some proper copy here pulling in data from your favorite source is only a few mouseclicks away."
subTitle="Featured Plugins"
icon={PluginsIcon}
links={[
{ label: "Browse Plugins", to: "/plugins/" },
{
label: "Plugin Authoring",
to: "/docs/plugin-authoring/",
secondary: true,
},
{ label: "Plugin Docs", to: "/docs/plugins/", secondary: true },
]}
featuredItems={plugins}
/>
<EcosystemSection
title="Starters"
description="Starters are boilerplate Gatsby sites maintained by the community which give you a headstart for your Gatsby project."
subTitle="Featured Starters"
icon={StartersIcon}
links={[
{ label: "Browse Starters", to: "/starters/" },
{ label: "Starter Docs", to: "/docs/starters/", secondary: true },
]}
featuredItems={starters}
/>
<EcosystemSection
title="External Resources"
description="More awesome Gatsby content, created by the community."
links={[{ label: "Browse Resources", to: "/docs/awesome-gatsby/" }]}
/>
</EcosystemBoardRoot>
)
}

EcosystemBoard.propTypes = {
icons: PropTypes.object,
starters: PropTypes.array,
plugins: PropTypes.array,
}

export default EcosystemBoard
Loading