Skip to content

Commit 2e550b1

Browse files
lannonbrDSchau
authored andcommitted
feat(docs): Stub List page (#12418)
## Description I implemented a new page in the contributing section of the docs to aggregate all of the stubbed files in a single location so people can see any available articles that yet have to be written at a quick glance. ![screenshot_2019-03-08 stub list gatsbyjs](https://user-images.githubusercontent.com/3685876/54048091-c0691700-41a6-11e9-8d92-689a258b5e3d.png) <!-- Write a brief description of the changes introduced by this PR --> ## Related Issues Closes #12362
1 parent b048d26 commit 2e550b1

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

docs/contributing/how-to-write-a-stub.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ If you create a stub or see an existing one on the Gatsby.js site and feel inter
2929

3030
To change a stub into a living-breathing document, remove the `issue` entry from a stub's frontmatter (a fancy name for Markdown metadata) and replace the boilerplate content with
3131
your wonderful prose and code. Save the file, commit to GitHub, open a PR, get feedback. Learn more in our page on [docs contributions](/contributing/docs-contributions/).
32+
33+
If you wish to see any of the available stubs, head over to the current [Stub List](/contributing/stub-list/).

www/src/data/sidebars/contributing-links.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
link: /contributing/docs-templates/
4040
- title: How to Write a Stub
4141
link: /contributing/how-to-write-a-stub/
42+
- title: Stub List
43+
link: /contributing/stub-list/
4244
- title: Blog & Website Contributions
4345
link: /contributing/blog-and-website-contributions/
4446
- title: Code Contributions
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import React from "react"
2+
import { Link } from "gatsby"
3+
import { Helmet } from "react-helmet"
4+
5+
import Layout from "../../components/layout"
6+
import {
7+
itemListContributing,
8+
itemListDocs,
9+
} from "../../utils/sidebar/item-list"
10+
import Container from "../../components/container"
11+
import DocsearchContent from "../../components/docsearch-content"
12+
13+
function findStubs(pages) {
14+
let stubs = []
15+
16+
pages.forEach(page => {
17+
if (page.items !== undefined) {
18+
// Recurse downwards
19+
stubs.push(...findStubs(page.items))
20+
}
21+
22+
if (page.link !== undefined && page.title.indexOf(`*`) !== -1) {
23+
// found a page which is a stub
24+
stubs.push(page)
25+
}
26+
})
27+
28+
return stubs
29+
}
30+
31+
class StubListRoute extends React.Component {
32+
render() {
33+
let allPages = [...itemListContributing, ...itemListDocs]
34+
35+
let stubs = findStubs(allPages)
36+
37+
return (
38+
<Layout location={this.props.location} itemList={itemListContributing}>
39+
<DocsearchContent>
40+
<Container>
41+
<Helmet>
42+
<title>Stub List</title>
43+
</Helmet>
44+
<h1 id="stublist" css={{ marginTop: 0 }}>
45+
Stub List
46+
</h1>
47+
<p>
48+
There are a variety of pages that are currently stubbed out but do
49+
not contain any content yet. If you are interested in helping
50+
write any of these pages, head to any of them or head over to{` `}
51+
<Link to="/contributing/how-to-write-a-stub/">
52+
How to Write a Stub
53+
</Link>
54+
{` `}
55+
to learn more.
56+
</p>
57+
<ul>
58+
{stubs.map(stub => (
59+
<li key={stub.title}>
60+
<Link to={stub.link}>{stub.title.slice(0, -1)}</Link>
61+
</li>
62+
))}
63+
</ul>
64+
</Container>
65+
</DocsearchContent>
66+
</Layout>
67+
)
68+
}
69+
}
70+
71+
export default StubListRoute

0 commit comments

Comments
 (0)