Skip to content

Commit

Permalink
test render string (#27168)
Browse files Browse the repository at this point in the history
* test render string

Signed-off-by: Brian Deutsch <[email protected]>

* just use prod bucket for now

Signed-off-by: Brian Deutsch <[email protected]>

* account for github images

Signed-off-by: Brian Deutsch <[email protected]>

---------

Signed-off-by: Brian Deutsch <[email protected]>
  • Loading branch information
bgdeutsch authored Jan 17, 2025
1 parent dae54c5 commit 3e87c8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions layouts/integrations/_markup/render-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
{{- $app_id := .Page.Params.integration_id | default .Page.Params.name -}}
{{- $img := replaceRE `(./)?images/` "" .Destination -}}
{{- $url := split $img "/" -}}
{{- $app_listings_bucket := cond (eq (hugo.Environment) "live") "dd-app-listings" "dd-app-listings-staging" -}}
{{- $app_listings_bucket := "dd-app-listings" -}}

{{- if eq (index $url 0) "integrations" -}}
{{- if strings.Contains .Destination "https://raw.githubusercontent.com" -}}
<img src="{{ (.Destination | safeURL) }}"
{{- with .PlainText }} alt="{{ . }}"{{ end -}}
{{- with .Title }} title="{{ . }}"{{ end -}}
>
{{- else if eq (index $url 0) "integrations" -}}
<img src="{{ (print site.Params.img_url "images/" (.Destination | safeURL)) }}"
{{- with .PlainText }} alt="{{ . }}"{{ end -}}
{{- with .Title }} title="{{ . }}"{{ end -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/site-region.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
{{.Inner}}
</div>
{{ else }}
<div class="d-none site-region-container" data-region="{{ $region }}"><p>{{- .Inner | markdownify -}}</p></div>
<div class="d-none site-region-container" data-region="{{ $region }}"><p>{{- .Inner | .Page.RenderString -}}</p></div>
{{ end }}

0 comments on commit 3e87c8f

Please sign in to comment.