Repository navigation
Expand file tree
/
Copy pathpromotions.ts
More file actions
67 lines (60 loc) · 1.87 KB
/
Copy pathpromotions.ts
File metadata and controls
67 lines (60 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import type {
PromoType,
ExitPopupPolicy,
ExitPopupOptions,
TrackingConfig,
PromoData,
FilterOptions,
TopListCampaign,
TopListItem,
} from "./promos/types";
import {
getCurrentTopList,
getFilteredPromos,
isPromoDateActive,
} from "./promos/types";
import { firstPartyPromos } from "./promos/firstParty";
import {
campaignBannerPromos,
campaignTopLists,
campaignVideoPromos,
} from "./promos/campaigns";
export type {
PromoType,
ExitPopupPolicy,
ExitPopupOptions,
TrackingConfig,
PromoData,
FilterOptions,
TopListCampaign,
TopListItem,
};
export { getFilteredPromos, isPromoDateActive };
/**
* Site-wide switch for the promo banner. Signed off 2026-08-27.
*
* Deliberately a flag rather than a deletion. The campaign promos in
* ./promos/campaigns.ts are generated from the Confluence calendar and carry
* their own `isActive` and date windows — switching them off here would be
* undone by the next `bun run pull-campaigns`, and editing that file is
* explicitly out of bounds. Turning the banner off at the point of use leaves
* the calendar as the source of truth and keeps it updating in the background,
* so bringing the banner back is this one flag plus a redeploy.
*
* Scope is the banner only: the exit-intent popup and the video promos are
* separate surfaces and are unaffected.
*/
export const PROMO_BANNER_ENABLED = false;
const promoData: Record<string, PromoData> = {
...firstPartyPromos,
...campaignBannerPromos,
...campaignVideoPromos,
};
export default promoData;
/**
* The "Top-5 trending plugins" list for today, from the Confluence calendar.
* Shared by the homepage section and the footer's plugin column. Resolved at
* build time, so a new window goes live with the next deploy.
*/
export const getTopPlugins = (today?: string): TopListItem[] =>
getCurrentTopList(Object.values(campaignTopLists), today)?.items ?? [];