Skip to content

Commit 5330c49

Browse files
committed
refactor: CommunityBlog type, require feed OR name
If feed present, name not needed (fetched from feed); if no feed, name required. href to blog always required
1 parent b0b809b commit 5330c49

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

src/lib/constants.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,38 +168,31 @@ export const _0X_PARC_FEED = "https://rss.app/feeds/cWXGYts0ZM8C3F6t.xml"
168168

169169
export const COMMUNITY_BLOGS: CommunityBlog[] = [
170170
{
171-
name: "Vitalik Buterin",
172171
href: "https://vitalik.eth.limo/",
173172
feed: VITALIK_FEED,
174173
},
175174
{
176-
name: "Ethereum Foundation",
177175
href: "https://blog.ethereum.org/",
178176
feed: "https://blog.ethereum.org/en/feed.xml",
179177
},
180178
{
181-
name: "ethPandaOps",
182179
href: "https://ethpandaops.io/posts/",
183180
feed: "https://ethpandaops.io/posts/index.xml",
184181
},
185182
{
186-
name: "EthStaker",
187183
href: "https://ethstaker.cc/blog",
188184
feed: "https://paragraph.xyz/api/blogs/rss/@ethstaker",
189185
},
190186
{
191-
name: "0xParc",
192187
href: "https://0xparc.org/blog",
193188
feed: _0X_PARC_FEED,
194189
},
195190
{
196-
name: "Attestant",
197191
href: "https://www.attestant.io/posts/",
198192
feed: "https://www.attestant.io/posts/",
199193
},
200194
{ name: "Devcon", href: "https://devcon.org/en/blogs/" },
201195
{
202-
name: "Solidity",
203196
href: "https://soliditylang.org/blog/",
204197
feed: SOLIDITY_FEED,
205198
},

src/lib/types.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,10 +803,8 @@ export type RSSResult = {
803803
}
804804

805805
export type CommunityBlog = {
806-
name: string
807806
href: string
808-
feed?: string
809-
}
807+
} & ({ name: string; feed?: string } | { name?: string; feed: string })
810808

811809
type NestedDivs = {
812810
div: NestedDivs[]

0 commit comments

Comments
 (0)