Skip to content

Commit 837047b

Browse files
dishaprakashgemini-code-assist[bot]Yuan325
authored
docs: Add prebuilt configs under integrations and add migration banner (#2857)
## Description This PR : - Splits the complete list of prebuilt configs adds the config specific each source under the `integrations/` section. - A shortcode has been added to link these files in the `documentation/configuration/prebuilt-configs/_index.md` - Adds migration banner to redirect users to new url - Adds documentation for contributors on file structure for both samples and prebuilt configs ## PR Checklist > Thank you for opening a Pull Request! Before submitting your PR, there are a > few things you can do to make sure it goes smoothly: - [x] Make sure you reviewed [CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md) - [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) - [x] Make sure to add `!` if this involve a breaking change 🛠️ Fixes #<issue_number_goes_here> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
1 parent 4ea11ff commit 837047b

File tree

68 files changed

+1321
-879
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1321
-879
lines changed

.hugo/hugo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ ignoreFiles = ["quickstart/shared", "quickstart/python", "quickstart/js", "quick
3737
github_subdir = "docs"
3838
offlineSearch = false
3939
version_menu = "Releases"
40-
disableMigrationBanner = true
4140
releases_url = "/genai-toolbox/releases.releases"
4241
global_logo_url = "/genai-toolbox/"
4342
version = "dev"
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{{ $integrations := site.GetPage "section" "integrations" }}
2+
3+
<div class="db-index-list">
4+
{{/*Loop through all database folders alphabetically */}}
5+
{{ range $integrations.Pages.ByTitle }}
6+
{{ $db := . }}
7+
{{/* Only render a row if this database has a 'prebuilt-configs' folder */}}
8+
{{ with $db.GetPage "prebuilt-configs" }}
9+
{{ $displayTitle := $db.Title }}
10+
{{ $targetLink := .RelPermalink }}
11+
{{ $displayDesc := .Description | default (printf "Explore prebuilt configurations for %s." $db.Title) }}
12+
13+
<a href="{{ $targetLink }}" class="db-index-row">
14+
<div class="db-index-content">
15+
<div class="db-index-header">
16+
<span class="db-index-title">{{ $displayTitle }}</span>
17+
<svg class="db-index-arrow" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
18+
<line x1="5" y1="12" x2="19" y2="12"></line>
19+
<polyline points="12 5 19 12 12 19"></polyline>
20+
</svg>
21+
</div>
22+
<div class="db-index-desc">{{ $displayDesc | plainify | truncate 120 }}</div>
23+
</div>
24+
</a>
25+
{{ end }}
26+
{{ end }}
27+
</div>
28+
29+
<style>
30+
.db-index-list {
31+
display: flex;
32+
flex-direction: column;
33+
margin-top: 2rem;
34+
margin-bottom: 3rem;
35+
border-top: 1px solid rgba(0, 0, 0, 0.08);
36+
}
37+
38+
.db-index-row {
39+
padding: 1.25rem 0;
40+
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
41+
text-decoration: none !important;
42+
display: block;
43+
background: transparent;
44+
transition: all 0.2s ease;
45+
}
46+
47+
.db-index-row:hover .db-index-title {
48+
color: #4484f4;
49+
}
50+
51+
.db-index-row:hover .db-index-arrow {
52+
opacity: 1;
53+
transform: translateX(0);
54+
color: #4484f4;
55+
}
56+
57+
.db-index-header {
58+
display: flex;
59+
justify-content: space-between;
60+
align-items: center;
61+
margin-bottom: 0.3rem;
62+
}
63+
64+
.db-index-title {
65+
font-size: 1.1rem;
66+
font-weight: 600;
67+
color: #202124;
68+
transition: color 0.2s ease;
69+
}
70+
71+
.db-index-arrow {
72+
opacity: 0;
73+
transform: translateX(-10px);
74+
color: #5f6368;
75+
transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
76+
}
77+
78+
.db-index-desc {
79+
font-size: 0.95rem;
80+
color: #5f6368;
81+
line-height: 1.5;
82+
padding-right: 2rem;
83+
}
84+
85+
/* Dark Mode Adjustments */
86+
html[data-bs-theme="dark"] .db-index-list,
87+
body.dark .db-index-list { border-top-color: rgba(255, 255, 255, 0.1); }
88+
89+
html[data-bs-theme="dark"] .db-index-row,
90+
body.dark .db-index-row { border-bottom-color: rgba(255, 255, 255, 0.1); }
91+
92+
html[data-bs-theme="dark"] .db-index-title,
93+
body.dark .db-index-title { color: #e8eaed; }
94+
95+
html[data-bs-theme="dark"] .db-index-desc,
96+
body.dark .db-index-desc { color: #9aa0a6; }
97+
98+
html[data-bs-theme="dark"] .db-index-row:hover .db-index-title,
99+
html[data-bs-theme="dark"] .db-index-row:hover .db-index-arrow { color: #8ab4f8; }
100+
</style>

DEVELOPER.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,13 @@ When updating documentation, you must adhere to the structural constraints enfor
267267
* If a new database inherits tools from a base integration (like Cloud SQL inheriting Postgres tools), create the `tools/` directory with an `_index.md` file.
268268
* Map the inherited tools dynamically by adding the `shared_tools` YAML array to the frontmatter of this `tools/_index.md` file. **This file must strictly contain only frontmatter.**
269269
* **Adding Samples:**
270-
* Samples are distributed across the site and aggregated visually via the "Samples Hub". Place your sample based on its scope:
271-
1. **Quickstarts:** Place in `docs/en/documentation/getting-started/quickstart/`.
272-
2. **Database-Specific samples:** Place in `docs/en/integrations/<newdb>/samples/`. Make sure to include a `samples/_index.md` wrapper that contains **only frontmatter**.
273-
3. **General/Cross- samples:** Place directly in `docs/en/samples/`.
274-
* Ensure appropriate **frontmatter tags (`sample_filters`, `is_sample`)** are added so the UI Gallery filters can index them.
270+
* **Physical Location:**
271+
1. **Quickstarts:** `docs/en/documentation/getting-started/quickstart/`.
272+
2. **Integration-Specific:** `docs/en/integrations/<db>/samples/`. Must include an `_index.md` with strictly only frontmatter.
273+
3. **General:** `docs/en/samples/`.
274+
* **Frontmatter Requirements (Maintenance):** To ensure samples appear correctly in the Samples Section, you must provide the following tags:
275+
* `is_sample: true` - Required for indexing.
276+
* `sample_filters:` - A YAML array used for UI filtering (e.g., `[postgres, go, sql]`).
275277
* **Adding Top-Level Sections:** If you add a completely new top-level documentation directory (e.g., a new section alongside `integrations`, `documentation`), you **must** update the AI documentation layout files located at `.hugo/layouts/index.llms.txt` and `.hugo/layouts/index.llms-full.txt`. Specifically, update the "Diátaxis Narrative Framework" preamble so AI models understand the purpose of your new section.
276278
277279
#### Adding Prebuilt Tools
@@ -498,6 +500,14 @@ When adding or updating a Tool page, your markdown file must strictly adhere to
498500
* **Allowed Optional Headings:** `Compatible Sources`, `Requirements`, `Parameters`, `Output Format`, `Reference`, `Advanced Usage`, `Troubleshooting`, `Additional Resources`
499501
* **Compatible Sources Shortcode:** If you include the `## Compatible Sources` heading, you must place the compatible-sources shortcode (e.g., `{{< compatible-sources >}}`) directly beneath it.
500502
503+
#### Prebuilt Configuration Structure (`integrations/**/prebuilt-configs/*.md`)
504+
505+
To ensure new prebuilt configurations are automatically indexed by the `{{< list-prebuilt-configs >}}` shortcode on the main Prebuilt Configs page, follow these rules:
506+
507+
* **Location:** Always place documentation for prebuilt configurations in a nested directory named `prebuilt-configs/` inside the database folder (e.g., `docs/en/integrations/alloydb/prebuilt-configs/`).
508+
* **Index Wrapper:** Every `prebuilt-configs/` directory must contain an `_index.md` file. This file acts as the anchor for the directory and must contain the `title` and `description` used in the automated lists.
509+
* **Architecture-Based Mapping:** Map configurations to database folders based on the `kind` defined in the tool's YAML file (in `internal/prebuiltconfigs/tools/`). For example, any tool using the `postgres` kind should live in the `postgres/` integration directory.
510+
501511
#### Frontend Assets & Layouts
502512
503513
If you need to modify the visual appearance, navigation, or behavior of the documentation website itself, all frontend assets are isolated within the `.hugo/` directory.

GEMINI.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,25 @@ When generating or editing documentation for this repository, you must strictly
161161
5. **Shortcode Placement:** If you generate the `## Compatible Sources` section, you must include the `{{< compatible-sources >}}` shortcode beneath it.
162162

163163
##### Samples Architecture Constraints
164-
Sample code is aggregated visually in the UI via the Samples section, but the physical markdown files are distributed logically based on their scope. When adding samples, use the correct location and apply proper frontmatter tags (`sample_filters`, `is_sample`) are added so the UI Gallery filters can index them.for the gallery filtering:
164+
Sample code is aggregated visually in the UI via the Samples section, but the physical markdown files are distributed logically based on their scope.
165165
1. **Quickstarts:** `docs/en/documentation/getting-started/`
166166
2. **Integration-Specific Samples:** `docs/en/integrations/<source_name>/samples/`. (The `samples/_index.md` wrapper must contain **strictly only frontmatter**).
167167
3. **General/Cross-Category Samples:** `docs/en/samples/`
168168

169+
##### Samples Maintenance Rules
170+
171+
1. **Filtering:** Always include `sample_filters` in the frontmatter. Use specific tags for:
172+
* Data Source (e.g., `bigquery`, `alloydb`)
173+
* Language (e.g., `python`, `js`, `go`)
174+
* Tool Type (e.g., `mcp`, `sdk`)
175+
2. **Metadata:** Ensure `is_sample: true` is present to prevent the sample from being excluded from the Samples Gallery.
176+
177+
##### Prebuilt Config Constraints (`integrations/**/prebuilt-configs/*.md`)
178+
179+
1. **Naming & Path:** All prebuilt config docs must reside in `prebuilt-configs/`.
180+
2. **Shortcode Requirement:** The main `documentation/configuration/prebuilt-configs/_index.md` page uses the `{{< list-prebuilt-configs >}}` shortcode, which only detects directories named exactly `prebuilt-configs`.
181+
3. **YAML Mapping:** Always verify the `kind` of the data source in `internal/prebuiltconfigs/tools/` before choosing the integration folder.
182+
169183

170184
##### Asset Constraints (`docs/`)
171185

0 commit comments

Comments
 (0)