Skip to content

Commit b9167d9

Browse files
docs: Update compatible sources shortcode to link to source.md (#2919)
## Description Currently the shortcode linked to the _index.md which is an empty page. This fixes the above issue ## 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>
1 parent a01a15e commit b9167d9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.hugo/layouts/shortcodes/compatible-sources.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
{{/* Automatically identify the "Native" source (Grandparent _index.md, since this is strictly used inside tools/) */}}
2-
{{ $nativeSource := .Page.Parent.Parent }}
1+
{{/* Automatically identify the "Native" source (Grandparent source.md, since this is strictly used inside tools/) */}}
2+
{{ $nativeSource := .Page.Parent.Parent.GetPage "source.md" }}
3+
4+
{{ if not $nativeSource }}
5+
{{ $nativeSource = .Page.Parent.Parent.GetPage "source" }}
6+
{{ end }}
37

48
<div class="compatibility-section">
59
<p>This tool can be used with the following database sources:</p>
@@ -19,11 +23,13 @@
1923
{{ end }}
2024

2125
{{/* Process additional sources passed via the "others" parameter */}}
26+
2227
{{ $others := .Get "others" }}
2328
{{ if $others }}
2429
{{ range split $others "," }}
2530
{{ $path := trim . " " }}
26-
{{ $remotePage := site.GetPage $path }}
31+
{{ $cleanPath := trim $path "/" }}
32+
{{ $remotePage := site.GetPage (printf "%s/source.md" $cleanPath) }}
2733

2834
{{ if $remotePage }}
2935
<tr>
@@ -38,4 +44,4 @@
3844
{{ end }}
3945
</tbody>
4046
</table>
41-
</div>
47+
</div>

0 commit comments

Comments
 (0)