Skip to content

Commit

Permalink
Exclude the latest v5 from the Legacy page
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Jun 30, 2020
1 parent f086453 commit 54bd59a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion test/bootstrap_legacy_test.js
@@ -1,9 +1,14 @@
'use strict';

const assert = require('assert').strict;
const semver = require('semver');
const { files } = require('../config');
const helpers = require('./test_helpers');

const latestBootstrap5 = files.bootstrap.find((file) => {
return semver.satisfies(file.version, '^5', { includePrerelease: true });
});

describe('legacy/bootstrap', () => {
const uri = helpers.getURI('legacy/bootstrap');
let response = {};
Expand Down Expand Up @@ -40,7 +45,7 @@ describe('legacy/bootstrap', () => {
helpers.assert.bodyClass('page-legacybootstrap', response, done);
});

files.bootstrap.filter((file) => !file.current)
files.bootstrap.filter((file) => !file.current && file.version !== latestBootstrap5.version)
.forEach((bootstrap) => {
describe(bootstrap.version, () => {
['html', 'pug', 'haml'].forEach((fmt) => {
Expand Down
4 changes: 3 additions & 1 deletion views/legacy/bootstrap.pug
Expand Up @@ -3,8 +3,10 @@ extends ../layout.pug
block content
h2.text-center.mb-4 Bootstrap Legacy

-var latestBootstrap5 = config.files.bootstrap.find(file => semver.satisfies(file.version, '^5', { includePrerelease: true }));

each item in config.files.bootstrap
unless (item.current)
if (!item.current && item.version !== latestBootstrap5.version)
.card.bg-light.mt-4.p-4.text-center
h3.mt-2=`v${item.version}`

Expand Down

0 comments on commit 54bd59a

Please sign in to comment.