docs: update cdn link (#698)

Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>
This commit is contained in:
Carson Yang
2024-01-05 22:31:17 +08:00
committed by GitHub
parent 8d17f96600
commit 9329ddeac5
11 changed files with 89 additions and 10 deletions

View File

@@ -0,0 +1,32 @@
{{ $dest := .Destination }}
{{ $text := .PlainText }}
{{ $url := urls.Parse $dest }}
{{ if .Title }}
<figure>
{{ if eq $url.Scheme "" }}
{{ with $image := resources.Get $dest }}
{{ if eq $image.MediaType.SubType "svg" }}
{{ $image.Content | safeHTML }}
{{ else }}
<img src="{{ $image.RelPermalink | safeURL }}" alt="{{ $text }}" width="{{ $image.Width }}" height="{{ $image.Height }}" loading="lazy">
{{ end }}
{{ end }}
{{ else }}
<img src="{{ $dest | safeURL }}" alt="{{ $text }}" loading="lazy">
{{ end }}
<figcaption>{{ .Title | markdownify }}</figcaption>
</figure>
{{ else }}
{{ if eq $url.Scheme "" }}
{{ with $image := resources.Get $dest }}
{{ if eq $image.MediaType.SubType "svg" }}
{{ $image.Content | safeHTML }}
{{ else }}
<img src="{{ $image.RelPermalink | safeURL }}" alt="{{ $text }}" width="{{ $image.Width }}" height="{{ $image.Height }}" loading="lazy">
{{ end }}
{{ end }}
{{ else }}
<img src="{{ $dest | safeURL }}" alt="{{ $text }}" loading="lazy">
{{ end }}
{{ end }}