mirror of https://github.com/istio/istio.io.git
Another experiment for image links.
This commit is contained in:
parent
1811057b0d
commit
61a4a6a2ec
|
@ -32,19 +32,21 @@ parameter.
|
||||||
{{ $alt := or (.Get "alt") (.Get "title") (.Get "caption") }}
|
{{ $alt := or (.Get "alt") (.Get "title") (.Get "caption") }}
|
||||||
|
|
||||||
{{/* Turn relative values for $link into absolute URLs */}}
|
{{/* Turn relative values for $link into absolute URLs */}}
|
||||||
|
{{ .Scratch.Set "link" $link }}
|
||||||
|
|
||||||
{{ $prefix := slicestr $link 0 1 }}
|
{{ $prefix := slicestr $link 0 1 }}
|
||||||
{{ if (eq $prefix "/") }}
|
{{ if (ne $prefix "/") }}
|
||||||
{{ .Scratch.Set "link" $link }}
|
{{ $prefix := slicestr $link 0 8 }}
|
||||||
{{ else }}
|
{{ if (ne $prefix "https://") }}
|
||||||
{{ $prefix := slicestr $link 0 3 }}
|
{{ $prefix := slicestr $link 0 3 }}
|
||||||
{{ if (eq $prefix "../") }}
|
{{ if (eq $prefix "../") }}
|
||||||
{{ $link := slicestr $link 3 }}
|
{{ .Scratch.Set "link" (printf "/%s%s" .Page.Dir (slicestr $link 3)) }}
|
||||||
{{ .Scratch.Set "link" (printf "/%s%s" .Page.Dir $link) }}
|
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ .Scratch.Set "link" (printf "/%s%s" .Page.Dir $link) }}
|
{{ .Scratch.Set "link" (printf "/%s%s" .Page.Dir $link) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $link := printf "%s%s" .Site.BaseURL (.Scratch.Get "link") }}
|
{{ $link := .Scratch.Get "link" }}
|
||||||
|
|
||||||
<figure style="width: {{ $width }}">
|
<figure style="width: {{ $width }}">
|
||||||
<div class="wrapper-with-intrinsic-ratio" style="padding-bottom: {{ $ratio }}">
|
<div class="wrapper-with-intrinsic-ratio" style="padding-bottom: {{ $ratio }}">
|
||||||
|
|
Loading…
Reference in New Issue