Skip to content

Commit

Permalink
variant: don't allow auto mode variants to be downloaded #679
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Nov 25, 2023
1 parent 74a9c4d commit ff978f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions static/js/variant.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,12 @@ var variants = {
},

getStylesheet: function(){
this.download( this.generateStylesheet(), 'text/css', 'theme-' + this.customvariantname + '.css' );
var style = this.generateStylesheet();
if( !style ){
alert( 'There is nothing to be generated as auto mode variants will be generated by Hugo' );
return;
}
this.download( style, 'text/css', 'theme-' + this.customvariantname + '.css' );
},

adjustCSSRules: function(selector, props, sheets) {
Expand Down Expand Up @@ -427,7 +432,6 @@ var variants = {
read_style = write_style;
}
if( !read_style ){
alert( 'An auto mode variant will be generated by Hugo and must not be stored in a separate stylesheet' );
return;
}

Expand Down

0 comments on commit ff978f3

Please sign in to comment.