Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions config/_default/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ environment: default
# do not delete repo_name, used by websites-modules as context
repo_name: "documentation"
integrations_img_url: "https://static.datadoghq.com/static/images/logos/"
imgix:
header_jpg: "?ch=Width&fit=max&fm=jpg&auto=format&lossless=true"
header_png: "?ch=Width&fit=max&fm=png&auto=format&lossless=1"
header_gif: "?ch=Width,Save-Data&fm=gif"
img:
header_jpg: "?fit=max&fm=jpg&auto=format&lossless=true"
header_png: "?fit=max&fm=png&auto=format&lossless=1"
header_gif: "?fm=gif"
jpg: "?fm=jpg&auto=format&lossless=true"
png: "?fm=png&auto=format&lossless=1"
gif: ""
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/img.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{ if .img_param }}
{{ .root.Scratch.Set "img_param" .img_param }}
{{ else }}
{{ .root.Scratch.Set "img_param" "?ch=Width,DPR&fit=max" }}
{{ .root.Scratch.Set "img_param" "?fit=max" }}
{{ end }}
{{ $img_param := .root.Scratch.Get "img_param" }}

Expand Down
12 changes: 6 additions & 6 deletions layouts/partials/nav/left-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
{{ $url_without_anchor = (index (split .URL "#") 0) }}
<a href="{{ .URL | relLangURL }}" data-path="{{ trim (print $branchPath ((print $url_without_anchor) | relLangURL)) "/" }}" data-skip="{{ .Params.skip | not | not }}">
{{ if .Pre }}
{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) ".png") "class" "static" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21") -}}
{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) "_p.png") "class" "hover" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21" "disable_lazy" "true") -}}
{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) ".png") "class" "static" "alt" "icon" "width" "21" "img_param" "?fit=max&auto=format&w=21") -}}
{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) "_p.png") "class" "hover" "alt" "icon" "width" "21" "img_param" "?fit=max&auto=format&w=21" "disable_lazy" "true") -}}
{{ end }}
<span>{{ .Name }}</span>
</a>
Expand All @@ -60,8 +60,8 @@
{{ $url_without_anchor = (index (split .URL "#") 0) }}
<a href="{{ .URL | relLangURL }}" data-type="{{- with site.GetPage .URL -}}{{- .Type -}}{{- end -}}" data-path="{{ trim (print $branchPath ((print $url_without_anchor) | relLangURL)) "/" }}" data-skip="{{ .Params.skip | not | not }}">
{{ if .Pre }}
{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) ".png") "class" "static" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21") -}}
{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) "_p.png") "class" "hover" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21" "disable_lazy" "true") -}}
{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) ".png") "class" "static" "alt" "icon" "width" "21" "img_param" "?fit=max&auto=format&w=21") -}}
{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) "_p.png") "class" "hover" "alt" "icon" "width" "21" "img_param" "?fit=max&auto=format&w=21" "disable_lazy" "true") -}}
{{ end }}
<span>{{ .Name }}</span>
</a>
Expand All @@ -77,8 +77,8 @@
{{ $url_without_anchor = (index (split .URL "#") 0) }}
<a data-name="{{- delimit (last 1 (split (strings.TrimSuffix "/" .URL) "/")) "" -}}" href="{{ .URL | relLangURL }}" data-path="{{ trim (print $branchPath ((print $url_without_anchor) | relLangURL)) "/" }}" data-skip="{{ .Params.skip | not | not }}">
{{ if .Pre }}
{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) ".png") "class" "static" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21") -}}
{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) "_p.png") "class" "hover" "alt" "icon" "width" "21" "img_param" "?ch=Width,DPR&fit=max&auto=format&w=21" "disable_lazy" "true") -}}
{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) ".png") "class" "static" "alt" "icon" "width" "21" "img_param" "?fit=max&auto=format&w=21") -}}
{{- partial "img.html" (dict "root" $ctx "src" (print "icons/" (.Pre) "_p.png") "class" "hover" "alt" "icon" "width" "21" "img_param" "?fit=max&auto=format&w=21" "disable_lazy" "true") -}}
{{ end }}
<span>{{ .Name }}</span>
</a>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/platforms/platforms.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h3>{{ i18n "agent_started_sentence" }}</h3>
<a class="card" href="{{ .link | absLangURL }}">
<div class="card-body text-center">
{{ $src := (print "icons/" .image)}}
{{ $url := (print ($dot.Site.Params.img_url) "images/" $src "?ch=Width,DPR&fit=max&auto=format") | safeURL }}
{{ $url := (print ($dot.Site.Params.img_url) "images/" $src "?fit=max&auto=format") | safeURL }}
<picture class="mx-auto">
<source srcset="{{ $url }}&w=138 1x, {{ $url }}&w=138&dpr=2 2x" media="(min-width: 1200px)">
<source srcset="{{ $url }}&w=108 1x, {{ $url }}&w=108&dpr=2 2x" media="(min-width: 992px)">
Expand Down
21 changes: 10 additions & 11 deletions layouts/shortcodes/img.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
{{- $image_type_arr := split (.Get "src") "." -}}
{{- $image_ext := index $image_type_arr 1 -}}
{{- if $wide -}}
{{- $.Scratch.Set "imgix_w" "1170" -}}
{{- $.Scratch.Set "img_w" "1170" -}}
{{- else -}}
{{- $.Scratch.Set "imgix_w" "850" -}}
{{- $.Scratch.Set "img_w" "850" -}}
{{- end -}}
{{- $imgix_w := $.Scratch.Get "imgix_w" -}}
{{- $img_w := $.Scratch.Get "img_w" -}}
{{- if .Get "img_param" | len -}}
{{- .Get "img_param" | $.Scratch.Add "img_param" -}}
{{- else -}}
{{- $.Scratch.Add "img_param" (printf "?ch=Width,DPR&fit=max") -}}
{{- $.Scratch.Add "img_param" (printf "?fit=max") -}}
{{- end -}}
{{- if .Get "pop_param" | len -}}
{{- .Get "pop_param" | $.Scratch.Add "pop_param" -}}
Expand All @@ -42,7 +42,8 @@
{{- $img_param := $.Scratch.Get "img_param" -}}
{{- $pop_param := $.Scratch.Get "pop_param" -}}
{{- $figure_class := .Get "figure_class" -}}
{{ $e := (print $img_resource "?auto=format" | safeURL) }}
{{- $e := (print $img_resource "?auto=format&fit=max&w=" $img_w | safeURL) -}}
{{- $e2x := (print $img_resource "?auto=format&fit=max&w=" $img_w "&dpr=2" | safeURL) -}}
{{- if not (eq $img_inline "true")}}
<div class="shortcode-wrapper shortcode-img expand {{- if $wide -}}wide-parent{{- end -}}"><figure class="text-center {{- if $wide -}}wide {{- end -}}{{ $figure_class -}}" {{- if .Get "figure_style" -}}style="{{- with .Get "figure_style" -}}{{- . | safeCSS -}}{{- end -}}"{{- end -}}>
{{- if $video -}}
Expand All @@ -66,23 +67,21 @@
{{- if .Get "target" -}}target="{{- with .Get "target" -}}{{- . -}}{{- end -}}"{{- end -}} >
{{- end -}}
{{- if $wide -}}
{{ $e := (print $img_resource "?auto=format" safeURL) }}
{{- if eq $image_ext "gif" -}}
<img class="img-fluid" src="{{ (print $img_resource | safeURL) }}" {{ if .Get "style" }} style="{{ with .Get "style" }}{{ . | safeCSS }}{{end}}" {{ end }} {{ if .Get "alt" }} alt="{{ with .Get "alt"}}{{ . }}{{ end }}" {{ end }} />
{{- else -}}
<picture {{ if .Get "style" }} style="{{- with .Get "style" -}}{{- . | safeCSS -}}{{- end -}}" {{ end }}>
<img class="img-fluid" srcset="{{ $e }}" {{ if .Get "style" }} style="{{ with .Get "style" }}{{ . | safeCSS }}{{end}}" {{ end }} {{ if .Get "alt" }} alt="{{ with .Get "alt"}}{{ . }}{{ end }}" {{ end }} />
<img class="img-fluid" srcset="{{ $e }} 1x, {{ $e2x }} 2x" {{ if .Get "style" }} style="{{ with .Get "style" }}{{ . | safeCSS }}{{end}}" {{ end }} {{ if .Get "alt" }} alt="{{ with .Get "alt"}}{{ . }}{{ end }}" {{ end }} />
</picture>
{{- end -}}
{{- else -}}
{{ $e := (print $img_resource "?auto=format" | safeURL) }}
{{- if eq $image_ext "gif" -}}
<img class="img-fluid" src="{{ (print $img_resource | safeURL) }}" {{ if .Get "style" }} style="{{- with .Get "style" -}}{{ . | safeCSS }}{{- end -}}" {{ end }} {{ if .Get "alt" }} alt="{{- with .Get "alt" -}}{{.}}{{- end -}}" {{ end }} />
{{- else -}}
<picture class="" {{ if .Get "style" }} style="{{- with .Get "style" -}}{{- . | safeCSS -}}{{- end -}}" {{ end }} >
<img
class="img-fluid"
srcset="{{ $e }}"
srcset="{{ $e }} 1x, {{ $e2x }} 2x"
{{ if .Get "style" }}style="{{ with .Get "style" }}{{ . | safeCSS }}{{ end }}" {{ end }}
{{- with $img_width -}} width="{{ . }}" {{- end -}}
{{- with $img_height -}} height="{{ . }}" {{- end -}}
Expand All @@ -104,8 +103,8 @@
</figure>
</div>
{{- else -}}
<img
srcset="{{ $e }}"
<img
srcset="{{ $e }} 1x, {{ $e2x }} 2x"
{{ if .Get "style" }}style="{{ with .Get "style" }}{{ . | safeCSS }}{{ end }}" {{ end }}
{{- with $img_width -}} width="{{ . }}" {{- end -}}
{{- with $img_height -}} height="{{ . }}" {{- end -}} />
Expand Down
12 changes: 6 additions & 6 deletions layouts/shortcodes/tile-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="card-deck">
<a class="card agent" href="{{ "agent/" | absLangURL }}">
<div class="card-body text-center">
{{ $url := (print (.Site.Params.img_url) "images/icons/agent.png" "?ch=Width,DPR&fit=max&auto=format") | safeURL }}
{{ $url := (print (.Site.Params.img_url) "images/icons/agent.png" "?fit=max&auto=format") | safeURL }}
<picture class="mx-auto">
<source srcset="{{ $url }}&w=80 1x, {{ $url }}&w=80&dpr=2 2x" media="(min-width: 576px)">
<source srcset="{{ $url }}&w=47 1x, {{ $url }}&w=47&dpr=2 2x" media="(min-width: 0px)">
Expand All @@ -15,7 +15,7 @@
</a>
<a class="card integrations" href="{{ "integrations/" | absLangURL }}">
<div class="card-body text-center">
{{ $url := (print (.Site.Params.img_url) "images/icons/integrations.png" "?ch=Width,DPR&fit=max&auto=format") | safeURL }}
{{ $url := (print (.Site.Params.img_url) "images/icons/integrations.png" "?fit=max&auto=format") | safeURL }}
<picture class="mx-auto">
<source srcset="{{ $url }}&w=80 1x, {{ $url }}&w=80&dpr=2 2x" media="(min-width: 576px)">
<source srcset="{{ $url }}&w=47 1x, {{ $url }}&w=47&dpr=2 2x" media="(min-width: 0px)">
Expand All @@ -28,7 +28,7 @@
<div class="w-100 d-none d-sm-block d-md-none"><!-- wrap every 2 on sm--></div>
<a class="card graphing" href="{{ "graphing/" | absLangURL }}">
<div class="card-body text-center">
{{ $url := (print (.Site.Params.img_url) "images/icons/graphing.png" "?ch=Width,DPR&fit=max&auto=format") | safeURL }}
{{ $url := (print (.Site.Params.img_url) "images/icons/graphing.png" "?fit=max&auto=format") | safeURL }}
<picture class="mx-auto">
<source srcset="{{ $url }}&w=80 1x, {{ $url }}&w=80&dpr=2 2x" media="(min-width: 576px)">
<source srcset="{{ $url }}&w=47 1x, {{ $url }}&w=47&dpr=2 2x" media="(min-width: 0px)">
Expand All @@ -43,7 +43,7 @@
<div class="w-100 d-none d-xl-block"><!-- wrap every 3 on xl--></div>
<a class="card alerting" href="{{ "monitoring/" | absLangURL }}">
<div class="card-body text-center">
{{ $url := (print (.Site.Params.img_url) "images/icons/alerting.png" "?ch=Width,DPR&fit=max&auto=format") | safeURL }}
{{ $url := (print (.Site.Params.img_url) "images/icons/alerting.png" "?fit=max&auto=format") | safeURL }}
<picture class="mx-auto">
<source srcset="{{ $url }}&w=80 1x, {{ $url }}&w=80&dpr=2 2x" media="(min-width: 576px)">
<source srcset="{{ $url }}&w=47 1x, {{ $url }}&w=47&dpr=2 2x" media="(min-width: 0px)">
Expand All @@ -56,7 +56,7 @@
<div class="w-100 d-none d-sm-block d-md-none"><!-- wrap every 2 on sm--></div>
<a class="card tracing" href="{{ "tracing/" | absLangURL }}">
<div class="card-body text-center">
{{ $url := (print (.Site.Params.img_url) "images/icons/tracing_apm.png" "?ch=Width,DPR&fit=max&auto=format") | safeURL }}
{{ $url := (print (.Site.Params.img_url) "images/icons/tracing_apm.png" "?fit=max&auto=format") | safeURL }}
<picture class="mx-auto">
<source srcset="{{ $url }}&w=80 1x, {{ $url }}&w=80&dpr=2 2x" media="(min-width: 576px)">
<source srcset="{{ $url }}&w=47 1x, {{ $url }}&w=47&dpr=2 2x" media="(min-width: 0px)">
Expand All @@ -68,7 +68,7 @@
</a>
<a class="card developers" href="{{ "developers/" | absLangURL }}">
<div class="card-body text-center">
{{ $url := (print (.Site.Params.img_url) "images/icons/developers.png" "?ch=Width,DPR&fit=max&auto=format") | safeURL }}
{{ $url := (print (.Site.Params.img_url) "images/icons/developers.png" "?fit=max&auto=format") | safeURL }}
<picture class="mx-auto">
<source srcset="{{ $url }}&w=80 1x, {{ $url }}&w=80&dpr=2 2x" media="(min-width: 576px)">
<source srcset="{{ $url }}&w=47 1x, {{ $url }}&w=47&dpr=2 2x" media="(min-width: 0px)">
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/vimeo.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ $posterImg := "" }}

{{- if .Get "poster" -}}
{{ $posterImg = (print (.Site.Params.img_url) (.Get "poster") "?ch=Width,DPR,Save-Data&auto=format,compress&fit=clip&w=1200") | safeURL }}
{{ $posterImg = (print (.Site.Params.img_url) (.Get "poster") "?auto=format,compress&fit=clip&w=1200") | safeURL }}
{{ else }}
{{ $posterImg = "/images/poster/tracing.png" }}
{{ end }}
Expand Down
Loading