Skip to content

Commit edb0ff0

Browse files
committed
style guide page & fix filter logic
1 parent 0de709e commit edb0ff0

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

src/components/ProductChangelog.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if ("product" in input) {
3939
!e.data.hidden &&
4040
e.data.products.some(({ id }) => id === input.product.id) &&
4141
input.hideEntry !== e.id &&
42-
input.scheduled === e.data.scheduled
42+
input.scheduled == e.data.scheduled
4343
);
4444
};
4545
} else {
@@ -55,6 +55,8 @@ if ("product" in input) {
5555
}
5656
5757
const changelogs = await getChangelogs({ filter });
58+
59+
console.log(changelogs.length);
5860
---
5961

6062
<RSSButton href={rss} />
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: ProductChangelog
3+
styleGuide:
4+
component: ProductChangelog
5+
---
6+
7+
This component can be used to display entries from the [changelog](/changelog/) for a given product or product area.
8+
9+
## Import
10+
11+
```mdx
12+
import { ProductChangelog } from "~/components";
13+
```
14+
15+
## Usage
16+
17+
```mdx
18+
import { ProductChangelog } from "~/components";
19+
20+
<ProductChangelog product="workers" />
21+
```
22+
23+
## `<ProductChangelog>` Props
24+
25+
The `product` and `area` props cannot be used at the same time.
26+
27+
### `product`
28+
29+
**type:** `string`
30+
31+
The name of the product.
32+
33+
### `area`
34+
35+
**type:** `string`
36+
37+
The name of the product area.
38+
39+
### `hideEntry`
40+
41+
**type:** `string`
42+
43+
The name of a specific entry to hide.
44+
45+
### `scheduled`
46+
47+
**type:** `boolean`
48+
49+
**default:** `false`
50+
51+
Used to only show scheduled entries (i.e for WAF changelogs).

src/content/docs/style-guide/documentation-content-strategy/content-types/changelog.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ The combination of these files allows us to:
4747

4848
Your Markdown file needs to have several special values to pull in the changelog information. These values are highlighted in the sample page.
4949

50+
For more information about the `ProductChangelog` component, refer to the [style guide](/style-guide/components/product-changelog/).
51+
5052
```mdx title="/src/content/docs/dns/changelog.mdx"
5153
---
5254
pcx_content_type: changelog
@@ -119,7 +121,6 @@ Each changelog entries has the following properties:
119121
- `preview_image` <Type text="string" /> <MetaInfo text="optional" />
120122
- Path to an image file
121123
- `products` <Type text="Array<String>" /> <MetaInfo text="(default: current location) optional" />
122-
123124
- The products list is case-sensitive. Only use lowercase.
124125
- This should be an array of strings, each referring to the name of a file in the products collection without the file extension.
125126
- The folder that your entry is in, such as `src/content/changelog/workers/2025-02-13-new-product-feature.mdx`, is inferred as part of this property. If you do not want to associate the entry with additional products, you can omit it from the frontmatter entirely.

0 commit comments

Comments
 (0)