Skip to content

Commit 8b5ebc6

Browse files
authored
docs: Bring/Setup documentation deployment for Federation from Server repo. (#158)
This brings the existing documentation and its supporting infrastructure (in this case, modeled after the Apollo Server repository, but this is standard "Apollo infrastructure" in the general sense) to the Federation repository where it can live alongside the code that was migrated over in #134. Related: #142 Related: #143
1 parent 2f799fa commit 8b5ebc6

23 files changed

+26079
-0
lines changed

docs/.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
Thumbs.db
3+
*.log
4+
node_modules/
5+
.deploy*/
6+
.cache
7+
public/

docs/.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12

docs/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Documentation
2+
3+
This is the documentation **source** for this repository.
4+
5+
The **deployed** version of the documentation for this repository is available at:
6+
7+
* https://www.apollographql.com/docs/apollo-server/
8+
9+
## Documentation for the documentation
10+
11+
This `README.md` is intentionally short since the [documentation for the documentation](https://docs-docs.netlify.com/docs/docs/) provides details for the documentation framework _itself_. Additional information should generally be added to that documentation rather than here in this `README.md`, in order to provide a centralized resource that benefits all documentation deployments.
12+
13+
## Running locally
14+
15+
For more information, consult the documentation for the documentation, referenced above.
16+
17+
In general though:
18+
19+
* `npm install` in this directory
20+
* `npm start` in this directory
21+
* Open a browser to the link provided in the console.
22+
23+
> **Important note:** Changes to the markdown source does not result in an automatic "hot reload" in the browser; it is necessary to reload the page manually in the browser to see it re-rendered. Additionally, changes to `_config.yml` require stopping the server and restarting with `npm start` again.
24+
25+
## Deploy previews
26+
27+
Documentation repositories should be setup with a "deploy preview" feature which automatically provides "preview" links in the _status checks_ section of pull-requests.
28+
29+
In the event that it's not possible to run the documentation locally, pushing changes to the branch for a pull-request can be a suitable alternative that ensures changes to the documentation are properly rendered.

docs/gatsby-config.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const themeOptions = require('gatsby-theme-apollo-docs/theme-options');
2+
3+
module.exports = {
4+
pathPrefix: '/docs/federation',
5+
plugins: [
6+
{
7+
resolve: 'gatsby-theme-apollo-docs',
8+
options: {
9+
...themeOptions,
10+
root: __dirname,
11+
subtitle: 'Apollo Federation',
12+
description: 'A guide to using Apollo Federation',
13+
githubRepo: 'apollographql/federation',
14+
sidebarCategories: {
15+
null: [
16+
'index',
17+
'implementing-services',
18+
'gateway',
19+
'entities',
20+
'value-types',
21+
'errors',
22+
'metrics',
23+
'migrating-from-stitching',
24+
'other-servers',
25+
'federation-spec',
26+
],
27+
'API Reference': [
28+
'api/apollo-federation',
29+
'api/apollo-gateway',
30+
],
31+
},
32+
},
33+
},
34+
],
35+
};

0 commit comments

Comments
 (0)