Skip to content

Commit 1ac5b55

Browse files
authored
docs: improve filtering (#5191)
* fix: do not reload eleventy infinitely * docs: improve filtering
1 parent 1528c42 commit 1ac5b55

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

.eleventy.js

-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ module.exports = function (eleventyConfig) {
4646

4747
eleventyConfig.setLibrary('md', markdown);
4848

49-
eleventyConfig.setUseGitIgnore(false);
50-
5149
return {
5250
passthroughFileCopy: true,
5351
dir: {

docs/_data/supporters.js

+18-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const blocklist = new Set(require('./blocklist.json'));
2727
* In addition to the blocklist, any account slug matching this regex will not
2828
* be displayed on the website.
2929
*/
30-
const BLOCKED_STRINGS = /(?:[ck]a[sz]ino|seo|slots|gambl(?:e|ing)|crypto)/i;
30+
const BLOCKED_STRINGS = /(?:[ck]a[sz]ino|seo|slot|gambl(?:e|ing)|crypto|follow|buy|cheap|instagram|hacks|tiktok|likes|youtube|subscriber|boost|deposit|mushroom|bingo|broker|promotion|bathroom|landscaping|lawn care|groundskeeping|remediation|esports|links|coupon|review|refer|promocode|rabattkod|jämför|betting|reddit|hire|fortune|equity|download|marketing|comment|rank|scrapcar|lawyer|celeb|concrete|firestick|playground)/i;
3131

3232
/**
3333
* Add a few Categories exposed by Open Collective to help moderation
@@ -38,7 +38,8 @@ const BLOCKED_CATEGORIES = [
3838
'credit',
3939
'gambling',
4040
'seo',
41-
'writer'
41+
'writer',
42+
'review'
4243
];
4344

4445
/**
@@ -160,10 +161,21 @@ const getAllOrders = async (slug = 'mochajs') => {
160161
}
161162
};
162163

163-
const isAllowed = ({slug, categories}) =>
164-
!blocklist.has(slug) &&
165-
!BLOCKED_STRINGS.test(slug) &&
166-
!categories.some(category => BLOCKED_CATEGORIES.includes(category));
164+
const isAllowed = ({name, slug, website, categories}) => {
165+
const allowed = !blocklist.has(slug) &&
166+
!BLOCKED_STRINGS.test(name) &&
167+
!BLOCKED_STRINGS.test(slug) &&
168+
!BLOCKED_STRINGS.test(website) &&
169+
!categories.some(category => BLOCKED_CATEGORIES.includes(category));
170+
171+
if (!allowed) {
172+
debug('filtering %o', {categories, name, slug, website});
173+
} else {
174+
// debug('keeping %o', {categories, name, slug, website}, BLOCKED_STRINGS.test(website));
175+
}
176+
177+
return allowed;
178+
};
167179

168180
const getSupporters = async () => {
169181
const orders = await getAllOrders();

0 commit comments

Comments
 (0)