Add new CDN vendor who name is qiniu & bootcdn.

This commit is contained in:
凡梦星尘 2022-10-30 16:54:38 +08:00
parent e1c088c355
commit 7c9b834729
4 changed files with 19 additions and 9 deletions

View File

@ -221,8 +221,13 @@ NexT.utils = {
let res_src = ''; let res_src = '';
switch (plugins) { switch (plugins) {
case 'cdnjs': case 'cdnjs':
case 'bootcdn':
case 'qiniu':
let cdnjs_name = alias || name; let cdnjs_name = alias || name;
let cdnjs_file = file.replace(/\.js$/, '.min.js').replace(/^(dist|lib|source\/js|)\/(browser\/|)/, ''); 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}/${cdnjs_name}/${version}/${cdnjs_file}`
break; break;
default: default:

View File

@ -3,6 +3,8 @@
vendors: vendors:
cdnjs: "https://cdnjs.cloudflare.com/ajax/libs" cdnjs: "https://cdnjs.cloudflare.com/ajax/libs"
unpkg: "https://unpkg.com" unpkg: "https://unpkg.com"
bootcdn: "https://cdn.bootcdn.net/ajax/libs"
qiniu: "https://cdn.staticfile.org"
# JavaScript 资源 # JavaScript 资源
# JavaScript Resources # JavaScript Resources
@ -82,11 +84,11 @@ livere:
# Full text search # Full text search
algolia: algolia:
name: algoliasearch name: algoliasearch
version: 4.13.0 version: 4.14.2
file: dist/algoliasearch-lite.umd.js file: dist/algoliasearch-lite.umd.js
instant: instant:
name: instantsearch.js name: instantsearch.js
version: 4.40.5 version: 4.49.0
file: dist/instantsearch.production.min.js file: dist/instantsearch.production.min.js
plugins: plugins:

View File

@ -103,6 +103,7 @@ enableRobotsTXT: true
# 强制输出时压缩文件 # 强制输出时压缩文件
# Compress all files when output # Compress all files when output
minify: minify:
minifyOutput: true
#-------------------------------------- #--------------------------------------
# 菜单配置说明 # 菜单配置说明
@ -302,7 +303,7 @@ params:
enable: true enable: true
# 组件类型,可选值为: 51la, busuanzi # 组件类型,可选值为: 51la, busuanzi
# 使用51la时需要注册账号https://invite.51.la/1NUfGTS1?target=V6 # 使用51la时需要注册账号https://invite.51.la/1NUfGTS1?target=V6
# Plguin value is: 51la, busuzazi # Plguin value is: 51la, busuanzi
plugin: busuanzi plugin: busuanzi
# 社交链接地址 # 社交链接地址
@ -809,7 +810,8 @@ params:
# Waline comments system # Waline comments system
# More info seee: https://waline.js.org/ # More info seee: https://waline.js.org/
waline: waline:
pageView: '#waline-pageview-count' pageView: true
comment: true
placeholder: "请文明发言哟 ヾ(≧▽≦*)o" placeholder: "请文明发言哟 ヾ(≧▽≦*)o"
sofa: "快来发表你的意见吧 (≧∀≦)ゞ" sofa: "快来发表你的意见吧 (≧∀≦)ゞ"
emoji: false emoji: false
@ -1090,15 +1092,16 @@ params:
# CDN Settings # CDN Settings
# --------------------------------------------------------------- # ---------------------------------------------------------------
vendors:
vendors: vendors:
# The CDN provider of NexT internal scripts. # The CDN provider of NexT internal scripts.
# Available values: local | unpkg | cdnjs | custom # Available values: local | unpkg | cdnjs | qiniu | bootcdn | custom
# Warning: If you are using the latest master branch of NexT, please set `internal: local` # Warning: If you are using the latest master branch of NexT, please set `internal: local`
internal: local internal: local
# The default CDN provider of third-party plugins. # The default CDN provider of third-party plugins.
# Available values: local | unpkg | cdnjs | custom # Available values: local | unpkg | cdnjs| qiniu | bootcdn | custom
# Dependencies for `plugins: local`: https://github.com/next-theme/plugins # Dependencies for `plugins: local`: https://github.com/next-theme/plugins
plugins: unpkg plugins: qiniu
# TODO # TODO
# Custom CDN URL # Custom CDN URL
# For example: # For example:

View File

@ -8,7 +8,7 @@
{{ end }} {{ end }}
{{- $file := .res.file }} {{- $file := .res.file }}
{{- if eq .vendor "cdnjs" }} {{- if ne .vendor "unpkg" }}
{{- with .res.alias }} {{- with .res.alias }}
{{- $npm = . }} {{- $npm = . }}
{{- end }} {{- end }}