hexo/helper/cdn

Register the Hexo helper functions for resolving the URL of static files of JavaScript libraries, web fonts, and FontAwesome icon fonts.

(require("hexo/helper/cdn"))(hexo)

Register the Hexo helper functions for resolving the URL of static files of JavaScript libraries, web fonts, and FontAwesome icon fonts.
Source:
Parameters:
Name Type Description
hexo Hexo The Hexo instance.
Example
// Use the function below to resolve the CDN URL JavaScript library static files in your view files
cdn('jquery', '3.3.1', 'dist/jquery.min.js');
// -> https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js

// Use the function below to resolve the CDN URL web font files
fontcdn('Ubuntu:400,600|Source+Code+Pro', 'css');
// -> https://fonts.googleapis.com/css?family=Ubuntu:400,600|Source+Code+Pro

// Use the function below to insert FontAwesome icon font CSS URL.
iconcdn();
// -> https://use.fontawesome.com/releases/v5.15.2/css/all.css