Skip to content

Commit 787e703

Browse files
committed
Add api-reference shortcode
1 parent 558f36c commit 787e703

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

layouts/shortcodes/api-reference.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{ $base := "docs/reference/kubernetes-api" }}
2+
{{ $pageArg := .Get "page" }}
3+
{{ $anchorArg := .Get "anchor" }}
4+
{{ $textArg := .Get "text" }}
5+
{{ $page := site.GetPage "page" (printf "%s/%s" $base $pageArg) }}
6+
{{ $metadata := $page.Params.api_metadata }}
7+
<a href="{{ $page.URL }}{{if $anchorArg}}#{{ $anchorArg }}{{end}}">{{if $textArg}}{{ $textArg }}{{else if $anchorArg}}{{ $anchorArg }}{{else}}{{ $metadata.kind }}{{end}}</a>

0 commit comments

Comments
 (0)