diff --git a/src/scripts/buildWebsite.js b/src/scripts/buildWebsite.js index af24679d93..4ae116211c 100755 --- a/src/scripts/buildWebsite.js +++ b/src/scripts/buildWebsite.js @@ -41,6 +41,19 @@ env.addGlobal('getContext', function () { env.addGlobal('currentYear', new Date().getFullYear()) env.addFilter('md', markdownFilter) env.addFilter('shuffle', arr => shuffle(arr)) +env.addFilter('shuffleWithPinned', arr => { + const pinned = [] + const remaining = [] + for (const e of arr) { + if (e.pinned === true) { + pinned.push(e) + } else { + remaining.push(e) + } + } + + return [...pinned, ...shuffle(remaining)] +}) Metalsmith(source) .source(path.join(source, 'content')) diff --git a/src/website/data/organisations.yml b/src/website/data/organisations.yml index 4270794ae3..46837c6776 100644 --- a/src/website/data/organisations.yml +++ b/src/website/data/organisations.yml @@ -29,6 +29,7 @@ - name: "Microsoft" image: "microsoft.svg" link: "https://docs.microsoft.com" + pinned: true - name: "Mr Porter" image: "mrp.svg" diff --git a/src/website/layouts/home.html b/src/website/layouts/home.html index 8c82275993..81815a705d 100644 --- a/src/website/layouts/home.html +++ b/src/website/layouts/home.html @@ -45,7 +45,7 @@

Who is using Fastify?