docs: optimize css style (#700)

Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>
This commit is contained in:
Carson Yang
2024-01-06 18:42:27 +08:00
committed by GitHub
parent 84cc4baf21
commit 13eda40443
10 changed files with 50 additions and 17 deletions

View File

@@ -9,11 +9,11 @@
{{ 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">
<img src="{{ $image.RelPermalink | safeURL }}" alt="{{ $text }}" width="{{ $image.Width }}" height="{{ $image.Height }}" loading="lazy" class="medium-zoom-image">
{{ end }}
{{ end }}
{{ else }}
<img src="{{ $dest | safeURL }}" alt="{{ $text }}" loading="lazy">
<img src="{{ $dest | safeURL }}" alt="{{ $text }}" loading="lazy" class="medium-zoom-image">
{{ end }}
<figcaption>{{ .Title | markdownify }}</figcaption>
</figure>
@@ -23,10 +23,10 @@
{{ 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">
<img src="{{ $image.RelPermalink | safeURL }}" alt="{{ $text }}" width="{{ $image.Width }}" height="{{ $image.Height }}" loading="lazy" class="medium-zoom-image">
{{ end }}
{{ end }}
{{ else }}
<img src="{{ $dest | safeURL }}" alt="{{ $text }}" loading="lazy">
<img src="{{ $dest | safeURL }}" alt="{{ $text }}" loading="lazy" class="medium-zoom-image">
{{ end }}
{{ end }}

View File

@@ -64,7 +64,7 @@
></script>
<script>
const images = Array.from(document.querySelectorAll(".main-content img"));
const images = Array.from(document.querySelectorAll('.medium-zoom-image'));
images.forEach((img) => {
mediumZoom(img, {
margin: 0 /* The space outside the zoomed image */,

View File

@@ -1,4 +1,5 @@
<head>
<script defer type="text/javascript" src="{{ "js/jsdelivr-auto-fallback.js" | absURL }}"></script>
<meta charset="utf-8" />
<title>
{{- $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
@@ -105,6 +106,6 @@
{{- end -}}
{{- end -}}
<!-- change -->
<script defer type="text/javascript" src="{{ "js/jsdelivr-auto-fallback.js" | absURL }}"></script>
<link rel="preload" href="https://cdn.jsdelivr.us/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css" as="style" />
<link rel="stylesheet" href="https://cdn.jsdelivr.us/npm/lxgw-wenkai-screen-webfont@1.1.0/style.css" />
</head>