Hide the beta version button on the website if there is only a stable version

This commit is contained in:
Tim van der Meij 2018-10-27 20:57:01 +02:00
parent 31bff2d950
commit 2b5bc6bcec
No known key found for this signature in database
GPG key ID: 8C3FD2925A5F2762
2 changed files with 11 additions and 2 deletions

View file

@ -1169,6 +1169,15 @@ gulp.task('wintersmith', ['gh-pages-prepare'], function (done) {
/STABLE_VERSION/g, config.stableVersion);
replaceInFile(GH_PAGES_DIR + '/getting_started/index.html',
/BETA_VERSION/g, config.betaVersion);
// Hide the beta version button if there is only a stable version.
const groupClass = config.betaVersion ? 'btn-group-vertical centered' : '';
const hiddenClass = config.betaVersion ? '' : 'hidden';
replaceInFile(GH_PAGES_DIR + '/getting_started/index.html',
/GROUP_CLASS/g, groupClass);
replaceInFile(GH_PAGES_DIR + '/getting_started/index.html',
/HIDDEN_CLASS/g, hiddenClass);
console.log('Done building with wintersmith.');
done();
});