Skip to content

Commit

Permalink
docs(website): remove landing page & guides, it’s now API only
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Apr 14, 2019
1 parent 7874d79 commit 9adcb9f
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 499 deletions.
8 changes: 4 additions & 4 deletions docs/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,20 @@ module.exports = {
// For any node of type MarkdownRemark, list how to resolve the fields` values
MarkdownRemark: {
title: node => node.frontmatter.title,
slug: node => `/api#octokit-${node.fields.idName}`,
type: node => /\/api\//.test(node.fileAbsolutePath) ? 'API' : 'Guide'
slug: node => `#octokit-${node.fields.idName}`,
type: node => 'API'
},
OctokitApiGroup: {
title: node => upperFirst(node.name),
slug: node => `/api#${node.id}`,
slug: node => `#${node.id}`,
type: node => 'API'
},
OctokitApiMethod: {
name: node => node.name,
scope: node => node.scope,
route: node => `${node.method} ${node.path}`,
method: node => `${node.scope}.${camelCase(node.idName)}`,
slug: node => `/api#${node.id}`,
slug: node => `#${node.id}`,
type: node => 'API method'
}
},
Expand Down
50 changes: 25 additions & 25 deletions docs/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,29 @@ exports.onCreateNode = ({ node, getNode, actions }) => {
}
}

exports.createPages = async ({ graphql, actions }) => {
const { createPage } = actions
// exports.createPages = async ({ graphql, actions }) => {
// const { createPage } = actions

const guidesPagesResult = await graphql(`{
allMarkdownRemark {
edges {
node {
fields {
slug
}
}
}
}
}`)
guidesPagesResult.data.allMarkdownRemark.edges.forEach(({ node }) => {
createPage({
path: node.fields.slug,
component: path.resolve(`./src/templates/guide.js`),
context: {
// Data passed to context is available
// in page queries as GraphQL variables.
slug: node.fields.slug
}
})
})
}
// const guidesPagesResult = await graphql(`{
// allMarkdownRemark {
// edges {
// node {
// fields {
// slug
// }
// }
// }
// }
// }`)
// guidesPagesResult.data.allMarkdownRemark.edges.forEach(({ node }) => {
// createPage({
// path: node.fields.slug,
// component: path.resolve(`./src/templates/guide.js`),
// context: {
// // Data passed to context is available
// // in page queries as GraphQL variables.
// slug: node.fields.slug
// }
// })
// })
// }
39 changes: 0 additions & 39 deletions docs/src/components/guides-list.js

This file was deleted.

18 changes: 2 additions & 16 deletions docs/src/components/layout.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import React, { Component } from 'react'
import { StaticQuery, Link } from 'gatsby'
import { graphql, StaticQuery } from 'gatsby'

import layoutStyles from './layout.module.css'
import './layout.css'
import Search from "./search"

const ListLink = props => (
<li style={{ display: `inline-block`, marginRight: `1rem` }}>
<Link to={props.to}>{props.children}</Link>
</li>
)

class Layout extends Component {
constructor(props) {
super(props)
Expand All @@ -29,15 +23,7 @@ class Layout extends Component {
render() {
return <div>
<header className={layoutStyles.header}>
<Link to='/' style={{ textShadow: `none`, backgroundImage: `none` }}>
<h3 style={{ display: `inline` }}>octokit/rest.js</h3>
</Link>

<ul style={{ listStyle: `none`, float: `right` }}>
<ListLink to='/'>Home</ListLink>
<ListLink to='/guides/'>Guides</ListLink>
<ListLink to='/api/'>API</ListLink>
</ul>
<h3 style={{ display: `inline` }}>octokit/rest.js</h3>

<StaticQuery
query={graphql`
Expand Down
177 changes: 0 additions & 177 deletions docs/src/pages/api.js

This file was deleted.

43 changes: 0 additions & 43 deletions docs/src/pages/guides.js

This file was deleted.

Loading

0 comments on commit 9adcb9f

Please sign in to comment.