@@ -7,6 +7,8 @@ var _ = require( "lodash" ),
7
7
Handlebars = require ( "handlebars" ) ,
8
8
http = require ( "http" ) ;
9
9
10
+ const CDN_ORIGIN = "https://code.jquery.com" ;
11
+
10
12
grunt . loadNpmTasks ( "grunt-jquery-content" ) ;
11
13
grunt . loadNpmTasks ( "grunt-sri" ) ;
12
14
@@ -323,7 +325,7 @@ grunt.registerTask( "build-index", function() {
323
325
324
326
function cdnSriLink ( file , label ) {
325
327
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 ;
327
329
return `<a
328
330
class='open-sri-modal'
329
331
href='${ cdnOrigin } /${ file } '
@@ -332,7 +334,7 @@ grunt.registerTask( "build-index", function() {
332
334
}
333
335
334
336
function cdnLink ( file , label ) {
335
- var cdnOrigin = grunt . config ( "wordpress" ) . cdn_origin ;
337
+ var cdnOrigin = grunt . config ( "wordpress" ) . cdn_origin || CDN_ORIGIN ;
336
338
return `<a href='${ cdnOrigin } /${ file } '>${ label } </a>` ;
337
339
}
338
340
@@ -383,7 +385,7 @@ grunt.registerTask( "build-index", function() {
383
385
384
386
Handlebars . registerHelper ( "uiTheme" , function ( release ) {
385
387
var url ,
386
- cdnOrigin = grunt . config ( "wordpress" ) . cdn_origin ;
388
+ cdnOrigin = grunt . config ( "wordpress" ) . cdn_origin || CDN_ORIGIN ;
387
389
388
390
// TODO: link to minified theme if available
389
391
if ( release . themes . indexOf ( "smoothness" ) !== - 1 ) {
0 commit comments