Repository for the gRPC website and documentation
Go to file
Patrice Chalin 8e3829978b
Address grpc-community master to main branch rename (#723)
2021-03-11 19:58:24 -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 SCSS: use styles_project.scss rather than edit Docsy's main.scss (#704) 2021-03-05 19:43:46 -05:00
content/en Address grpc-community master to main branch rename (#723) 2021-03-11 19:58:24 -05:00
data Kotlin pages: drop /JVM qualifier (#712) 2021-03-09 16:50:58 -05:00
includes Rework Google-specific language (#167) 2020-07-07 15:35:56 -04:00
layouts Footer: link to Terms, Privacy, License, etc (#716) 2021-03-11 15:01:06 -05:00
static Wireshark blog post (#625) 2021-02-03 13:55:35 -05:00
themes Docsy merge of google:master@e2f5b4f (#711) 2021-03-09 11:42:21 -05:00
.browerslistrc Adjust column width for main documentation text (#186) 2020-04-13 17:54:57 -04:00
.cspell.json Fix the relative import order of variables and variables_project (#702) 2021-03-05 17:21:27 -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 Switch to grpc/grpc.io-docsy (#710) 2021-03-09 11:06:10 -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 Address grpc-community master to main branch rename (#723) 2021-03-11 19:58:24 -05:00
GOVERNANCE.md Address grpc-community master to main branch rename (#723) 2021-03-11 19:58:24 -05:00
LICENSE Use a single LICENSE file (#717) 2021-03-11 16:23:47 -05:00
MAINTAINERS.md Address grpc-community master to main branch rename (#723) 2021-03-11 19:58:24 -05:00
Makefile Build tweaks now that we're using hugo.IsProduction (#679) 2021-02-23 17:40:38 -05:00
README.md README: fix nvm name 2021-03-11 15:05:13 -05:00
check_hugo.sh Ensure Hugo is properly installed 2020-03-18 13:23:50 -07:00
config.yaml Footer: link to Terms, Privacy, License, etc (#716) 2021-03-11 15:01:06 -05:00
netlify.toml Upgrade to Hugo 0.81.0 (#683) 2021-02-24 12:27:54 -05:00
package.json Docsy merge of google:master@e2f5b4f (#711) 2021-03-09 11:42:21 -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.