mirror of
https://github.com/upstash/context7.git
synced 2026-09-14 19:09:34 +08:00
113 lines
3.4 KiB
Plaintext
113 lines
3.4 KiB
Plaintext
---
|
|
title: Docs7 configuration
|
|
description: Configure Docs7-only fields in docs.json
|
|
---
|
|
|
|
Docs7 supports the `docs.json` format that was established by Mintlify. We also support options beyond this spec to make your documentation easier to navigate and to create custom content groups.
|
|
|
|
|
|
|
|
## Group products
|
|
|
|
Product groups add a product switcher to the sidebar. A reader picks a product, and the sidebar shows only the pages for that product.
|
|
|
|
<Frame caption="Before a reader picks a product, the sidebar lists the tab's own pages and every product group.">
|
|
<img
|
|
src="/images/docs7/product-groups.png"
|
|
alt="Docs7 sidebar showing the Products and Utility Tools product groups"
|
|
/>
|
|
</Frame>
|
|
|
|
<Frame caption="After picking Redis, the sidebar shows only Redis pages. The dropdown at the top switches products.">
|
|
<img
|
|
src="/images/docs7/product-groups-selected.png"
|
|
alt="Docs7 sidebar with Redis selected in the product switcher"
|
|
/>
|
|
</Frame>
|
|
|
|
To set this up, add a `productGroups` list to one tab. That tab shows the product switcher. The tab's own pages fill the sidebar until the reader picks a product. Each product then lists its own pages. If your docs have several versions or languages, add the list to one tab in each of them.
|
|
|
|
```json docs.json
|
|
{
|
|
"navigation": {
|
|
"tabs": [
|
|
{
|
|
"tab": "Documentation",
|
|
"pages": ["index"],
|
|
"productGroups": [
|
|
{
|
|
"group": "Products",
|
|
"products": [
|
|
{
|
|
"product": "Redis",
|
|
"icon": "/images/redis.svg",
|
|
"description": "Serverless Redis",
|
|
"pages": ["redis/overview", "redis/get-started"]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"group": "Utility",
|
|
"products": [
|
|
{
|
|
"product": "Rate Limit",
|
|
"pages": ["ratelimit/overview", "ratelimit/get-started"]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"tab": "API Reference",
|
|
"pages": ["api/introduction"]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
```
|
|
|
|
In this example:
|
|
|
|
- The Documentation tab shows the product switcher. Until the reader picks a product, the sidebar shows the index page.
|
|
- Redis and Rate Limit are the two products. Each one lists the pages that appear when it is selected.
|
|
- The API Reference tab is a normal tab and does not use product groups.
|
|
|
|
Rules:
|
|
|
|
- Each product needs either a list of pages or a list of groups, not both.
|
|
- That list must have at least one entry.
|
|
- Inside one tab, product names must be unique, and group names must be unique.
|
|
|
|
If you do not add product groups, Docs7 uses your regular navigation.
|
|
|
|
## Enable sidebar filtering
|
|
|
|
Set `filterSidebar` to `true` to add a filter above the sidebar. Readers can press `/` to focus it.
|
|
|
|
```json docs.json
|
|
{
|
|
"filterSidebar": true
|
|
}
|
|
```
|
|
|
|
<Frame caption="The filter box sits above the sidebar. Typing in it narrows the sidebar to matching pages.">
|
|
<img
|
|
src="/images/docs7/filter-sidebar.png"
|
|
alt="Docs7 sidebar with the filter box above the page list"
|
|
/>
|
|
</Frame>
|
|
|
|
The default value is `false`.
|
|
|
|
## Show Docs7 attribution
|
|
|
|
Set `poweredByDocs7` to `true` to add a **Built with Docs7** link to the footer. The link opens [the Docs7 page](https://context7.com/docs7).
|
|
|
|
```json docs.json
|
|
{
|
|
"poweredByDocs7": true
|
|
}
|
|
```
|
|
|
|
The default value is `false`. Docs7 always shows this link for sites on the Free plan.
|