@@ -7,6 +7,8 @@ var _ = require( "lodash" ),
77 Handlebars = require ( "handlebars" ) ,
88 http = require ( "http" ) ;
99
10+ const CDN_ORIGIN = "https://code.jquery.com" ;
11+
1012grunt . loadNpmTasks ( "grunt-jquery-content" ) ;
1113grunt . loadNpmTasks ( "grunt-sri" ) ;
1214
@@ -323,7 +325,7 @@ grunt.registerTask( "build-index", function() {
323325
324326 function cdnSriLink ( file , label ) {
325327 var sri = "sha256-" + sriHashes [ `@cdn/${ file } ` ] . hashes . sha256 ,
326- cdnOrigin = grunt . config ( "wordpress" ) . cdn_origin || "https://code.jquery.com" ;
328+ cdnOrigin = grunt . config ( "wordpress" ) . cdn_origin || CDN_ORIGIN ;
327329 return `<a
328330 class='open-sri-modal'
329331 href='${ cdnOrigin } /${ file } '
@@ -332,7 +334,7 @@ grunt.registerTask( "build-index", function() {
332334 }
333335
334336 function cdnLink ( file , label ) {
335- var cdnOrigin = grunt . config ( "wordpress" ) . cdn_origin ;
337+ var cdnOrigin = grunt . config ( "wordpress" ) . cdn_origin || CDN_ORIGIN ;
336338 return `<a href='${ cdnOrigin } /${ file } '>${ label } </a>` ;
337339 }
338340
@@ -383,7 +385,7 @@ grunt.registerTask( "build-index", function() {
383385
384386 Handlebars . registerHelper ( "uiTheme" , function ( release ) {
385387 var url ,
386- cdnOrigin = grunt . config ( "wordpress" ) . cdn_origin ;
388+ cdnOrigin = grunt . config ( "wordpress" ) . cdn_origin || CDN_ORIGIN ;
387389
388390 // TODO: link to minified theme if available
389391 if ( release . themes . indexOf ( "smoothness" ) !== - 1 ) {
0 commit comments