Skip to content

Commit

Permalink
refactor: object-fit is widely available
Browse files Browse the repository at this point in the history
  • Loading branch information
HEIGE-PCloud committed Dec 29, 2024
1 parent 36830d7 commit 1ffb9e9
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 18 deletions.
2 changes: 0 additions & 2 deletions assets/data/cdn/jsdelivr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ libFiles:
mermaidJS: mermaid@8.13.3/dist/mermaid.min.js
# meting@2.0.1 https://github.com/metowolf/MetingJS
metingJS: meting@2.0.1/dist/Meting.min.js
# object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
objectFitImagesJS: object-fit-images@3.2.4/dist/ofi.min.js
# sharer.js@0.4.2 https://github.com/ellisonleao/sharer.js
sharerJS: sharer.js@0.4.2/sharer.min.js
# twemoji@13.1.0 https://github.com/twitter/twemoji
Expand Down
1 change: 0 additions & 1 deletion assets/js/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,6 @@ function init() {
window.scrollEventSet = new Set();
window.resizeEventSet = new Set();
window.clickMaskEventSet = new Set();
if (window.objectFitImages) objectFitImages();
initMenuMobile();
initSwitchTheme();
initSelectTheme();
Expand Down
2 changes: 0 additions & 2 deletions assets/lib/object-fit-images/ofi.min.js

This file was deleted.

3 changes: 0 additions & 3 deletions exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,3 @@ bundle = false
# whether to use Polyfill.io to be compatible with older browsers
# 是否使用 Polyfill.io 来兼容旧式浏览器
polyfill = false
# whether to use object-fit-images to be compatible with older browsers
# 是否使用 object-fit-images 来兼容旧式浏览器
objectFit = false
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,6 @@ Please open the code block below to view the complete sample configuration {{< f
# whether to use Polyfill.io on cdnjs to be compatible with older browsers
# https://blog.cloudflare.com/polyfill-io-now-available-on-cdnjs-reduce-your-supply-chain-risk
polyfill = false
# whether to use object-fit-images to be compatible with older browsers
objectFit = false

# Markup related config in Hugo
[markup]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,6 @@ optimizeImages = true
[params.compatibility]
# 是否使用 Polyfill.io 来兼容旧式浏览器
polyfill = false
# 是否使用 object-fit-images 来兼容旧式浏览器
objectFit = false

# Hugo 解析文档的配置
[markup]
Expand Down
6 changes: 0 additions & 6 deletions layouts/partials/plugin/compatibility.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,3 @@
{{- delimit . "%2C" | printf "https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=%v" | dict "Source" | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- end -}}

{{- /* object-fit-images */ -}}
{{- if $compatibility.objectFit -}}
{{- $source := $cdn.objectFitImagesJS | default "lib/object-fit-images/ofi.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}

0 comments on commit 1ffb9e9

Please sign in to comment.