diff --git a/assets/css/_common/outline/footer/index.scss b/assets/css/_common/outline/footer/index.scss index be1ba96..4e200b4 100644 --- a/assets/css/_common/outline/footer/index.scss +++ b/assets/css/_common/outline/footer/index.scss @@ -47,6 +47,14 @@ img { display: inline-block; + max-width: 50px; + @include mobile() { + max-width: 40px; + } + + &:last-child { + max-height: 18px; + } } $footer_vendors_imgs_len: length($footer_vendors_imgs_width); diff --git a/assets/js/utils.js b/assets/js/utils.js index 7510a72..9539453 100644 --- a/assets/js/utils.js +++ b/assets/js/utils.js @@ -240,25 +240,24 @@ NexT.utils = { getCDNResource: function (res) { let { plugins, router } = NexT.CONFIG.vendor; let { name, version, file, alias, alias_name } = res; - + let npm_name = name; if (alias_name) npm_name = alias_name; let res_src = ''; - switch (plugins) { - case 'cdnjs': - case 'bootcdn': - case 'qiniu': + + switch (router.type) { + case 'modern': let cdnjs_name = alias || name; let cdnjs_file = file.replace(/^(dist|lib|source|\/js|)\/(browser\/|)/, ''); if (cdnjs_file.indexOf('min') == -1) { cdnjs_file = cdnjs_file.replace(/\.js$/, '.min.js'); } - res_src = `${router}/${cdnjs_name}/${version}/${cdnjs_file}` + res_src = `${router.url}/${cdnjs_name}/${version}/${cdnjs_file}` break; default: - res_src = `${router}/${npm_name}@${version}/${file}` + res_src = `${router.url}/${npm_name}@${version}/${file}` } - + return res_src; }, diff --git a/data/resources.yaml b/data/resources.yaml index 50b7854..799c775 100644 --- a/data/resources.yaml +++ b/data/resources.yaml @@ -1,33 +1,76 @@ # CDN 公共资源商列表 # Public CDN vendor list vendors: - cdnjs: "https://cdnjs.cloudflare.com/ajax/libs" - unpkg: "https://unpkg.com" - bootcdn: "https://cdn.bootcdn.net/ajax/libs" - qiniu: "https://cdn.staticfile.net" + - name: cdnjs + home: "https://cdnjs.com" + logo: "https://cdnjs.com/_/f7a2ebfb819c118086546e481876aef6.svg" + type: "modern" + url: "https://cdnjs.cloudflare.com/ajax/libs" + + - name: unpkg + home: "https://unpkg.com" + logo: "https://unpkg.fly.dev/_client/b870d5fb04d2854d.png" + type: "nodejs" + url: "https://unpkg.com" + + - name: bootcdn + home: "https://www.bootcdn.cn" + logo: "https://www.bootcdn.cn/assets/img/logo.png" + type: "modern" + url: "https://cdn.bootcdn.net/ajax/libs" + + - name: staticfile + home: "https://staticfile.net/" + logo: "https://www.staticfile.net/images/logo.png" + type: "modern" + url: "https://cdn.staticfile.net" + + - name: 7ed + home: "https://www.7ed.net" + logo: "https://github.com/7ednet/homepage/raw/main/_images/logo.svg" + type: "modern" + url: "https://use.sevencdn.com/ajax/libs" + + - name: zstatic + home: "https://www.zstatic.net" + logo: "https://www.zstatic.net/favicon/favicon-16x16.png" + type: "modern" + url: "https://s4.zstatic.net/ajax/libs" + + - name: zeyao + home: "https://cdn.jsdmirror.com/" + logo: "https://img.cuteapi.com/2023/08/29/Background.png" + type: "nodejs" + url: "https://cdn.jsdmirror.com/npm" + + - name: jsdelivr + home: "https://www.jsdelivr.com/" + logo: "https://www.jsdelivr.com/assets/0c183396fdb0079ea31849b02bc5e3429f1740de/img/jsdelivr-horizontal-regular.svg" + type: "nodejs" + url: "https://cdn.jsdelivr.net/npm" # JavaScript 资源 # JavaScript Resources js: - name: animejs - version: 3.2.1 + version: 3.2.2 file: lib/anime.min.js - name: viewerjs - version: 1.11.0 + version: 1.11.6 file: dist/viewer.min.js # CSS 资源 # CSS Resources css: - name: '@fortawesome/fontawesome-free' - version: 6.5.2 + version: 6.6.0 file: css/all.min.css alias: font-awesome - name: animate.css - version: 3.1.1 + version: 4.1.1 file: animate.min.css - name: viewerjs - version: 1.11.0 + version: 1.11.6 file: dist/viewer.min.css # 第三方服务组件资源 @@ -84,11 +127,11 @@ livere: # Full text search algolia: name: algoliasearch - version: 4.14.2 - file: dist/algoliasearch-lite.umd.js + version: 4.24.0 + file: dist/algoliasearch.umd.min.js instant: name: instantsearch.js - version: 4.49.0 + version: 4.73.2 file: dist/instantsearch.production.min.js plugins: @@ -96,26 +139,26 @@ plugins: mathjax: js: name: mathjax - version: 3.2.0 - file: es5/tex-mml-chtml.js + version: 3.2.2 + file: es5/tex-mml-chtml.min.js katex: js: - name: katex - version: 0.16.0 + version: 0.16.11 file: dist/katex.min.js - name: auto-render alias_name: katex - version: 0.16.0 + version: 0.16.11 file: dist/contrib/auto-render.min.js css: name: katex - version: 0.16.0 + version: 0.16.11 file: dist/katex.min.css # 画图渲染 mermaid: js: name: mermaid - version: 9.1.7 + version: 10.9.1 file: dist/mermaid.min.js # 文章访问/评论统计 waline: diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index de73943..1b000f9 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -1113,9 +1113,8 @@ params: # Warning: If you are using the latest master branch of NexT, please set `internal: local` internal: local # The default CDN provider of third-party plugins. - # Available values: local | unpkg | cdnjs| qiniu | bootcdn | custom - # Dependencies for `plugins: local`: https://github.com/next-theme/plugins - plugins: qiniu + # Available values: local | | cdnjs | unpkg | bootcdn | staticfile | 7ed | zstatic | zeyao | jsdelivr | custom + plugins: jsdelivr # TODO # Custom CDN URL # For example: diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index b4851e7..67da83a 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -38,7 +38,7 @@ diff --git a/layouts/partials/_funs/get_res.html b/layouts/partials/_funs/get_res.html index 926ce54..e87f502 100644 --- a/layouts/partials/_funs/get_res.html +++ b/layouts/partials/_funs/get_res.html @@ -8,7 +8,7 @@ {{ end }} {{ $file := .res.file }} -{{ if ne .vendor "unpkg" }} +{{ if ne .router.type "nodejs" }} {{ with .res.alias }} {{ $npm = . }} {{ end }} @@ -16,6 +16,6 @@ {{ $fmt = "%s/%s/%s/%s" }} {{ end }} -{{ $pluginRes := printf $fmt .router $npm .res.version $file }} +{{ $pluginRes := printf $fmt .router.url $npm .res.version $file }} {{ return $pluginRes }} \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 8ed63b2..350c2eb 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -43,15 +43,19 @@ {{ if .enable }}
{{ range .list }} - - {{ if .image }} - {{ .name }} - {{ else }} - {{ .name }} - {{ end }} - + + {{ if .image }} + {{ .name }} + {{ else }} + {{ .name }} + {{ end }} + {{ end }} - {{ .title }} + {{ $cv := $.Scratch.Get "router" }} + + {{ $cv.name }} + + {{ .title }}
{{ end }} {{ end }} diff --git a/layouts/partials/init.html b/layouts/partials/init.html index a760223..305d00a 100644 --- a/layouts/partials/init.html +++ b/layouts/partials/init.html @@ -21,7 +21,13 @@ {{ $globalVars.Set "tagsCount" (len .Site.Taxonomies.tags) }} {{ $vendor := .Site.Params.vendors.plugins }} -{{ $router := index .Site.Data.resources.vendors $vendor }} +{{ $router := dict }} +{{ range .Site.Data.resources.vendors }} + {{ if eq .name $vendor }} + {{ $router = . }} + {{ break }} + {{ end }} +{{ end }} {{ $globalVars.Set "vendor" $vendor }} {{ $globalVars.Set "router" $router }} diff --git a/layouts/partials/scripts/global.html b/layouts/partials/scripts/global.html index 649804b..62826ed 100644 --- a/layouts/partials/scripts/global.html +++ b/layouts/partials/scripts/global.html @@ -3,8 +3,8 @@ {{ $vendor := .Site.Params.vendors.plugins }} {{ $router := .Scratch.Get "router" }} {{ range $jsRes }} - {{ $pluginJS := partial "_funs/get_res.html" (dict "res" . "vendor" $vendor "router" $router) }} - + {{ $pluginJS := partial "_funs/get_res.html" (dict "res" . "vendor" $vendor "router" $router) }} + {{ end }}