Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/scripts/buildWebsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
1 change: 1 addition & 0 deletions src/website/data/organisations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- name: "Microsoft"
image: "microsoft.svg"
link: "https://docs.microsoft.com"
pinned: true

- name: "Mr Porter"
image: "mrp.svg"
Expand Down
2 changes: 1 addition & 1 deletion src/website/layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h1 class="title">Who is using Fastify?</h1>
<div class="columns is-centered">
<div class="column is-12">
<ul class="organisations-list">
{% set shuffledOrganisations = data.organisations | shuffle %}
{% set shuffledOrganisations = data.organisations | shuffleWithPinned %}
{% for organizationIndex in range(0, 12) %}
{% set organization = shuffledOrganisations[organizationIndex] %}
{% if organization %}
Expand Down
2 changes: 1 addition & 1 deletion src/website/layouts/organisations.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1 class="title">
<p>Fastify is proudly powering a large ecosystem of organisations and products out there.</p>
<p>Below is a list of some of the organisations adopting Fastify.</p>
<ul class="organisations-list align-start">
{% for organization in data.organisations | shuffle %}
{% for organization in data.organisations | shuffleWithPinned %}
<li>
<a href="{{ organization.link }}" target="_blank" rel="nofollow">
<img src="/{{ hashes['images/organisations/' + organization.image] }}" alt="{{ organization.name }} is using Fastify"/>
Expand Down