Skip to content

Commit 2402eee

Browse files
authored
Introduce integration-api-key-picker shortcode for Integration docs (#35537)
* Introduce integration-api-key-picker custom shortcode for Integration docs * Use full domain in tile_url
1 parent 6e6671a commit 2402eee

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- $integration_id := .Page.Params.app_id -}}
2+
{{- $integration_title := .Page.Title -}}
3+
{{- $type := .Get "type" | default "url" -}}
4+
5+
{{- with .Get "id" }}{{ $integration_id = . }}{{ end -}}
6+
{{- with .Get "title" }}{{ $integration_title = . }}{{ end -}}
7+
8+
{{- if not $integration_id -}}
9+
{{ errorf "integration-api-key-picker shortcode error: No integration ID found. Set 'app_id' in page frontmatter or pass 'id' param. %s" .Position }}
10+
{{- end -}}
11+
12+
{{- $tile_url := printf "https://app.datadoghq.com/integrations/%s" $integration_id -}}
13+
14+
<div class="shortcode-wrapper shortcode-integration-api-key-picker">
15+
{{- if eq $type "api-key" -}}
16+
<p>Copy your Datadog API key from the <strong>Configure</strong> tab on the <a href="{{ $tile_url }}">{{ $integration_title }} integration tile</a>.</p>
17+
{{- else -}}
18+
<p>Copy the generated webhook URL from the <strong>Configure</strong> tab on the <a href="{{ $tile_url }}">{{ $integration_title }} integration tile</a>.</p>
19+
{{- end -}}
20+
</div>

0 commit comments

Comments
 (0)