@@ -7,8 +7,6 @@ import { slug } from "github-slugger";
77import RSSButton from " ~/components/RSSButton.astro" ;
88import AnchorHeading from " ~/components/AnchorHeading.astro" ;
99import { format } from " date-fns" ;
10- import ProductPills from " ~/components/changelog/ProductPills.astro" ;
11-
1210const props = z
1311 .object ({
1412 product: reference (" products" ),
@@ -21,13 +19,11 @@ const props = z
2119const input = await props .parseAsync (Astro .props );
2220let filter: GetChangelogsOptions [" filter" ];
2321let rss: string ;
24- let areaFeed: boolean
2522if (" product" in input ) {
2623 rss = ` /changelog/rss/${input .product .id }.xml ` ;
2724 filter = (e ) => {
2825 return ! e .data .hidden && e .data .products .some (({ id }) => id === input .product .id );
2926 };
30- areaFeed = false ;
3127} else {
3228 rss = ` /changelog/rss/${slug (input .area )}.xml ` ;
3329 const products = await getCollection (" products" , (e ) => {
@@ -36,7 +32,6 @@ if ("product" in input) {
3632 filter = (e ) => {
3733 return e .data .products .some ((x ) => products .some ((y ) => x .id === y .id ));
3834 };
39- areaFeed = true ;
4035}
4136const changelogs = await getChangelogs ({ filter });
4237---
@@ -45,29 +40,15 @@ const changelogs = await getChangelogs({ filter });
4540
4641{
4742 changelogs .map (async (entry ) => {
48- const { Content } = await render (entry );
4943
50- // If areaFeed is true, add ProductPills
51- if (areaFeed === true ) {
52- return (
53- <AnchorHeading depth = { 2 } title = { format (entry .data .date , " yyyy-MM-dd" )} />
54- <ProductPills products = { entry .data .products } />
55- <br />
56- <strong >{ entry .data .title } </strong >
57- <br />
58- <Content />
59- );
60- }
6144
62- // Default output
45+ const { Content } = await render ( entry );
6346 return (
64- <>
65- <AnchorHeading depth = { 2 } title = { format (entry .data .date , " yyyy-MM-dd" )} />
66- <br />
67- <strong >{ entry .data .title } </strong >
68- <br />
69- <Content />
70- </>
47+ <AnchorHeading depth = { 2 } title = { format (entry .data .date , " yyyy-MM-dd" )} />
48+ <br />
49+ <strong >{ entry .data .title } </strong >
50+ <br />
51+ <Content />
7152 );
7253 })
7354}
0 commit comments