Skip to content

Commit 7f5a9ce

Browse files
KianNHkodster28
andauthored
[Docs Site] Add AvailableChangelogFeeds component (#21001)
* [Docs Site] Add AvailableChangelogFeeds component * astro check errors * fix p tag * aside for ddos and waf * work from products that have entries * move aside * Small tweaks to naming and organization * rephrase * Remove link * Add API deprecations callout * whoops, remove logging * update name * fix schema * move changelog back to file * Add connecting sentence --------- Co-authored-by: kodster28 <[email protected]>
1 parent 6d82217 commit 7f5a9ce

File tree

5 files changed

+203
-0
lines changed

5 files changed

+203
-0
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
import { Aside } from "@astrojs/starlight/components";
3+
4+
import AnchorHeading from "./AnchorHeading.astro";
5+
import RSSButton from "./RSSButton.astro";
6+
import Details from "./Details.astro";
7+
8+
import { getCollection } from "astro:content";
9+
import { getChangelogs } from "~/util/changelog";
10+
11+
const changelogs = await getChangelogs({});
12+
const productsInChangelog = changelogs.flatMap((entry) =>
13+
entry.data.products.map((product) => product.id),
14+
);
15+
16+
const products = await getCollection("products", (entry) => {
17+
return productsInChangelog.includes(entry.id);
18+
});
19+
20+
const productsByGroup = Object.entries(
21+
Object.groupBy(
22+
products.filter((product) => Boolean(product.data.product.group)),
23+
(product) => product.data.product.group,
24+
),
25+
).sort();
26+
---
27+
28+
<AnchorHeading depth={2} title="Feeds" />
29+
30+
<AnchorHeading depth={3} title="Global feed" />
31+
<p>
32+
This feed contains entries for all Cloudflare products in the changelog: <RSSButton
33+
changelog="index"
34+
/>
35+
</p>
36+
37+
<AnchorHeading depth={3} title="Area-specific feeds" />
38+
39+
<p>
40+
Cloudflare also offers RSS feeds scoped to specific product areas or products
41+
in the <a href="/changelog/">changelog</a>.
42+
</p>
43+
44+
{
45+
productsByGroup.map(([group, products]) => (
46+
<>
47+
<AnchorHeading depth={4} title={group} />
48+
<p>
49+
This feed is for all {group} products in the changelog:{" "}
50+
<RSSButton changelog={group} />
51+
</p>
52+
<Details header="Included products">
53+
<ul>
54+
{products?.map((product) => (
55+
<li>
56+
<p>
57+
<a href={product.data.product.url}>
58+
{product.data.product.title}
59+
</a>
60+
</p>
61+
<RSSButton changelog={product.id} />
62+
</li>
63+
))}
64+
</ul>
65+
</Details>
66+
{group === "Application security" && (
67+
<Aside type="note" title="DDoS and WAF ruleset feeds">
68+
<p>
69+
For <a href="/ddos-protection/">DDoS Protection</a> or{" "}
70+
<a href="/waf/">WAF</a> updates to managed rulesets, please refer to
71+
their independent feeds:
72+
<ul>
73+
<li>
74+
<p>
75+
<a href="/ddos-protection/change-log/network/">
76+
Network-layer DDoS managed ruleset
77+
</a>
78+
</p>
79+
<RSSButton href="/ddos-protection/change-log/network/index.xml" />
80+
</li>
81+
<li>
82+
<p>
83+
<a href="/ddos-protection/change-log/http/">
84+
HTTP DDoS managed ruleset
85+
</a>
86+
</p>
87+
<RSSButton href="/ddos-protection/change-log/http/index.xml" />
88+
</li>
89+
<li>
90+
<p>
91+
<a href="/waf/change-log/">WAF managed ruleset</a>
92+
</p>
93+
<RSSButton href="/waf/change-log/index.xml" />
94+
</li>
95+
</ul>
96+
</p>
97+
</Aside>
98+
)}
99+
{group === "Core platform" && (
100+
<Aside type="note" title="API deprecations feed">
101+
<p>
102+
Cloudflare also maintains a separate{" "}
103+
<a href="/fundamentals/api/reference/deprecations/">
104+
API deprecations page.
105+
</a>
106+
<br />
107+
<RSSButton href="/fundamentals/api/reference/deprecations/index.xml" />
108+
</p>
109+
</Aside>
110+
)}
111+
</>
112+
))
113+
}

src/components/RSSButton.astro

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
import { z } from "astro:schema";
3+
import { Icon } from "@astrojs/starlight/components";
4+
5+
const props = z
6+
.object({
7+
changelog: z
8+
.string()
9+
.transform((val) => val.toLowerCase().replaceAll(" ", "-")),
10+
})
11+
.or(
12+
z.object({
13+
href: z.string(),
14+
}),
15+
);
16+
17+
const input = props.parse(Astro.props);
18+
---
19+
20+
<a
21+
href={"href" in input ? input.href : `/changelog/rss/${input.changelog}.xml`}
22+
class="inline-flex items-center justify-center gap-1 rounded font-semibold no-underline"
23+
target="_blank"
24+
>
25+
Subscribe to RSS
26+
<Icon name="rss" size="1.25rem" />
27+
</a>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Available RSS Feeds
3+
pcx_content_type: reference
4+
description: Read about the various RSS feeds available for Cloudflare's changelogs.
5+
---
6+
7+
import AvailableChangelogFeeds from "~/components/AvailableChangelogFeeds.astro";
8+
9+
Cloudflare offers various RSS feeds as part of our [changelog](/changelog/), which helps you stay up to date on new features and functionality.
10+
11+
For more details on how these feeds are structured, refer to [Consuming RSS Feeds](/fundamentals/new-features/consuming-rss-feeds/).
12+
13+
<AvailableChangelogFeeds />
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Consuming RSS Feeds
3+
pcx_content_type: reference
4+
description: Learn how to consume our changelog RSS feeds.
5+
---
6+
7+
Our [changelogs](/changelog/) are published to [various RSS feeds](/fundamentals/new-features/available-rss-feeds/) with HTML in the `<description>` tag.
8+
9+
In feeds with multiple products, such as the global or product-area feeds, the products associated with a given entry are in the `<category>` tag.
10+
11+
A single product will also appear in the custom `<product>` tag for legacy reasons, but we recommend you use the `<category>`
12+
13+
## Example XML
14+
15+
```xml
16+
<rss version="2.0">
17+
<channel>
18+
<title>Cloudflare changelogs</title>
19+
<description>Updates to various Cloudflare products</description>
20+
<link>https://developers.cloudflare.com/changelog/</link>
21+
<item>
22+
<title>Agents, Workers, Workflows - Build AI Agents with Example Prompts</title>
23+
<link>https://developers.cloudflare.com/changelog/2025-02-14-example-ai-prompts/</link>
24+
<guid isPermaLink="true">https://developers.cloudflare.com/changelog/2025-02-14-example-ai-prompts/</guid>
25+
<description>
26+
<p>
27+
We've added an <a href="https://developers.cloudflare.com/workers/get-started/prompting/">example prompt</a> to help you get started with building AI agents and applications on Cloudflare ...
28+
</p>
29+
</description>
30+
<pubDate>Fri, 14 Feb 2025 19:00:00 GMT</pubDate>
31+
<product>Agents</product>
32+
<category>Agents</category>
33+
<category>Workers</category>
34+
<category>Workflows</category>
35+
</item>
36+
</channel>
37+
</rss>
38+
```
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
pcx_content_type: concept
3+
title: New features
4+
sidebar:
5+
order: 5
6+
---
7+
8+
At Cloudflare, we are constantly innovating and improving our products.
9+
10+
The best way to stay up to date with this innovation is to read our [changelog](/changelog/).
11+
12+
If you prefer to consume these updates in another format, we also offer [RSS feeds](/fundamentals/new-features/available-rss-feeds/).

0 commit comments

Comments
 (0)