Skip to content

Commit 7fc7254

Browse files
authored
Merge branch 'production' into kian/PCX-16001
2 parents f5e03a0 + f4097ff commit 7fc7254

File tree

234 files changed

+2287
-859
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+2287
-859
lines changed

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
GH_REPO: ${{ github.repository }}
3737
NUMBER: ${{ github.event.pull_request.number }}
3838
- name: Internal comment
39-
run: gh pr comment "$NUMBER" --body "Howdy and thanks for contributing to our repo. We review internal PRs with **1 week**. If it's something urgent or has been sitting without a comment, start a thread in the *Developer Docs* space internally."
39+
run: gh pr comment "$NUMBER" --body "Howdy and thanks for contributing to our repo. We review internal PRs within **1 week**. If it's something urgent or has been sitting without a comment, start a thread in the *Developer Docs* space internally."
4040
if: steps.check_if_contributor_is_external.outputs.is_external == 'false'
4141
env:
4242
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

public/_redirects

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@
463463
/fundamentals/get-started/http-request-headers/ /fundamentals/reference/http-headers/ 301
464464
/fundamentals/get-started/network-ports/ /fundamentals/reference/network-ports/ 301
465465
/fundamentals/get-started/basic-tasks/improve-seo/ /fundamentals/performance/improve-seo/ 301
466+
/fundamentals/basic-tasks/improve-seo/ /fundamentals/performance/improve-seo/ 301
466467
/fundamentals/get-started/basic-tasks/allow-cloudflare-ip-addresses/ /fundamentals/concepts/cloudflare-ip-addresses/ 301
467468
/fundamentals/get-started/basic-tasks/account-setup/ /fundamentals/setup/account/ 301
468469
/fundamentals/get-started/concepts/cdn-cgi-endpoint/ /fundamentals/reference/cdn-cgi-endpoint/ 301
@@ -544,13 +545,15 @@
544545
/fundamentals/get-started/get-started-external-link/ /learning-paths/get-started/ 301
545546
/fundamentals/get-started/task-guides/prevent-ddos-attacks-external/ /learning-paths/prevent-ddos-attacks/ 301
546547
/fundamentals/get-started/task-guides/origin-health/free/ /fundamentals/security/protect-your-origin-server/ 301
548+
/fundamentals/basic-tasks/protect-your-origin-server/ /fundamentals/security/protect-your-origin-server/ 301
547549
/fundamentals/get-started/task-guides/origin-health/business/ /fundamentals/security/protect-your-origin-server/ 301
548550
/fundamentals/get-started/task-guides/origin-health/pro/ /fundamentals/security/protect-your-origin-server/ 301
549-
/fundamentals/get-started/task-guides/origin-health/enterprise/ /fundamentals/security/protect-your-origin-server/301
551+
/fundamentals/get-started/task-guides/origin-health/enterprise/ /fundamentals/security/protect-your-origin-server/ 301
550552
/fundamentals/get-started/task-guides/origin-health/ /fundamentals/security/protect-your-origin-server/ 301
551553
/fundamentals/get-started/task-guides/ /fundamentals/basic-tasks/ 301
552554
/fundamentals/get-started/setup/ /fundamentals/setup/ 301
553555
/fundamentals/get-started/setup/minimize-downtime/ /fundamentals/performance/minimize-downtime/ 301
556+
/fundamentals/basic-tasks/maintenance-mode/ /fundamentals/performance/minimize-downtime/ 301
554557
/fundamentals/get-started/concepts/what-is-cloudflare/ /fundamentals/concepts/what-is-cloudflare/ 301
555558
/fundamentals/get-started/concepts/cloudflare-challenges/ /waf/reference/cloudflare-challenges/ 301
556559
/fundamentals/get-started/concepts/accounts-and-zones/ /fundamentals/setup/accounts-and-zones/ 301
@@ -567,14 +570,17 @@
567570
/fundamentals/get-started/basic-tasks/manage-domains/redirect-domain/ /fundamentals/setup/manage-domains/redirect-domain/ 301
568571
/fundamentals/get-started/basic-tasks/cloudflare-without-changing-nameservers/ /fundamentals/setup/use-cloudflare-without-changing-nameservers/ 301
569572
/fundamentals/get-started/basic-tasks/interact-with-cloudflare/ /fundamentals/setup/interact-with-cloudflare/ 301
573+
/fundamentals/basic-tasks/interact-with-cloudflare/ /fundamentals/setup/interact-with-cloudflare/ 301
570574
/fundamentals/get-started/basic-tasks/manage-subdomains/ /fundamentals/setup/manage-domains/manage-subdomains/ 301
571575
/fundamentals/get-started/basic-tasks/report-abuse/provide-specific-urls/ /fundamentals/reference/report-abuse/provide-specific-urls/ 301
572576
/fundamentals/get-started/basic-tasks/report-abuse/complaint-types/ /fundamentals/reference/report-abuse/complaint-types/ 301
573577
/fundamentals/get-started/basic-tasks/report-abuse/ /fundamentals/reference/report-abuse/ 301
574578
/fundamentals/get-started/basic-tasks/access-compliance-docs/ /fundamentals/reference/policies-compliances/compliance-docs/ 301
575579
/fundamentals/get-started/basic-tasks/under-ddos-attack/ /fundamentals/security/under-ddos-attack/ 301
580+
/fundamentals/basic-tasks/under-ddos-attack/ /fundamentals/security/under-ddos-attack/ 301
576581
/fundamentals/get-started/basic-tasks/test-speed/ /fundamentals/performance/test-speed/ 301
577-
/fundamentals/get-started/basic-tasks/ /fundamentals/basic-tasks/ 301
582+
/fundamentals/basic-tasks/test-speed/ /fundamentals/performance/test-speed/ 301
583+
/fundamentals/get-started/basic-tasks/ /fundamentals/performance/test-speed/ 301
578584
/fundamentals/get-started/basic-tasks/account-security/securing-a-compromised-account/ /fundamentals/setup/account/account-security/secure-a-compromised-account/ 301
579585
/fundamentals/get-started/basic-tasks/account-security/review-audit-logs/ /fundamentals/setup/account/account-security/review-audit-logs/ 301
580586
/fundamentals/get-started/basic-tasks/account-security/manage-active-sessions/ /fundamentals/setup/account/account-security/manage-active-sessions/ 301
@@ -620,7 +626,6 @@
620626
/fundamentals/reference/changelog/ /fundamentals/reference/ 302
621627
/fundamentals/basic-tasks/optimize-speed-external-link/ /fundamentals/performance/optimize-speed-external-link/ 301
622628
/fundamentals/basic-tasks/prevent-ddos-attacks-external/ /fundamentals/security/prevent-ddos-attacks-external/ 301
623-
/fundamentals/basic-tasks/protect-your-origin-server/ /fundamentals/security/protect-your-origin-server/ 301
624629
/fundamentals/basic-tasks/pci-scans/ /fundamentals/security/pci-scans/ 301
625630
/fundamentals/basic-tasks/trace-request/ /fundamentals/trace-request/ 301
626631
/fundamentals/basic-tasks/trace-request/how-to/ /fundamentals/trace-request/how-to/ 301
@@ -1204,6 +1209,7 @@
12041209
/support/more-dashboard-apps/cloudflare-scrape-shield/why-doesnt-my-rss-feed-show-images/ /waf/tools/scrape-shield/hotlink-protection/ 301
12051210
/support/more-dashboard-apps/cloudflare-scrape-shield/ /waf/tools/scrape-shield/ 301
12061211
/support/about-cloudflare/attack-preparation-and-response/recovering-from-a-hacked-site/ /fundamentals/security/recovering-from-hacked-site/ 301
1212+
/fundamentals/basic-tasks/recovering-from-hacked-site/ /fundamentals/security/recovering-from-hacked-site/ 301
12071213
/support/firewall/learn-more/configuring-token-authentication/ /waf/custom-rules/use-cases/configure-token-authentication/ 301
12081214
/support/firewall/learn-more/ /waf/troubleshooting/ 301
12091215
/support/firewall/ /waf/troubleshooting/ 301
@@ -1224,8 +1230,9 @@
12241230
/support/ssl-tls/faq-and-reference/ /ssl/reference/ 301
12251231
/support/account-management-billing/account-privacy-and-security/understanding-samesite-cookie-interaction-with-cloudflare/ /waf/troubleshooting/samesite-cookie-interaction/ 301
12261232
/support/account-management-billing/account-privacy-and-security/ /support/account-management-billing/ 301
1227-
/support/troubleshooting/general-troubleshooting/troubleshooting-surges-or-spikes-in-web-traffic/ /fundamentals/performance/preparing-for-surges-or-spikes-in-web-traffic/ 301
1233+
/support/troubleshooting/general-troubleshooting/troubleshooting-surges-or-spikes-in-web-traffic/ /fundamentals/basic-tasks/preparing-for-surges-or-spikes-in-web-traffic/ 301
12281234
/support/troubleshooting/general-troubleshooting/preparing-for-surges-or-spikes-in-web-traffic/ /fundamentals/performance/preparing-for-surges-or-spikes-in-web-traffic/ 301
1235+
/fundamentals/basic-tasks/preparing-for-surges-or-spikes-in-web-traffic/ /fundamentals/performance/preparing-for-surges-or-spikes-in-web-traffic/ 301
12291236
/support/third-party-software/others/configuring-an-amazon-web-services-static-site-to-use-cloudflare/ /rules/cloud-connector/providers/ 301
12301237
/support/third-party-software/others/enabling-cloudflare-ssl-on-azure-storage-static-web-hosting-applications/ /rules/cloud-connector/providers/ 301
12311238

