You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Display contributors at the bottom of every page (#67)
* Create contributors component
* Fix import
* Create PageFooter component
* Use correct pluralization of "contributors"
* Format the date
* Update page footer component
* Add comment about contributors array
* Get avatar url by login
* Fix page footer variable references
* Accept additional contributors through frontmatter
* Add error handling
* Check for latestCommit before rendering
* Add tests for the contributors component
* Run tests during CI
* Add test for page footer
* Add documentation
* Don't render duplicate contributors
* Reduce padding
Copy file name to clipboardExpand all lines: docs/content/getting-started/index.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
---
2
2
title: Getting started
3
+
additionalContributors:
4
+
- ashygee
5
+
- emplums
6
+
- shawnbot
3
7
---
4
8
5
9
This guide will walk you through creating, customizing, and deploying a new site with Doctocat using our [template repository](https://github.com/primer/doctocat-template). If you have an existing repository where you would like to create a new site, we recommend using the Gatsby CLI instead. Check out the [Gatsby CLI guide](/getting-started/gatsby-cli) for more information.
Here are a few ways you can customize your Doctocat site:
6
9
7
10
## Site metadata
@@ -66,6 +69,33 @@ module.exports = {
66
69
}
67
70
```
68
71
72
+
## Contributors
73
+
74
+
If you have the `repository` in `package.json` and `repoRootPath` in `gatsby-config.js` set up correctly (as described [above](#edit-on-github-link)), Doctocat will automatically display contributors on the bottom of every page, like so:
75
+
76
+
<BorderBox p={4} mb={3}>
77
+
<Contributors
78
+
contributors={[
79
+
{
80
+
login: 'colebemis',
81
+
latestCommit: {
82
+
url: '#',
83
+
date: '2019-08-15T23:40:19Z',
84
+
},
85
+
},
86
+
{
87
+
login: 'emplums',
88
+
latestCommit: {
89
+
url: '#',
90
+
date: '2019-08-14T00:19:54Z',
91
+
},
92
+
},
93
+
]}
94
+
/>
95
+
</BorderBox>
96
+
97
+
These contributors are determined by commits. However, we know that commits aren't the only way to contribute. You can use [front matter](/usage/front-matter#additional-contributors) to give credit to people who aren't listed in the commit history but still contributed.
98
+
69
99
## Hero
70
100
71
101
To add a hero section to a page, you'll need to override the default layout component with Doctocat's `HeroLayout` component by exporting it from your MDX file:
Copy file name to clipboardExpand all lines: docs/content/usage/front-matter.mdx
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,3 +48,15 @@ Doctocat comes with a few predefined statuses that have colors associated with t
48
48
Custom statuses will render a gray dot:
49
49
50
50
<StatusLabelstatus="My custom status" />
51
+
52
+
## Additional contributors
53
+
54
+
If you have the `repository` in `package.json` and `repoRootPath` in `gatsby-config.js` setup correctly (as desribed in the [customization](/usage/customization#contributors) guide), Doctocat will automatically display contributors on the bottom of every page. These contributors are determined by commits. However, we know that commits aren't the only way to contribute. To give credit to people who aren't listed in the commit history but still contributed, use the `additionalContributors` front matter variable to list their GitHub usernames, for example:
0 commit comments