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 }}

View File

@@ -58,7 +58,7 @@
<!-- change -->
<script
src="https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js"
src="https://cdn.jsdelivr.us/npm/medium-zoom/dist/medium-zoom.min.js"
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>

View File

@@ -106,5 +106,5 @@
{{- end -}}
<!-- change -->
<script defer type="text/javascript" src="{{ "js/jsdelivr-auto-fallback.js" | absURL }}"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.us/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css" />
</head>