Skip to content

Commit e00e6d6

Browse files
authored
Remove wid in pages themselves, update ProductAvailabilityText and si… (#28701)
* Remove wid in pages frontmatter * Update ProductAvailabilityText and sidebar beta badges to use src/content/directory entry files * removing stray ` instead of adding!
1 parent ef90a62 commit e00e6d6

File tree

25 files changed

+150
-144
lines changed

25 files changed

+150
-144
lines changed

src/components/ProductAvailabilityText.astro

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,41 @@ import { getEntry } from "astro:content";
33
import type { CollectionEntry } from "astro:content";
44
55
interface Props {
6-
product: CollectionEntry<"product-availability">["id"];
6+
product: CollectionEntry<"directory">["id"];
77
parentheses?: string;
88
}
99
1010
const { product, parentheses = "true" } = Astro.props;
1111
12-
let entry = await getEntry("product-availability", product);
12+
const directoryEntry = await getEntry("directory", product);
1313
let output = "";
1414
15-
if (!entry || !entry.data.availability) {
15+
if (!directoryEntry) {
1616
console.warn(
17-
`Product availability value not found for product="${product}" in ${Astro.url.pathname}. Returning empty.`,
17+
`Directory entry not found for product="${product}" in ${Astro.url.pathname}. Returning empty.`,
1818
);
19-
}
20-
// don't show anything for GA products
21-
else if (entry.data.availability.toUpperCase() === "GA") {
22-
console.info(
23-
`Product availability entry is GA for product="${product}" in ${Astro.url.pathname}. Returning empty.`,
24-
);
25-
}
26-
// show an availability value
27-
else {
28-
if (parentheses === "false") {
29-
output = entry.data.availability;
30-
} else {
31-
output = `(${entry.data.availability})`;
19+
} else {
20+
const availabilityId = directoryEntry.data.id;
21+
const entry = await getEntry("product-availability", availabilityId);
22+
23+
if (!entry || !entry.data.availability) {
24+
console.warn(
25+
`Product availability value not found for product="${product}" (id="${availabilityId}") in ${Astro.url.pathname}. Returning empty.`,
26+
);
27+
}
28+
// don't show anything for GA products
29+
else if (entry.data.availability.toUpperCase() === "GA") {
30+
console.info(
31+
`Product availability entry is GA for product="${product}" (id="${availabilityId}") in ${Astro.url.pathname}. Returning empty.`,
32+
);
33+
}
34+
// show an availability value
35+
else {
36+
if (parentheses === "false") {
37+
output = entry.data.availability;
38+
} else {
39+
output = `(${entry.data.availability})`;
40+
}
3241
}
3342
}
3443
---

src/content/collections/product-availability.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,21 @@ type ProductAvailability = z.infer<typeof productAvailabilitySchema>;
1212
const productAvailabilityCollectionConfig: CollectionConfig<
1313
typeof productAvailabilitySchema
1414
> = {
15-
loader: middlecacheLoader("v1/products/availability_certification.json", {
16-
parser: (fileContent: string) => {
17-
const data = JSON.parse(fileContent);
18-
const lookup: Record<string, ProductAvailability> = {};
15+
loader: middlecacheLoader(
16+
"v1/products/reconciled-availability-certification.json",
17+
{
18+
parser: (fileContent: string) => {
19+
const data = JSON.parse(fileContent);
20+
const lookup: Record<string, ProductAvailability> = {};
1921

20-
for (const item of data) {
21-
lookup[item.name] = { availability: item.availability };
22-
}
22+
for (const item of data) {
23+
lookup[item.id] = { availability: item.availability };
24+
}
2325

24-
return lookup;
26+
return lookup;
27+
},
2528
},
26-
}),
29+
),
2730
schema: productAvailabilitySchema,
2831
};
2932

src/content/directory/warp-connector.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: warp-connector
33

44
entry:
55
title: WARP Connector
6-
url: /cloudflare-one/connections/connect-networks/private-net/warp-connector/
6+
url: /cloudflare-one/networks/connectors/cloudflare-tunnel/private-net/warp-connector/
77
show: false
88

99
meta:

src/content/directory/workers-smart-placement.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: workers-smart-placement
33

44
entry:
55
title: Placement
6-
url: /workers/configuration/smart-placement/
6+
url: /workers/configuration/placement/
77
show: false
88

99
meta:

src/content/docs/ai-crawl-control/features/pay-per-crawl/index.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: Pay Per Crawl
33
pcx_content_type: navigation
4-
wid: pay-per-crawl
54
sidebar:
65
group:
76
hideIndex: true

src/content/docs/cloudflare-one/networks/connectors/cloudflare-tunnel/private-net/warp-connector/index.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
pcx_content_type: concept
33
title: WARP Connector
4-
wid: warp-connector
54
sidebar:
65
label: Overview
76
order: 5
@@ -10,13 +9,13 @@ sidebar:
109
tableOfContents: false
1110
---
1211

13-
import { Render, Details} from "~/components";
12+
import { Render, Details } from "~/components";
1413

1514
<Details header="Feature availability">
1615

1716
| [WARP modes](/cloudflare-one/team-and-resources/devices/warp/configure-warp/warp-modes/) | [Zero Trust plans](https://www.cloudflare.com/teams-pricing/) |
18-
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
19-
| Traffic and DNS mode | All plans |
17+
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
18+
| Traffic and DNS mode | All plans |
2019

2120
| System | Availability |
2221
| -------- | ------------ |

src/content/docs/containers/index.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Containers (Beta)
33
order: 0
44

55
pcx_content_type: overview
6-
wid: cloudchamber
76
sidebar:
87
order: 1
98
badge:

src/content/docs/dmarc-management/index.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: Cloudflare DMARC Management
33
pcx_content_type: overview
4-
wid: dmarc-management
54
head:
65
- tag: title
76
content: Overview

src/content/docs/dns/internal-dns/index.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
pcx_content_type: overview
33
title: Internal DNS (beta)
4-
wid: internal-dns
54
sidebar:
65
order: 14
76
label: Overview
Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: Cloudflare One Multi-Cloud Networking (beta)
33
pcx_content_type: overview
4-
wid: magic-cloud
54
sidebar:
65
order: 1
76
badge:
@@ -10,13 +9,13 @@ sidebar:
109
head:
1110
- tag: title
1211
content: Multi-Cloud Networking
13-
1412
---
1513

16-
import { Description, Feature, Plan, RelatedProduct } from "~/components"
14+
import { Description, Feature, Plan, RelatedProduct } from "~/components";
1715

1816
<Description>
19-
Automate resource discovery and simplify connectivity when connecting to your public cloud.
17+
Automate resource discovery and simplify connectivity when connecting to your
18+
public cloud.
2019
</Description>
2120

2221
<Plan type="enterprise" />
@@ -33,18 +32,33 @@ Learn how to [get started](/multi-cloud-networking/get-started/).
3332

3433
## Features
3534

36-
<Feature header="Discover your cloud resources automatically" href="/multi-cloud-networking/get-started/" cta="Use cloud resource discovery">
37-
Discover your cloud resources like virtual private clouds (VPCs), subnets, virtual machines (VMs), route tables, and routes automatically, and easily set up your integrations.
35+
<Feature
36+
header="Discover your cloud resources automatically"
37+
href="/multi-cloud-networking/get-started/"
38+
cta="Use cloud resource discovery"
39+
>
40+
Discover your cloud resources like virtual private clouds (VPCs), subnets,
41+
virtual machines (VMs), route tables, and routes automatically, and easily set
42+
up your integrations.
3843
</Feature>
3944

40-
<Feature header="Automatically connect a cloud network" href="/multi-cloud-networking/cloud-on-ramps/" cta="Create cloud on-ramps">
41-
Automatically build VPN tunnels between cloud networks and Cloudflare WAN.
45+
<Feature
46+
header="Automatically connect a cloud network"
47+
href="/multi-cloud-networking/cloud-on-ramps/"
48+
cta="Create cloud on-ramps"
49+
>
50+
Automatically build VPN tunnels between cloud networks and Cloudflare WAN.
4251
</Feature>
4352

4453
---
4554

4655
## Related products
4756

48-
<RelatedProduct header="Cloudflare WAN" href="/cloudflare-wan/" product="cloudflare-wan">
49-
Connect and secure your network infrastructure with Cloudflare's global network.
57+
<RelatedProduct
58+
header="Cloudflare WAN"
59+
href="/cloudflare-wan/"
60+
product="cloudflare-wan"
61+
>
62+
Connect and secure your network infrastructure with Cloudflare's global
63+
network.
5064
</RelatedProduct>

0 commit comments

Comments
 (0)