From ff978f3be1a17a18a549ca40ae25f6fe316829df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sat, 25 Nov 2023 23:14:03 +0100 Subject: [PATCH] variant: don't allow auto mode variants to be downloaded #679 --- static/js/variant.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/js/variant.js b/static/js/variant.js index 4f7022c3ab..78d255ba30 100644 --- a/static/js/variant.js +++ b/static/js/variant.js @@ -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) { @@ -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; }