@@ -1343,6 +1350,9 @@
13431350
/waf/tools/scrape-shield/server-side-excludes/ /waf/tools/scrape-shield/ 301
13441351
/waf/rate-limiting-rules/create-account-dashboard/ /waf/account/rate-limiting-rulesets/create-dashboard/ 301
13451352
/waf/managed-rules/deploy-account-dashboard/ /waf/account/managed-rulesets/deploy-dashboard/ 301
1353+
/waf/analytics/security-events/free-plan/ /waf/analytics/security-events/ 301
1354+
/waf/analytics/security-events/paid-plans/ /waf/analytics/security-events/ 301
1355+
/waf/analytics/security-events/additional-information/ /waf/tools/validation-checks/ 301
13461356

13471357
# waiting-room
13481358
/waiting-room/how-to/mobile-traffic/ /waiting-room/how-to/json-response/ 301
@@ -1884,6 +1894,7 @@
18841894
/cloudflare-one/policies/browser-isolation/agentless/* /cloudflare-one/policies/browser-isolation/setup/:splat 301
18851895
/cloudflare-one/policies/filtering/http-policies/data-loss-prevention/* /cloudflare-one/policies/data-loss-prevention/ 301
18861896
/cloudflare-one/policies/data-loss-prevention/configuration-guides/* /cloudflare-one/policies/data-loss-prevention/dlp-policies/common-policies/ 301
1897+
/cloudflare-one/insights/dex/fleet-status/ /cloudflare-one/insights/dex/monitoring/ 301
18871898

18881899
# Learning paths
18891900
/learning-paths/modules/cybersafe/cybersafe-account-creation/* /learning-paths/cybersafe/account-creation/:splat 301
-84.7 KB
Binary file not shown.
-16.6 KB
Binary file not shown.
-10.3 KB
Loading
139 KB
Loading

src/components/Markdown.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
import { z } from "astro:schema";
33
import { marked } from "marked";
4+
import dedent from "dedent";
45
56
type Props = z.infer<typeof props>;
67
78
const props = z.object({
8-
text: z.string(),
9+
text: z.string().transform((val) => dedent(val)),
910
inline: z.boolean().default(true),
1011
});
1112

src/components/ModelCatalog.tsx

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState } from "react";
1+
import { useEffect, useState } from "react";
22
import ModelInfo from "./models/ModelInfo";
33
import ModelBadges from "./models/ModelBadges";
44
import { authorData } from "./models/data";
@@ -19,6 +19,22 @@ const ModelCatalog = ({ models }: { models: WorkersAIModelsSchema[] }) => {
1919
capabilities: [],
2020
});
2121

22+
useEffect(() => {
23+
const params = new URLSearchParams(window.location.search);
24+
25+
const search = params.get("search") ?? "";
26+
const authors = params.getAll("authors");
27+
const tasks = params.getAll("tasks");
28+
const capabilities = params.getAll("capabilities");
29+
30+
setFilters({
31+
search,
32+
authors,
33+
tasks,
34+
capabilities,
35+
});
36+
}, []);
37+
2238
const mapped = models.map((model) => ({
2339
model: {
2440
...model,
@@ -53,6 +69,8 @@ const ModelCatalog = ({ models }: { models: WorkersAIModelsSchema[] }) => {
5369
if (property_id === "function_calling" && value === "true") {
5470
return "Function calling";
5571
}
72+
73+
return [];
5674
})
5775
.filter(Boolean),
5876
),
@@ -101,7 +119,7 @@ const ModelCatalog = ({ models }: { models: WorkersAIModelsSchema[] }) => {
101119

102120
<div className="!mb-8 hidden md:block">
103121
<span className="text-sm font-bold uppercase text-gray-600 dark:text-gray-200">
104-
Model Types
122+
Tasks
105123
</span>
106124

107125
{tasks.map((task) => (
@@ -110,7 +128,8 @@ const ModelCatalog = ({ models }: { models: WorkersAIModelsSchema[] }) => {
110128
type="checkbox"
111129
className="mr-2"
112130
value={task}
113-
onClick={(e) => {
131+
checked={filters.tasks.includes(task)}
132+
onChange={(e) => {
114133
const target = e.target as HTMLInputElement;
115134

116135
if (target.checked) {
@@ -141,8 +160,9 @@ const ModelCatalog = ({ models }: { models: WorkersAIModelsSchema[] }) => {
141160
<input
142161
type="checkbox"
143162
value={capability}
163+
checked={filters.capabilities.includes(capability)}
144164
className="mr-2"
145-
onClick={(e) => {
165+
onChange={(e) => {
146166
const target = e.target as HTMLInputElement;
147167

148168
if (target.checked) {
@@ -176,7 +196,8 @@ const ModelCatalog = ({ models }: { models: WorkersAIModelsSchema[] }) => {
176196
type="checkbox"
177197
className="mr-2"
178198
value={author}
179-
onClick={(e) => {
199+
checked={filters.authors.includes(author)}
200+
onChange={(e) => {
180201
const target = e.target as HTMLInputElement;
181202

182203
if (target.checked) {

src/components/Render.astro

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,49 @@ const props = z.object({
1313
let { file, product, params } = props.parse(Astro.props);
1414
1515
if (!product) {
16-
product = Astro.params.slug?.split("/")[0];
17-
}
16+
const fromSlug = Astro.params.slug?.split("/")[0];
1817
19-
if (!product) {
20-
throw new Error(
21-
`[Render] Unable to infer which folder ${file} is in, please provide a "product" input with your "file" input.`,
22-
);
18+
if (!fromSlug) {
19+
throw new Error(
20+
`[Render] Unable to infer which folder ${file} is in, please provide a "product" input with your "file" input.`,
21+
);
22+
}
23+
24+
product = fromSlug;
2325
}
2426
25-
const partial = await getEntry("partials", `${product}/${file}`);
27+
const id = `${product}/${file}`;
28+
const partial = await getEntry("partials", id);
2629
2730
if (!partial) {
2831
throw new Error(
29-
`[Render] Couldn't find partial: ${file}. Included on ${Astro.params.slug}`,
32+
`[Render] Couldn't find "${id}" included on "${Astro.url.pathname}"`,
3033
);
3134
}
3235
36+
// We currently only enforce parameters if `params` is set in the frontmatter,
37+
// until we can migrate existing `inputParameters` frontmatter to `params`.
3338
if (partial.data.params) {
34-
const expected = partial.data.params;
35-
if (!params)
39+
const expected = partial.data.params.sort();
40+
const optional = expected.filter((p) => p.endsWith("?"));
41+
const received = Object.keys(params ?? {}).sort();
42+
43+
const maximum = expected.length;
44+
const minimum = maximum - optional.length;
45+
46+
if (
47+
received.length < minimum ||
48+
received.length > maximum ||
49+
expected.some((p: string) => {
50+
if (p.endsWith("?")) return false;
51+
52+
return !received.includes(p);
53+
})
54+
) {
3655
throw new Error(
37-
`${file} included on ${Astro.params.slug} expected parameters: ${expected}, got none`,
56+
`[Render] Expected parameters ${JSON.stringify(expected)} but received parameters ${JSON.stringify(received)} for "${file}" included on "${Astro.url.pathname}"`,
3857
);
58+
}
3959
}
4060
4161
const { Content } = await render(partial);

src/components/models/ModelBadges.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const ModelBadges = ({ model }: { model: WorkersAIModelsSchema }) => {
3333
<ul className="m-0 flex list-none items-center gap-2 p-0 text-xs">
3434
{badges.map((badge) => (
3535
<li key={badge.text}>
36-
<span className="sl-badge gray">{badge.text}</span>
36+
<span className="sl-badge default">{badge.text}</span>
3737
</li>
3838
))}
3939
</ul>

0 commit comments

Comments
 (0)