Skip to content

Commit

Permalink
All plugins are available on CDNJS
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Mar 27, 2022
1 parent aae3ab8 commit 968ac54
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions _vendors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ canvas_ribbon:
name: ribbon.js
version: 1.0.2
file: dist/ribbon.min.js
unavailable:
- cdnjs
integrity: sha256-UkSSapoJqxvq+8bSCIrAhXO+aOMBRmkK6vxjTstemLs=
creative_commons:
name: '@creativecommons/vocabulary'
Expand Down
2 changes: 1 addition & 1 deletion scripts/events/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const points = {
]
};

// Required by theme-next-docs
// Required by theme-next-docs and @next-theme/plugins
module.exports = {
resolve,
highlightTheme,
Expand Down
3 changes: 1 addition & 2 deletions scripts/events/lib/vendors.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ module.exports = hexo => {
if (key === 'pace_css') {
value.file = `${value.dir}/${pace.color}/pace-theme-${pace.theme}.css`;
}
const { name, file, unavailable } = value;
const { name, file } = value;
const links = getVendors({
...value,
minified: file,
local : url_for.call(hexo, `lib/${name}/${file}`),
custom : vendors.custom_cdn_url
});
let { plugins = 'jsdelivr' } = vendors;
if (plugins === 'cdnjs' && unavailable && unavailable.includes('cdnjs')) plugins = 'jsdelivr';
if (plugins === 'local' && typeof internal === 'undefined') plugins = 'jsdelivr';
vendors[key] = {
url : links[plugins] || links.jsdelivr,
Expand Down

0 comments on commit 968ac54

Please sign in to comment.