<DocsPage> Component

We have a lot of docs sites, all of which render content in exactly the same way. This component is a minimal abstraction of that rendering, and is intended to be used entirely as a template for all documentation content.

Share
Code Editor
<DocsPage
product={{ name: 'Nomad', slug: 'nomad' }}
baseRoute='docs'
showVersionSelect={false /* process.env.ENABLE_VERSIONED_DOCS === "true" */}
// pass in the results of executing the 'generateStaticProps' function from '@hashicorp/react-docs-page/server'
staticProps={staticPropsResult}
>
<h2 class="g-type-display-3"><a class="__permalink-h" href="#agent" aria-label="agent permalink">»</a><a class="__target-h" id="agent" aria-hidden=""></a>Agent</h2><p>An agent is the long running daemon on every member of the Consul cluster. It is started by running <code>consul agent</code>. The agent is able to run in either <em>client</em> or <em>server</em> mode. Since all nodes must be running an agent, it is simpler to refer to the node as being either a client or server, but there are other instances of the agent. All agents can run the DNS or HTTP interfaces, and are responsible for running checks and keeping services in sync.</p><h2 class="g-type-display-3"><a class="__permalink-h" href="#client" aria-label="client permalink">»</a><a class="__target-h" id="client" aria-hidden=""></a>Client</h2><p>A client is an agent that forwards all RPCs to a server. The client is relatively stateless. The only background activity a client performs is taking part in the LAN gossip pool. This has a minimal resource overhead and consumes only a small amount of network bandwidth.</p>
</DocsPage>

Where it's used

0.x.x
Loading 0.x.x releases...
1.x.x
Loading 1.x.x releases...
2.x.x
Loading 2.x.x releases...
3.x.x
Loading 3.x.x releases...
4.x.x
Loading 4.x.x releases...
5.x.x
Loading 5.x.x releases...
6.x.x
Loading 6.x.x releases...
7.x.x
Loading 7.x.x releases...
8.x.x
Loading 8.x.x releases...
9.x.x
Loading 9.x.x releases...
10.x.x
Loading 10.x.x releases...
11.x.x
Loading 11.x.x releases...
12.x.x
Loading 12.x.x releases...
13.x.x
Loading 13.x.x releases...
14.x.x
Loading 14.x.x releases...
15.x.x
Loading 15.x.x releases...
16.x.x
Loading 16.x.x releases...
17.x.x
Loading 17.x.x releases...

Props

NameDescription
product*
string
The name and slug of the product this page is being rendered for. The slug is used for the Edit this page link.
Object contains nested props, see below:
product.name*
string
Human-readable proper case product name. Used for the page <title /> and og:site_name.
product.slug
string
A lower-case product identifier to pull in respective theme colors. The default is hashicorp blue.
Options: "hashicorp", "boundary", "consul", "nomad", "packer", "terraform", "vault", "vagrant", "waypoint"
baseRoute*
string
The path this page is rendering under, for example "docs" or "api-docs". Passed directly to the baseRoute prop of @hashicorp/react-docs-sidenav.
showEditPage
boolean
If true, an Edit this page link will appear on the bottom right of each page.
showVersionedDocs
boolean
If true, a version select option will be displayed. Defaults to process.env.ENABLE_VERSIONED_DOCS === "true"
additionalComponents
object
Object containing additional components to be made available within mdx pages. Uses the format { [key]: Component }, for example, { TestComponent: () => <p>hello world</p> }
staticProps*
object
Directly pass the return value of server/generateStaticProps in here.
Object contains nested props, see below:
staticProps.githubFileUrl
string
A link to the page's associated .mdx file on GitHub. Used for the Edit this page link.
staticProps.mdxSource*
object
Data returned from running next-mdx-remote/serialize on the page's .mdx file contents.
staticProps.frontMatter*
object
Frontmatter object parsed from the page's .mdx file.
Object contains nested props, see below:
staticProps.frontMatter.canonical_url
string
Optional canonical URL. Passed directly to @hashicorp/react-head.
staticProps.frontMatter.description*
string
Used for the <meta name="description" />. Passed directly to @hashicorp/react-head.
staticProps.frontMatter.page_title*
string
Used to construct the meta <title /> tag, then passed to @hashicorp/react-head.
staticProps.currentPath
string
Path to the current page, relative to the baseRoute. Used to highlight the current page.
staticProps.navData*
object
Tree of navigation data to render. See docs-sidenav/types.js for details.
staticProps.versions*
Array
Array of version options
Array members must be of the type below:
staticProps.versions[x]
object
Object contains nested props, see below:
staticProps.versions[x].name
string
A version’s programmatic value
staticProps.versions[x].label
string
A version’s human-friendly display value
algoliaConfig
object
Optional Algolia configuration to pass to the react-search component. If omitted, will default to .env variables. Any of the properties can be omitted, and will fall back to .env variables.
Object contains nested props, see below:
algoliaConfig.appId
string
The ID of the target Algolia application.
algoliaConfig.indexName
string
The name of the index to search.
algoliaConfig.searchOnlyApiKey
string
A publishable search-only API key that can access the provided application and index.