Repository for the gRPC website and documentation
Go to file
Patrice Chalin 11a258e215
grpc-docsy: move custom 404 page to submodule (#670)
This is a first contribution to #669
2021-02-22 14:42:43 -05:00
.github/ISSUE_TEMPLATE Issue template: drop title from blank template 2020-03-26 11:09:25 -04:00
archetypes More blog post cleanup 2020-03-10 11:36:12 -07:00
assets Community page, styles cleanup (#645) 2021-02-12 11:49:58 -05:00
content/en Community: update ecosystem prose (#663) 2021-02-22 12:20:15 -05:00
data Set min Node version to v8+, matching quick start (#593) 2021-01-14 11:38:31 -05:00
includes Rework Google-specific language (#167) 2020-07-07 15:35:56 -04:00
layouts grpc-docsy: move custom 404 page to submodule (#670) 2021-02-22 14:42:43 -05:00
static Wireshark blog post (#625) 2021-02-03 13:55:35 -05:00
themes grpc-docsy: move custom 404 page to submodule (#670) 2021-02-22 14:42:43 -05:00
.browerslistrc Adjust column width for main documentation text (#186) 2020-04-13 17:54:57 -04:00
.cspell.json Reworked community page (#638) 2021-02-08 13:56:14 -05:00
.editorconfig Convert contributing guide to Markdown 2020-03-09 16:01:17 -07:00
.gitignore README: list prerequisites and include step to run npm install (#189) 2020-04-14 17:25:12 -04:00
.gitmodules Use grpc-docsy branch from a forked docsy repo (#666) 2021-02-22 11:36:51 -05:00
.htmltest.external.yml Add link checker 2020-03-06 13:05:47 -08:00
.htmltest.yml Add link checker 2020-03-06 13:05:47 -08:00
.nvmrc Build config: upgrade Hugo and Node, and other cleanup (#629) 2021-02-05 11:17:01 -05:00
CODE-OF-CONDUCT.md Add GOVERNANCE.md, CODE-OF-CONDUCT.md and CONTRIBUTING.md 2019-09-26 15:56:15 -07:00
CONTRIBUTING.md Add GOVERNANCE.md, CODE-OF-CONDUCT.md and CONTRIBUTING.md 2019-09-26 15:56:15 -07:00
GOVERNANCE.md Add GOVERNANCE.md, CODE-OF-CONDUCT.md and CONTRIBUTING.md 2019-09-26 15:56:15 -07:00
LICENSE Add contents of new site repo 2019-04-22 18:07:24 -07:00
LICENSE-DOCS Add DOCS license file (#174) 2020-04-10 16:28:55 -04:00
MAINTAINERS.md Add MAINTAINERS file (#232) 2020-05-22 09:03:58 -04:00
Makefile Build config: upgrade Hugo and Node, and other cleanup (#629) 2021-02-05 11:17:01 -05:00
README.md Build config: upgrade Hugo and Node, and other cleanup (#629) 2021-02-05 11:17:01 -05:00
check_hugo.sh Ensure Hugo is properly installed 2020-03-18 13:23:50 -07:00
config.yaml Footer: add LF copyright, drop link to About (#661) 2021-02-19 11:02:13 -05:00
netlify.toml Build config: upgrade Hugo and Node, and other cleanup (#629) 2021-02-05 11:17:01 -05:00
package.json Config file cleanup (#656) 2021-02-16 14:59:26 -05:00
postcss.config.js Adjust column width for main documentation text (#186) 2020-04-13 17:54:57 -04:00

README.md

gRPC website

The grpc.io site, built using Hugo and hosted on Netlify.

Build prerequisites

1. Install the following tools

2. Clone this repo and its submodules

IMPORTANT: This repo has recursive git submodules, which affects how you clone it.

The simplest way to get a full copy of this repo is to clone the repo and its submodules at the same time by running this command from a command shell / window:

$ git clone --recurse-submodules https://github.com/grpc/grpc.io.git

3. Change directories

From this point on you'll be working from the grpc.io directory:

$ cd grpc.io

4. Did you get the submodules?

Forgetting to clone the submodules is a common error.

If you forgot the --recurse-submodules option when you ran the clone command given in step 2 above or, if you cloned the repo using another method, as described in Cloning a repository, then you'll need to fetch the repo's submodules.

To (recursively) fetch the submodules, run the following command from the grpc.io directory:

$ git submodule update --init --recursive --depth 1

NOTE: Unsure if you've fetched the submodules? The Git command above is idempotent, so you can safely (re-)run it -- if you already have the submodules, it will have no effect.

5. Run installation scripts

Install NPM packages:

$ npm install

Build the site

Run the following command to have Hugo generate the site files:

$ hugo

The public folder contains the generated site.

Serve the site locally

To locally serve this site, use one of the following commands.

Note: Hugo serves pages from memory by default, so if you want to (re-)generate the website files to disk, use the build command above.

a) Serve using Hugo via make

$ make serve
hugo server
Start building sites …
...
Environment: "development"
Serving pages from memory
...
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

This generates unminified site pages. Other Makefile targets include the following:

  • serve-drafts to also serve draft and future pages
  • serve-production to server files exactly as they'll appear in production

b) Serve using Netlify dev

Netlify dev uses Hugo under the hood to serve the site, but it also creates a proxy (at port 8888 by default), to handle site redirects:

$ npx netlify dev

If you also want to serve draft and future pages use this command:

$ npx netlify dev -c "hugo serve -DFw"

Site deploys and PR previews

Commits to the main branch are automatically published by Netlify. You can see deploy logs and more from the Netlify gRPC Team dashboard, provided you have the necessary permissions.

PR previews are automatically built by Netlify as well. By default, a PR preview is identical to a production build.

If you want draft and future pages to also appear in a PR preview, then make sure that the word "draft" appears in the branch name used to create the PR.

You can check the site's internal links by running this command:

$ make check-internal-links

This deletes the generated public directory, builds the "production" version of the site, and verifies that internal links are valid. Please note that internal links prefixed with /grpc do not work in your local environment (there are redirects applied by Netlify). Any errors returned from /grpc links are false negatives that you can ignore.